Pages

Tuesday, January 18, 2011

BGP conditional advertisement

BGP conditional advertisement

BGP conditional advertisement is another feature of  Cisco IOS. It controls the way it advertises the BGP network by considering whether it has or has not a BGP network in its table.

There are 2 command about conditional advertisement.
- neighbor advertise-map <advertise route> exist-map <exist-route>
     =  BGP will advertise <advertise-route> if the router has an <existing route> in its BGP table
neighbor advertise-map <advertise route> non-exist-map <non-exist-route>
     =  BGP will advertise <advertise-route> if the router do not have an <non-existing route> in its BGP table

--------------------------

Here is the sample configuration of BGP conditional advertisement.


R1 <----->  R2 


R1
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 network 10.10.18.0 mask 255.255.255.0
 network 10.10.19.0 mask 255.255.255.0
 neighbor 192.168.1.2 remote-as 100
 neighbor 192.168.1.2 advertise-map Conditional-bgp exist-map test


access-list 1 permit 10.10.19.0 0.0.0.255
access-list 2 permit 10.10.18.0 0.0.0.255
!

route-map Conditional-bgp permit 10
 match ip address 1
!
route-map test permit 10
 match ip address 2

----------------------------------

When R1 has network 10.10.18.0/24 in its BGP table. It will advertise network 10.10.19.0/24 out to its neighbor.

R1#sh ip bgp
BGP table version is 8, local router ID is 10.10.19.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 10.10.18.0/24    0.0.0.0                  0         32768 i
*> 10.10.19.0/24    0.0.0.0                  0         32768 i   ( advertise out to R2)



Check R2 Routing table 
R2
R2#sh ip route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 6 subnets
O       10.10.10.0 [110/11] via 192.168.1.1, 01:39:45, FastEthernet0/0
O       10.10.12.0 [110/11] via 192.168.1.1, 01:39:45, FastEthernet0/0
O       10.10.14.0 [110/11] via 192.168.1.1, 01:39:45, FastEthernet0/0
O       10.10.16.0 [110/11] via 192.168.1.1, 01:39:45, FastEthernet0/0
O       10.10.18.0 [110/11] via 192.168.1.1, 00:00:26, FastEthernet0/0
B       10.10.19.0 [200/0] via 192.168.1.1, 00:00:08

------------------------------------

When network 10.10.18.0/24 is deleted from R1 BGP table, R1 stops advertising 10.10.19.0/24

debug ip bgp updates
*Mar  1 01:55:12.003: BPG(0): Condition test changes to Withdraw
*Mar  1 01:55:12.007: BPG(0): Condition test changes to Withdraw
*Mar  1 01:55:12.007: BGP(0): net 10.10.19.0/24 matches ADV MAP Conditional-bgp: bump version to 11
*Mar  1 01:55:12.219: BGP(0): nettable_walker 10.10.19.0/24 route sourced locally
*Mar  1 01:55:12.223: BGP(0): 192.168.1.2 10.10.19.0/24 matches advertise map Conditional-bgp, state: Withdraw
*Mar  1 01:55:12.223: BGP(0): 192.168.1.2 send unreachable 10.10.19.0/24
*Mar  1 01:55:12.223: BGP(0): 192.168.1.2 send UPDATE 10.10.19.0/24 -- unreachable

R2 routing table  ( no network 10.10.19.0/24 )
R2#sh ip route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 4 subnets
O       10.10.10.0 [110/11] via 192.168.1.1, 01:41:26, FastEthernet0/0
O       10.10.12.0 [110/11] via 192.168.1.1, 01:41:26, FastEthernet0/0
O       10.10.14.0 [110/11] via 192.168.1.1, 01:41:26, FastEthernet0/0
O       10.10.16.0 [110/11] via 192.168.1.1, 01:41:26, FastEthernet0/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
R2#



Refer from document in cisco website

http://www.cisco.com/en/US/tech/tk365/technologies_configuration_example09186a0080094309.shtml

No comments:

Post a Comment