Cisco - BGP Local-as
Alasta 17 Juillet 2018 cisco cisco bgp cli
Description : Utilisation de la feature BGP local-as
Description :
Il est parfois intéressant de changer son AS vis-à-vis d’un voisin eBGP.
Architecture du lab :
R1 va se présenter à R3 en AS 11 au lieu de l’AS 1.
Configurations :
R1
router bgp 1
no synchronization
bgp router-id 1.1.1.1
bgp log-neighbor-changes
network 192.168.0.0
neighbor 10.1.2.2 remote-as 2
neighbor 10.1.3.3 remote-as 3
neighbor 10.1.3.3 local-as 11
no auto-summary
R2
router bgp 2
no synchronization
bgp router-id 2.2.2.2
bgp log-neighbor-changes
neighbor 10.1.2.1 remote-as 1
no auto-summary
R3
router bgp 3
no synchronization
bgp router-id 3.3.3.3
bgp log-neighbor-changes
neighbor 10.1.3.1 remote-as 11
no auto-summary
Table de routage
R2
R2#sh ip bgp
BGP table version is 2, 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
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 192.168.0.0 10.1.2.1 0 0 1 i
R3
R3#sh ip bgp
BGP table version is 2, local router ID is 3.3.3.3
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
*> 192.168.0.0 10.1.3.1 0 0 11 1 i
On voit que R1 annonce aussi par défaut l’AS d’origine.
Si l’on complétement dissimuler l’AS d’origine, il faut ajouter no-prepend replace-as à la commande local-as
Modifications de configuration :
R1
router bgp 1
no synchronization
bgp router-id 1.1.1.1
bgp log-neighbor-changes
network 192.168.0.0
neighbor 10.1.2.2 remote-as 2
neighbor 10.1.3.3 remote-as 3
neighbor 10.1.3.3 local-as 11 no-prepend replace-as
no auto-summary
A noter que le peering R1-R3 va être renégocier.
Table de routage R3
R3#sh ip bgp
BGP table version is 14, local router ID is 3.3.3.3
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
*> 192.168.0.0 10.1.3.1 0 0 11 i
Bonus :
On peut aussi ajouter dual-as à la commande local-as 11 no-prepend replace-as dual-as, cela permet à R3 de monter un peering sur l’AS d’origine (AS 1) ou celle définie par local-as (AS 11).
Mais qu’une à la fois.
Configuration de R1 :
router bgp 1
no synchronization
bgp router-id 1.1.1.1
bgp log-neighbor-changes
network 192.168.0.0
neighbor 10.1.2.2 remote-as 2
neighbor 10.1.3.3 remote-as 3
neighbor 10.1.3.3 local-as 11 no-prepend replace-as dual-as
no auto-summary
Table de routage R3 avec une config de peering sur AS 11 (neighbor 10.1.3.1 remote-as 11) :
R3#sh ip bgp
BGP table version is 20, local router ID is 3.3.3.3
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
*> 192.168.0.0 10.1.3.1 0 0 11 i
Table de routage R3 avec une config de peering sur AS 1 (neighbor 10.1.3.1 remote-as 1) :
R3#sh ip bgp
BGP table version is 22, local router ID is 3.3.3.3
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
*> 192.168.0.0 10.1.3.1 0 0 1 i