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

Rashmi Bhardwaj | Blog,Config & Troubleshoot
Google ADs

BGP Conditional Advertisement

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

BGP Advertise-map & Non-Exist Map

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

Google ADs

If a route prefix is not present in the 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 the below example to further understand the behaviour:

BGP advertise-map

 

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 100bgp log-neighbor-changes

network 1.1.1.1 mask 255.255.255.255

neighbor 9.9.12.2 remote-as 200

Related- BGP Table-Map

CONFIGURATION ON R2:

router bgp 200bgp 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 300bgp log-neighbor-changes

neighbor 9.9.23.2 remote-as 200

Related- BGP Suppress Map & Attribute Map

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.2Status 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.2Status 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.3Status 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 lo0R1(config-if)#sh

R2’s BGP Table:

R2#sh ip bgpBGP 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.2Status 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.3Status 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

Related- Advertisement Control in BGP With Incorrect Route Map Name

ABOUT THE AUTHOR


Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart