Tuesday, 18 November 2014

BGP conditional advertisement

The post examines what is it conditional advertisement and the steps to configure it in BGP.

In other words, a router configured with conditional advertisement, will advertise a prefix to a peer IF another prefix exists or not exists in the BGP table. 

The goal in my mini-lab is R1 to advertise prefix 100.100.100.100/32 to R2, if it has prefix 200.200.200.200/32 in its BGP table:


 eBGP
 100.100.100.100/32 ---| R1 | -----------------------| R2| --- 200.200.200.200/32


First, we need to match the prefixes used for the condition. This can be achieved via ACL or Prefix-list.

Second, we need to match the ACL (or prefix-list) in a Route-map

Third, we need to configure the condition and attach it to the neighbor (I used exist-map, but you can use non-exist-map, which means -> advertise a prefix to the neighbor, if this prefix doesn't exist in the bgp table)

Last point to remember is that , the conditional prefix is not mandatory to be in the Routing table, but just in the BGP table.


Debug messages when UPDATE for 200.200.200.200/32 is received from R2:

*Mar  1 00:47:59.811: BGP(0): 1.1.1.2 rcvd UPDATE w/ attr: nexthop 1.1.1.2, origin i, metric 0, path 2
*Mar  1 00:47:59.811: BGP(0): 1.1.1.2 rcvd 200.200.200.200/32
*Mar  1 00:47:59.819: BGP(0): Revise route installing 1 of 1 routes for 200.200.200.200/32 -> 1.1.1.2(main) to main IP table
*Mar  1 00:47:59.919: BGP(0): Revise route installing 1 of 1 routes for 200.200.200.200/32 -> 1.1.1.2(main) to main IP table
*Mar  1 00:48:39.411: BPG(0): Condition if-advertise changes to Advertise
*Mar  1 00:48:39.411: BPG(0): Condition if-advertise changes to Advertise
*Mar  1 00:48:39.415: BGP(0): net 100.100.100.100/32 matches ADV MAP advertise: bump version to 9
*Mar  1 00:48:40.163: BGP(0): nettable_walker 100.100.100.100/32 route sourced locally
*Mar  1 00:48:40.163: BGP(0): 1.1.1.2 100.100.100.100/32 matches advertise map advertise, state: Advertise
*Mar  1 00:48:40.167: BGP(0): 1.1.1.2 send UPDATE (format) 100.100.100.100/32, next 1.1.1.1, metric 0, path Local

Debug messages when UPDATE - withdrawn for 200.200.200.200/32 is received from R2:


*Mar  1 00:50:05.635: BGP(0): 1.1.1.2 rcv UPDATE about 200.200.200.200/32 -- withdrawn
*Mar  1 00:50:05.639: BGP(0): no valid path for 200.200.200.200/32
*Mar  1 00:50:05.643: BGP(0): nettable_walker 200.200.200.200/32 no best path
*Mar  1 00:50:39.467: BPG(0): Condition if-advertise changes to Withdraw
*Mar  1 00:50:39.467: BPG(0): Condition if-advertise changes to Withdraw
*Mar  1 00:50:39.471: BGP(0): net 100.100.100.100/32 matches ADV MAP advertise: bump version to 11
*Mar  1 00:50:40.159: BGP(0): nettable_walker 100.100.100.100/32 route sourced locally
*Mar  1 00:50:40.159: BGP(0): 1.1.1.2 100.100.100.100/32 matches advertise map advertise, state: Withdraw
*Mar  1 00:50:40.159: BGP(0): 1.1.1.2 send unreachable 100.100.100.100/32
*Mar  1 00:50:40.163: BGP(0): 1.1.1.2 send UPDATE 100.100.100.100/32 -- unreachable






No comments:

Post a Comment