cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1783
Views
20
Helpful
4
Replies

BGP selective route advertisement

Sandip Barot
Level 1
Level 1

Hi Guys,

 

We are configuring BGP and have a requirement to advertise a specific subnet to selected BGP neighbour only and not to all.

 

Below is the configuration where we would like to advertise local subnet 192.168.200.0 only to remote as-1.

 

Is this possible and what command will enable to selective advertisement of subnets to only some neighbours and not all.

 

Thanks in advance.

 

===================================

router bgp 64520
bgp log-neighbor-changes

network 10.10.5.0 mask 255.255.255.0
network 192.168.1.0
network 192.168.100.0
network 192.168.200.0 [ This I want to adveritse only with remote-as 1 and not to remote-as2]

neighbor 10.150.2.150 remote-as 1
neighbor 10.150.2.150 local-as 64525
neighbor 10.150.2.150 description "bgp to interconnect1"

neighbor 169.254.11.10 remote-as 2
neighbor 169.254.11.10 local-as 64521
neighbor 169.254.11.10 description "bgp to interconnect2"
neighbor 169.254.11.10 ebgp-multihop 4
neighbor 169.254.11.10 soft-reconfiguration inbound

=========================================================

1 Accepted Solution

Accepted Solutions

Harold Ritter
Spotlight
Spotlight

Hi @Sandip Barot ,

 

By default, all local prefixes will be advertised to all peers. If you want to prevent 192.168.200.0/24 to be advertised to AS2, you could use a specific prefix-list for each neighbor AS as follow:

 

router bgp 64520

neighbor 10.150.2.150 route-map toAS1 out

neighbor 169.254.11.10 route-map toAS2 out

!

route-map toAS1 permit 10
match ip address prefix-list toAS1

!

route-map toAS2 permit 10
match ip address prefix-list toAS2

!

ip prefix-list toAS1 seq 10 permit 10.10.5.0/24
ip prefix-list toAS1 seq 20 permit 192.168.1.0/24
ip prefix-list toAS1 seq 30 permit 192.168.100.0/24

ip prefix-list toAS1 seq 40 permit 192.168.200.0/24

!

ip prefix-list toAS2 seq 10 permit 10.10.5.0/24
ip prefix-list toAS1 seq 20 permit 192.168.1.0/24
ip prefix-list toAS1 seq 30 permit 192.168.100.0/24

!

 

Regards,

Regards,
Harold Ritter, CCIE #4168 (EI, SP)

View solution in original post

4 Replies 4

Harold Ritter
Spotlight
Spotlight

Hi @Sandip Barot ,

 

By default, all local prefixes will be advertised to all peers. If you want to prevent 192.168.200.0/24 to be advertised to AS2, you could use a specific prefix-list for each neighbor AS as follow:

 

router bgp 64520

neighbor 10.150.2.150 route-map toAS1 out

neighbor 169.254.11.10 route-map toAS2 out

!

route-map toAS1 permit 10
match ip address prefix-list toAS1

!

route-map toAS2 permit 10
match ip address prefix-list toAS2

!

ip prefix-list toAS1 seq 10 permit 10.10.5.0/24
ip prefix-list toAS1 seq 20 permit 192.168.1.0/24
ip prefix-list toAS1 seq 30 permit 192.168.100.0/24

ip prefix-list toAS1 seq 40 permit 192.168.200.0/24

!

ip prefix-list toAS2 seq 10 permit 10.10.5.0/24
ip prefix-list toAS1 seq 20 permit 192.168.1.0/24
ip prefix-list toAS1 seq 30 permit 192.168.100.0/24

!

 

Regards,

Regards,
Harold Ritter, CCIE #4168 (EI, SP)

Sandip Barot
Level 1
Level 1

Thank you so much Harold,

 

Just one more clarification -

 

With above definition of the prefix-list, do I still need to configure below under #router bgp 64520  ?

network 10.10.5.0 mask 255.255.255.0
network 192.168.1.0
network 192.168.100.0
network 192.168.200.0

 

 

Yes you do.

 

Jon

Hello @Sandip Barot ,

yes because now BGP defaults to no auto-summary so it looks for an exact match in the IP routing table when using the network command.

 

Hope to help

Giuseppe