Advance BGP configuration

Dans cette configuration, 3 AS sont des AS privés

  • remove-private
  • timers
  • advertisement-interval
  • disable-connected-check
  • ttl-security
  • local-as
  • no-prepend replace-as
  • no-prepend replace-as dual-as
  • maxas-limit
  • default-originate

Configuration de R2:

router bgp 65502
 no synchronization
 no bgp fast-external-fallover
 bgp log-neighbor-changes
 network 2.0.0.0
 neighbor 10.1.12.1 remote-as 65501
 neighbor 10.1.12.1 timers 60 300
 neighbor 10.1.23.3 remote-as 65503
 neighbor 10.1.23.3 timers 60 300
 no auto-summary

Topologie BGP de R5

R5#show ip bgp
   Network          Next Hop            Metric LocPrf Weight Path
*> 1.0.0.0          10.1.45.4                              0 400 65503 65502 65501 i
*> 2.0.0.0          10.1.45.4                              0 400 65503 65502 i
*> 3.0.0.0          10.1.45.4                              0 400 65503 i
*> 4.0.0.0          10.1.45.4                0             0 400 i
*> 5.0.0.0          0.0.0.0                  0         32768 i

remove-private

« remove-private » permet de « masquer » les AS privés en modifiant l’attribut « AS Path » et de ne pas les annoncer

R4
router bgp 400
 no synchronization
 bgp log-neighbor-changes
 network 4.0.0.0
 neighbor 10.1.34.3 remote-as 65503
 neighbor 10.1.45.5 remote-as 500
 neighbor 10.1.45.5 remove-private-as
 no auto-summary

Vérifications: R5 ne voit plus que l’AS 400

R5#show ip bgp
   Network          Next Hop            Metric LocPrf Weight Path
*> 1.0.0.0          10.1.45.4                              0 400 i
*> 2.0.0.0          10.1.45.4                              0 400 i
*> 3.0.0.0          10.1.45.4                              0 400 i
*> 4.0.0.0          10.1.45.4                0             0 400 i
*> 5.0.0.0          0.0.0.0                  0         32768 i
R5#ping 1.1.1.1 source 5.5.5.5

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 5.5.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 116/116/116 ms

timers & advertisement-interval

« timers » permet d’ajuster la valeur du keepalive et du holdtime

    • keepalive par default : 60 seconds
    • holdtime par defaut : 180 seconds

« advertisement-interval » permet ajuster la fréquence des annonces
valeur par défaut :

    • External peers : 30 seconds
    • Internal peers : 5 seconds
router bgp 65501
 no synchronization
 bgp log-neighbor-changes
 network 1.0.0.0
 neighbor 10.1.12.2 remote-as 65502
 neighbor 10.1.12.2 timers 60 300
 neighbor 10.1.12.2 advertisement-interval 60
 no auto-summary

 

disable-connected-check

Par défaut, une session eBGP doit être du type « single-hop » (ttl à 1 )
La session eBGP ne peut donc pas s’établir lors de l’utilisation de loopback entre 2 AS

disable-connected-check peut être utilisé pour modifier ce comportement

R4
router bgp 400
 no synchronization
 bgp log-neighbor-changes
 network 4.0.0.0
 neighbor 10.1.34.3 remote-as 65503
 neighbor 55.5.5.5 remote-as 500
 neighbor 55.5.5.5 disable-connected-check
 neighbor 55.5.5.5 update-source Loopback1
 no auto-summary
R5
router bgp 500
 no synchronization
 bgp log-neighbor-changes
 network 5.0.0.0
 neighbor 44.4.4.4 remote-as 400
 neighbor 44.4.4.4 disable-connected-check
 neighbor 44.4.4.4 update-source Loopback1
 no auto-summary

 

ttl-security

lors de l’utilisation de « disable-connected-check » une sécurité peut être mise en place en spécifiant le nombre de saut max

R1#conf t
R1(config)#router bgp 65501
R1(config-router)#neighbor 10.1.12.2 ttl-security hops 2
R2#conf t
R2(config)#router bgp 65502
R2(config-router)#neighbor 10.1.12.1 ttl-security hops 2

 

local-as

« local-as » permet de modifié le numéro d’AS selon le voisin

R4
router bgp 400
 no synchronization
 bgp log-neighbor-changes
 network 4.0.0.0
 neighbor 10.1.34.3 remote-as 65503
 neighbor 10.1.45.5 remote-as 555
 no auto-summary
R5
router bgp 500
 no synchronization
 bgp log-neighbor-changes
 network 5.0.0.0
 neighbor 10.1.45.4 remote-as 400
 neighbor 10.1.45.4 local-as 555
 no auto-summary

Vérifications :

R4#show ip bgp | be Net
   Network          Next Hop            Metric LocPrf Weight Path
*> 1.0.0.0          10.1.34.3                              0 65503 65502 65501 i
*> 2.0.0.0          10.1.34.3                              0 65503 65502 i
*> 3.0.0.0          10.1.34.3                0             0 65503 i
*> 4.0.0.0          0.0.0.0                  0         32768 i
*> 5.0.0.0          10.1.45.5                0             0 555 500 i
R5#show ip bgp  | be Net
   Network          Next Hop            Metric LocPrf Weight Path
*> 1.0.0.0          10.1.45.4                              0 555 400 65503 65502 65501 i
*> 2.0.0.0          10.1.45.4                              0 555 400 65503 65502 i
*> 3.0.0.0          10.1.45.4                              0 555 400 65503 i
*> 4.0.0.0          10.1.45.4                0             0 555 400 i
*> 5.0.0.0          0.0.0.0                  0         32768 i

 

no-prepend replace-as

lors de l’utilisation de « local-as », l’id réel de AS peut être complétement dissimulé :

R3
router bgp 65503
 no synchronization
 bgp log-neighbor-changes
 network 3.0.0.0
 neighbor 10.1.23.2 remote-as 65502
 neighbor 10.1.23.2 timers 60 300
 neighbor 10.1.34.4 remote-as 400
 neighbor 10.1.34.4 local-as 300 no-prepend replace-as
 no auto-summary
R4
router bgp 400
 no synchronization
 bgp log-neighbor-changes
 network 4.0.0.0
 neighbor 10.1.34.3 remote-as 300
 neighbor 10.1.45.5 remote-as 555
 no auto-summary

Vérifications

R4#show ip bgp | be Net
   Network          Next Hop            Metric LocPrf Weight Path
*> 1.0.0.0          10.1.34.3                              0 300 65502 65501 i
*> 2.0.0.0          10.1.34.3                              0 300 65502 i
*> 3.0.0.0          10.1.34.3                0             0 300 i
*> 4.0.0.0          0.0.0.0                  0         32768 i
*> 5.0.0.0          10.1.45.5                0             0 555 500 i

 

no-prepend replace-as dual-as

L’ajout de l’option « dual-as » permet aux voisins d’établir une relation de voisinage sur les 2 id d’AS ( le réel et l’alias)

maxas-limit

Par défaut, le nombre AS possible dans l’attribut « AS Path » est de 75
Cette valeur peut-être modifié avec « maxas-limit »

R3#conf t
R3(config)#router bgp 65503
R3(config-router)#bgp maxas-limit 2

Vérification dans les logs

R3#
*Mar 10 11:34:54.772: %BGP-6-ASPATH: Long AS path 65502 65503 400 received from 10.1.23.2: More than
 configured MAXAS-LIMIT

 

default-originate

« default-originate » Permet d’infecter une route par défaut au voisin SI la condition « route-map » est vrai ( présence du prefix 2.0.0.0 dans l’exemple)

R3(config)#access-list 2 permit 2.0.0.0

R3(config)#route-map TEST permit 10
R3(config-route-map)#match ip address 2
R3(config-route-map)#exit

R3(config)#router bgp 65503
R3(config-router)#neighbor 10.1.34.4 default-originate route-map TEST
R4#show ip bgp | be Net
   Network          Next Hop            Metric LocPrf Weight Path
*> 0.0.0.0          10.1.34.3                0             0 300 i
*> 1.0.0.0          10.1.34.3                              0 300 65502 65501 i
*> 2.0.0.0          10.1.34.3                              0 300 65502 i
*> 3.0.0.0          10.1.34.3                0             0 300 i
*> 4.0.0.0          0.0.0.0                  0         32768 i
*> 5.0.0.0          10.1.45.5                0             0 555 500 i
This entry was posted in BGP. Bookmark the permalink.

Comments are closed.