BGP conditional advertising

Annoncer des routes (des prefix) de façon conditionnelle

3 paramètres :

  • Advertise-map
    Désigne un nom de route-map qui doit être annoncé si la/les condition(s) sont remplies
  • Non-exist-map
    Désigne un nom de route-map
    Si « Non-exist-map » est vraie , alors « Advertise-map » ne sera pas annoncé
  • Exit-map
    Désigne un nom de route-map
    Si « Non-exist-map » est vraie , alors « Advertise-map » sera annoncé

En d’autres termes :

if ( not Non-exist-map )                           then            Annoncer( Advertise-map)
if ( exist-map )                                        then             Annoncer( Advertise-map)
if ( not Non-exist-map and exist-map)    then             Annoncer( Advertise-map)

Exemple

Le routeur R1 annonce à R3 les préfixes 1.0.0.0 (local) et 2.0.0.0 (provenant de R2) :

R1#show ip bgp neighbors 10.1.13.3 advertised-routes
   Network          Next Hop            Metric LocPrf Weight Path
*> 1.0.0.0          0.0.0.0                  0         32768 i
*> 2.0.0.0          10.1.12.2                0             0 200 i

 

Comportement recherché :

Si le prefix 2.0.0.0 existe , ne pas annoncer à R3 le prefix 1.0.0.0
ou
1.0.0.0 sera annoncé que si 2.0.0.0 n’existe pas

Création de 2 route-map désignant les prefix: (sur R1)

access-list 1 permit 1.0.0.0 0.255.255.255
access-list 2 permit 2.0.0.0 0.255.255.255
!
route-map ADV permit 10
 match ip address 1
!
route-map NotThere permit 10
 match ip address 2
!

Mise en place :

router bgp 100
 neighbor 10.1.13.3 advertise-map ADV non-exist-map NotThere

Vérifications:

R1#show ip bgp neighbors 10.1.13.3 advertised-routes

   Network          Next Hop            Metric LocPrf Weight Path
*> 2.0.0.0          10.1.12.2                0             0 200 i
R3#show ip bgp

   Network          Next Hop            Metric LocPrf Weight Path
*> 2.0.0.0          10.1.13.1                              0 100 200 i
*> 3.0.0.0          0.0.0.0                  0         32768 i

Si R2 n’annonce plus 2.0.0.0 :

R2(config)#int lo0
R2(config-if)#shutdown
R1#show ip bgp neighbors 10.1.13.3 advertised-routes

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.0.0.0          0.0.0.0                  0         32768 i
R3#show ip bgp

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.0.0.0          10.1.13.1                0             0 100 i
*> 3.0.0.0          0.0.0.0                  0         32768 i

La condition peut être inversé avec « Exist-map »

neighbor 10.1.13.3 advertise-map ADV exist-map EXIT

This entry was posted in BGP. Bookmark the permalink.

Comments are closed.