BGP Community No Advertise

Let me give an example to avoid confusion. To keep it simple and fast, I’ll use EIGRP and a distribute-list. Here’s R1:

R1#show run | begin router eigrp
router eigrp 1
 network 0.0.0.0

and R2:

R2#show run | begin router eigrp
router eigrp 1
 network 0.0.0.0

R1 has two loopback interfaces that are advertised to R2:

R2#show ip route eigrp 

      1.0.0.0/24 is subnetted, 1 subnets
D        1.1.1.0 [90/130816] via 192.168.12.1, 00:02:32, GigabitEthernet0/1
      11.0.0.0/24 is subnetted, 1 subnets
D        11.11.11.0 [90/130816] via 192.168.12.1, 00:02:32, GigabitEthernet0/1

It has learned 1.1.1.0/24 and 11.11.11.0/24. Let’s add a distribute-list:

R1(config)#router eigrp 1
R1(config-router)#distribute-list route-map NO_ADVERTISE out

Here’s a route-map:

R1(config)#access-list 1 permit 1.1.1.0 0.0.0.255

R1(config)#route-map NO_ADVERTISE deny 10
R1(config-route-map)#match ip address 1

Here’s what we have on R2:

R2#show ip route eigrp

It’s empty…why? the first route-map statement denies what we have in our access-list. The second (invisible) route-map statement is also a deny which prevents 11.11.11.0/24 from being advertised. If we want this, we have to add a permit:

R1(config)#route-map NO_ADVERTISE permit 20

This empty permit, permits everything since there is no match command. The result:

R2#show ip route eigrp 

D        11.11.11.0 [90/130816] via 192.168.12.1, 00:00:30, GigabitEthernet0/1

Rene

1 Like