BGP Conditional Route Advertisement Using Non-Exist-Map & Advertise-Map

The use of BGP conditional Rote advertisement is mostly seen on the multi-homed environments i.e. sites having connection to two different ISPs.

BGP will advertise all the routes to its neighbors if no filtering has been done.BGP conditional advertisement feature makes use of advertise-maps and non-exist-maps to control the route advertisements.

If a route prefix is not present in output of the non-exist-map command, then the route specified by the advertise-map command is announced. This feature is useful for multi-homed networks, in which some prefixes are advertised to one of the providers only if information from the other provider is not present. This will help us identify partial reachability.

We will take the help of below example to further understand the behavior:

 

With the BGP conditional advertisement feature, you can now accomplish these tasks on R2:

  • If 1.1.1.1/32 exists in R2’s BGP table, then do not advertise the 2.2.2.2/32 network to R3.
  • If 1.1.1.1/32 does not exist in R2’s BGP table, then advertise the 2.2.2.2/32 network to R3.

Configuration on R1:

router bgp 100

bgp log-neighbor-changes

network 1.1.1.1 mask 255.255.255.255

neighbor 9.9.12.2 remote-as 200

Configuration on R2:

router bgp 200

bgp log-neighbor-changes

network 2.2.2.2 mask 255.255.255.255

neighbor 9.9.12.1 remote-as 100

neighbor 9.9.23.3 remote-as 300

neighbor 9.9.23.3 advertise-map Advertise non-exist-map Non-Exist

!

access-list 10 permit 2.2.2.2

access-list 20 permit 1.1.1.1

!

route-map Non-Exist permit 10

match ip address 20

!

route-map Advertise permit 10

match ip address 10

Configurations on R3:

router bgp 300

bgp log-neighbor-changes

neighbor 9.9.23.2 remote-as 200

 

Verification:

We see route of 1.1.1.1 is installed in BGP table of R2 and hence route of 2.2.2.2 isn’t advertised to R3.

R2#sh ip bgp

BGP table version is 3, local router ID is 2.2.2.2

Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,

r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,

x best-external, a additional-path, c RIB-compressed,

Origin codes: i – IGP, e – EGP, ? – incomplete

RPKI validation codes: V valid, I invalid, N Not found

Network         Next Hop           Metric LocPrf Weight Path

*> 1.1.1.1/32       9.9.12.1                 0             0 100 i

*> 2.2.2.2/32       0.0.0.0                 0         32768 I

R2#sh ip bgp neighbors 9.9.23.3 advertised-routes

BGP table version is 3, local router ID is 2.2.2.2

Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,

r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,

x best-external, a additional-path, c RIB-compressed,

Origin codes: i – IGP, e – EGP, ? – incomplete

RPKI validation codes: V valid, I invalid, N Not found

Network         Next Hop           Metric LocPrf Weight Path

*> 1.1.1.1/32       9.9.12.1                 0             0 100 i

Total number of prefixes 1

R3#sh ip bgp

BGP table version is 8, local router ID is 9.9.23.3

Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,

r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,

x best-external, a additional-path, c RIB-compressed,

Origin codes: i – IGP, e – EGP, ? – incomplete

RPKI validation codes: V valid, I invalid, N Not found

Network         Next Hop           Metric LocPrf Weight Path

*> 1.1.1.1/32       9.9.23.2                               0 200 100 I         >>>> Only 1.1.1.1/32 is received and not 2.2.2.2

Now we will shut down Lo0 interface on R1 to stop the advertisement of 1.1.1.1 to R2 and hence will see 2.2.2.2 is received on R3 now from R2.

R1(config)#int lo0

R1(config-if)#sh

R2’s BGP Table:

R2#sh ip bgp

BGP table version is 5, local router ID is 2.2.2.2

Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,

r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,

x best-external, a additional-path, c RIB-compressed,

Origin codes: i – IGP, e – EGP, ? – incomplete

RPKI validation codes: V valid, I invalid, N Not found

Network         Next Hop           Metric LocPrf Weight Path

*> 2.2.2.2/32       0.0.0.0                 0         32768 i             >>>>> No 1.1.1.1/32 route in the BGP table

R2#sh ip bgp neighbors 9.9.23.3 advertised-routes

BGP table version is 5, local router ID is 2.2.2.2

Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,

r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,

x best-external, a additional-path, c RIB-compressed,

Origin codes: i – IGP, e – EGP, ? – incomplete

RPKI validation codes: V valid, I invalid, N Not found

Network         Next Hop           Metric LocPrf Weight Path

*> 2.2.2.2/32       0.0.0.0                 0        32768 i

Total number of prefixes 1

We see now R3 will receive the route of 2.2.2.2 from R2.

R3#sh ip bgp

BGP table version is 10, local router ID is 9.9.23.3

Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,

r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,

x best-external, a additional-path, c RIB-compressed,

Origin codes: i – IGP, e – EGP, ? – incomplete

RPKI validation codes: V valid, I invalid, N Not found

Network         Next Hop           Metric LocPrf Weight Path

*> 2.2.2.2/32       9.9.23.2                 0             0 200 I

Please follow and like us:

Related Post

Comments

comments

Add a Comment