07-06-2021 07:38 PM
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
=========================================================
Solved! Go to Solution.
07-06-2021 08:49 PM
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,
07-06-2021 08:49 PM
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,
07-06-2021 09:09 PM
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
07-07-2021 02:05 AM
Yes you do.
Jon
07-07-2021 06:20 AM
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
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