Friday, January 2, 2009

BGP snippets

BGP Default Router

R1 -------- R2

In this scenario R1 must advertise a BGP default route to R2. NO other BGP routes are allowed.


router bgp 1
neighbor {a.b.c.d} default-originate
neighbor {a.b.c.d} prefix-list DEFAULT out

ip prefix-list DEFAULT permit

BGP - NON transit area

How do you ensure a BGP area is not used as a tranit area? One answer is to ensure it only advertises routes originated in it own area.

ip as-path access-list 1 permit ^$
router bgp 1
neighbor {a.b.c.d} filter-list 1 out

Redistribution from BGP

router ospf 1
redistribute bgp 1

With the statement above all BGP EXTERNAL routes will be propogatedinto OSPF. If there is a requirement for BGP internal routes to be propogated into OSPF then the following command is required under at BGP router prompt.

router bgp 1
bgp redistribute-internal

Redistribution of a single BGP area

If redistribution from BGP is required but only from a single BGP area this can be achieved via a route-map in conjunction with an as-path access-list.

router ospf 1
redistribute bgp 1 route-map BGP2OSPF
ip as-path access-list 1 permit _54_
route-map BGP2OSPF permit 10
match as-path 1

thats it:-)

No comments: