04-20-2011 12:18 PM - edited 03-04-2019 12:08 PM
Good afternoon, question is can I have two different bgp policies on one router. So I can pair one network statement with a corresponding neighbor statement, and still have the other network statement corresponding with a different neighbor statement. For instance:
router bgp 65002
network 1.2.3.4
neighbor 5.6.7.8 remote-as 8080
router bgp 65002
network 9.10.11.12
neighbor 13.14.15.16 remote-as 8080
I'm trying to make both these policies exist on the same router but won't entering one overwrite the other?, how can I make both these work at the same time?
Solved! Go to Solution.
04-20-2011 01:44 PM
Hi,
the prefixes in the network command are the prefixes you are advertising via BGP to your neighbours and if you don't want a particular neighbour to know of a particular prefix but not of some prefix then you can use prefix-list or a std/extended ACL with distribute-list
ip prefix-list test1 permit 1.0.0.0/8
ip prefix-list test2 permit 5.0.0.0/8
router bgp 65002
neighbour 9.10.11.12 prefix-list test1 out
neighbour 13.14.15.16 prefix-list test2 out
To verify: do a route refresh to update policy and then sh ip bgp neighbour x.x.x.x advertised
Regards.
Alain.
04-20-2011 12:34 PM
I just tried this and this is what my config actually looks like:
router bgp 65002
no synchronization
bgp log-neighbor-changes
no auto-summary
network 1.2.3.4
network 5.6.7.8
neighbor 9.10.11.12 remote-as 8080
neighbor 13.14.15.16 remote-as 8080
So it merged my two configs without overwriting but how would I force network 1.2.3.4 to use 9.10.11.12 as its neighbor, and force network 5.6.7.8 to use 13.14.15.16 as its neighbor?
04-20-2011 01:33 PM
Hi ,
you can controll the advertisment using two route-maps
!
! this should match the exact network statement including the netmask
!
ip prefix-list a permit 1.2.3.4/8
ip prefix-list b permit 5.6.7.8/8
route-map a
match ip address prefix-list a
route-map b
match ip address prefix-list b
router bgp 65002
neighbor 9.10.11.12 route-map a out
neighbor 13.14.15.16 route-map b out
04-20-2011 01:44 PM
Hi,
the prefixes in the network command are the prefixes you are advertising via BGP to your neighbours and if you don't want a particular neighbour to know of a particular prefix but not of some prefix then you can use prefix-list or a std/extended ACL with distribute-list
ip prefix-list test1 permit 1.0.0.0/8
ip prefix-list test2 permit 5.0.0.0/8
router bgp 65002
neighbour 9.10.11.12 prefix-list test1 out
neighbour 13.14.15.16 prefix-list test2 out
To verify: do a route refresh to update policy and then sh ip bgp neighbour x.x.x.x advertised
Regards.
Alain.
04-20-2011 07:29 PM
Thanks guys, this worked perfectly for me. As usual great help from this forum. I ended up omitting the route-maps and using a config similar to the one from the second post since the route-maps seemed to be an extra step. I appreciate the replies, once again thanks....
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide