cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
1562
Views
0
Helpful
4
Replies
Highlighted
Beginner

2 bgp policies on one router

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Advisor

Re: 2 bgp policies on one router

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.

Don't forget to rate helpful posts.
4 REPLIES 4
Beginner

Re: 2 bgp policies on one router

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?

Re: 2 bgp policies on one router

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

Advisor

Re: 2 bgp policies on one router

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.

Don't forget to rate helpful posts.
Beginner

Re: 2 bgp policies on one router

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....

CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards