7.49 BGP Local AS
• AS 100 is planning transition to the AS number 146. Configure R4 and R6 to use the new AS number while R1 should still use the old AS 100.
• Ensure all BGP peering relationships are still maintained but do not modify the configurations of any routers other than R1, R4 and R6.
------------------------------------------------
AS100計畫轉移到AS146
R1仍然使用舊的AS100 , R4跟R6使用新的AS146
------------------------------------------------
Hide Local Autonomous System feature could be useful when migrating an autonomous system to a different AS number.
When the AS has multiple eBGP peering links, it may become time consuming to negotiate the AS number change with all peering partners.
In this case, you may reconfigure the local BGP speakers to use the new AS number but advertise the old AS in BGP OPEN messages and BGP updates.
This could be enforced on per-eBGP peer basis using the command neighbor <IP> local-as <OldAS> [no-prepend].
The local-as <OldAS> command instructs the local router to advertise the <OldAS> number in BGP OPEN messages instead of the AS number specified with router bgp <NewAS> command.
In addition to that, all BGP prefixes advertised to this eBGP peer would have the AS numbers <OldAS> <NewAS> preprended in front of every BGP update’s AS_PATH attribute.
Thus, the external system may continue with the local system using the old AS number.
In addition to that, the external system will see the updates coming from the <OldAS> looking like they first transited <NewAS>. This is needed to avoid BGP routing loops.
If you specify the no-prepend keyword, then any routes received from the eBGP peer will not have <OldAS> prepended upon reception.
no-prepend keyword只有在接收eBGP peer時才會有用...表示不再於prefix前附加舊的AS number
By default the AS number specified with the local-as command (<OldAS>) is prepended to all updates received, to avoid potential routing loops.
However, this may cause problems with partial transitions, when part of your AS is using the new AS number, and another part is still using the old AS number.
The routers using the old number will reject such updates due to the same AS number present in AS_PATH.
In our scenario, only R4 and R6 have been reconfigured to use the new AS number 146.
R1 is still using AS 100 and have been reconfigured to peer eBGP with R4 and R6.
In order to make R1 accept AS 54 prefixes, we use the no-prepend
keyword when peering using the local-as feature with BB1 and BB3.
------------------------------------------------
R1:
router bgp 100
no neighbor 155.1.146.4 route-reflector-client
no neighbor 155.1.146.6 route-reflector-client
neighbor 155.1.146.4 remote-as 146
neighbor 155.1.146.6 remote-as 146
neighbor 155.1.13.3 remote-as 200
R4:
no router bgp 100
router bgp 146
neighbor 155.1.146.1 remote-as 100
neighbor 204.12.1.254 remote-as 54
neighbor 204.12.1.254 local-as 100 no-prepend
neighbor 155.1.45.5 remote-as 200
neighbor 155.1.45.5 local-as 100 no-prepend
network 155.1.146.0 mask 255.255.255.0
aggregate-address 155.1.0.0 255.255.0.0 summary-only
R6:
no router bgp 100
router bgp 146
neighbor 155.1.146.1 remote-as 100
neighbor 54.1.1.254 remote-as 54
neighbor 54.1.1.254 local-as 100 no-prepend
neighbor 155.1.67.7 remote-as 300
neighbor 155.1.67.7 local-as 100 no-prepend
network 155.1.146.0 mask 255.255.255.0
aggregate-address 155.1.0.0 255.255.0.0 summary-only
------------------------------------------------
R4與R6學到BB3&BB1的eBGP prefix將不會prepend AS100....
Rack1R4#show ip bgp
BGP table version is 42, local router ID is 150.1.4.4
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
*> 0.0.0.0 155.1.45.5 0 200 i
* 155.1.146.1 0 100 200 i
*> 28.119.16.0/24 204.12.1.254 0 0 54 i
*> 28.119.17.0/24 204.12.1.254 0 0 54 i
*> 112.0.0.0 204.12.1.254 0 54 50 60 i
*> 113.0.0.0 204.12.1.254 0 54 50 60 i
*> 114.0.0.0 204.12.1.254 0 54 i
*> 115.0.0.0 204.12.1.254 0 54 i
*> 116.0.0.0 204.12.1.254 0 54 i
*> 117.0.0.0 204.12.1.254 0 54 i
*> 118.0.0.0 204.12.1.254 0 54 i
*> 119.0.0.0 204.12.1.254 0 54 i
*> 155.1.0.0 0.0.0.0 32768 i
s> 155.1.146.0/24 0.0.0.0 0 32768 i
Rack1R6#show ip bgp
BGP table version is 58, local router ID is 150.1.6.6
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
*> 0.0.0.0 155.1.146.1 0 100 200 i
* 155.1.67.7 0 300 200 i
*> 28.119.16.0/24 54.1.1.254 0 54 i
*> 28.119.17.0/24 54.1.1.254 0 54 i
*> 112.0.0.0 54.1.1.254 0 0 54 50 60 i
*> 113.0.0.0 54.1.1.254 0 0 54 50 60 i
*> 114.0.0.0 54.1.1.254 0 0 54 i
*> 115.0.0.0 54.1.1.254 0 0 54 i
*> 116.0.0.0 54.1.1.254 0 0 54 i
*> 117.0.0.0 54.1.1.254 0 0 54 i
*> 118.0.0.0 54.1.1.254 0 0 54 i
*> 119.0.0.0 54.1.1.254 0 0 54 i
*> 155.1.0.0 0.0.0.0 32768 i
s> 155.1.146.0/24 0.0.0.0 0 32768 i
Rack1R1#show ip bg
Rack1R1#show ip bgp
BGP table version is 93, local router ID is 150.1.1.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
* 0.0.0.0 155.1.146.4 0 146 200 i
*> 155.1.13.3 0 200 i
* 28.119.16.0/24 155.1.146.6 0 146 54 i
*> 155.1.146.4 0 146 54 i
* 28.119.17.0/24 155.1.146.6 0 146 54 i
*> 155.1.146.4 0 146 54 i
* 112.0.0.0 155.1.146.6 0 146 54 50 60 i
*> 155.1.146.4 0 146 54 50 60 i
* 113.0.0.0 155.1.146.6 0 146 54 50 60 i
*> 155.1.146.4 0 146 54 50 60 i
* 114.0.0.0 155.1.146.6 0 146 54 i
*> 155.1.146.4 0 146 54 i
* 115.0.0.0 155.1.146.6 0 146 54 i
*> 155.1.146.4 0 146 54 i
* 116.0.0.0 155.1.146.6 0 146 54 i
*> 155.1.146.4 0 146 54 i
* 117.0.0.0 155.1.146.6 0 146 54 i Network Next Hop Metric LocPrf Weight Path
*> 155.1.146.4 0 146 54 i
* 118.0.0.0 155.1.146.6 0 146 54 i
*> 155.1.146.4 0 146 54 i
* 119.0.0.0 155.1.146.6 0 146 54 i
*> 155.1.146.4 0 146 54 i* 155.1.0.0 155.1.146.6 0 0 146 i
*> 155.1.146.4 0 0 146 i
我們對於SW1不是已經下了no-prepend keyword........
但只有在接收eBGP peer時才會有用...表示不再於prefix前附加舊的AS number
Keep in mind that no-prepend feature applies only to inbound learned routes. All externally advertise routes still have the local-as number prepended.
Rack1SW1#show ip bgp
BGP table version is 143, local router ID is 150.1.7.7
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
* 0.0.0.0 155.1.67.6 0 100 146 100 200 i
*> 155.1.37.3 0 200 i
*> 28.119.16.0/24 155.1.67.6 0 100 146 54 i
* 155.1.37.3 0 200 100 146 54 i
*> 28.119.17.0/24 155.1.67.6 0 100 146 54 i
* 155.1.37.3 0 200 100 146 54 i
*> 112.0.0.0 155.1.67.6 0 100 146 54 50 60 i
* 155.1.37.3 0 200 100 146 54 50 60 i
*> 113.0.0.0 155.1.67.6 0 100 146 54 50 60 i
* 155.1.37.3 0 200 100 146 54 50 60 i
*> 114.0.0.0 155.1.67.6 0 100 146 54 i
* 155.1.37.3 0 200 100 146 54 i
*> 115.0.0.0 155.1.67.6 0 100 146 54 i
* 155.1.37.3 0 200 100 146 54 i
*> 116.0.0.0 155.1.67.6 0 100 146 54 i
* 155.1.37.3 0 200 100 146 54 i
*> 117.0.0.0 155.1.67.6 0 100 146 54 i
* 155.1.37.3 0 200 100 146 54 i
*> 118.0.0.0 155.1.67.6 0 100 146 54 i
* 155.1.37.3 0 200 100 146 54 i
*> 119.0.0.0 155.1.67.6 0 100 146 54 i
* 155.1.37.3 0 200 100 146 54 i
*> 155.1.0.0 155.1.67.6 0 0 100 146 i
* 155.1.37.3 0 200 100 146 i
我們對於R5不是已經下了no-prepend keyword........
但只有在接收eBGP peer時才會有用...表示不再於prefix前附加舊的AS number
Keep in mind that no-prepend feature applies only to inbound learned routes. All externally advertise routes still have the local-as number prepended.
Rack1R5#show ip bgp
BGP table version is 112, local router ID is 150.1.5.5
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
*>i0.0.0.0 155.1.0.2 0 100 0 i
* i 155.1.23.2 0 100 0 i
*> 28.119.16.0/24 155.1.45.4 0 100 146 54 i
* i 155.1.13.1 0 100 0 100 146 54 i
*> 28.119.17.0/24 155.1.45.4 0 100 146 54 i
* i 155.1.13.1 0 100 0 100 146 54 i
*> 112.0.0.0 155.1.45.4 0 100 146 54 50 60 i
* i 155.1.13.1 0 100 0 100 146 54 50 60 i
*> 113.0.0.0 155.1.45.4 0 100 146 54 50 60 i
* i 155.1.13.1 0 100 0 100 146 54 50 60 i
*> 114.0.0.0 155.1.45.4 0 100 146 54 i
* i 155.1.13.1 0 100 0 100 146 54 i
*> 115.0.0.0 155.1.45.4 0 100 146 54 i
* i 155.1.13.1 0 100 0 100 146 54 i
*> 116.0.0.0 155.1.45.4 0 100 146 54 i
* i 155.1.13.1 0 100 0 100 146 54 i
*> 117.0.0.0 155.1.45.4 0 100 146 54 i
Network Next Hop Metric LocPrf Weight Path
* i 155.1.13.1 0 100 0 100 146 54 i
*> 118.0.0.0 155.1.45.4 0 100 146 54 i
* i 155.1.13.1 0 100 0 100 146 54 i
*> 119.0.0.0 155.1.45.4 0 100 146 54 i
* i 155.1.13.1 0 100 0 100 146 54 i
*> 155.1.0.0 155.1.45.4 0 0 100 146 i
* i 155.1.13.1 0 100 0 100 146 i
--------------------
我們來試試看關閉no-prepend的功能,那就是要prepend附加AS100囉
R6:
router bgp 146
neighbor 54.1.1.254 local-as 100
Rack1R6#show ip bgp
BGP table version is 78, local router ID is 150.1.6.6
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
*> 0.0.0.0 155.1.146.1 0 100 200 i
* 155.1.67.7 0 300 200 i
*> 28.119.16.0/24 54.1.1.254 0 100 54 i
*> 28.119.17.0/24 54.1.1.254 0 100 54 i
*> 112.0.0.0 54.1.1.254 0 0 100 54 50 60 i
*> 113.0.0.0 54.1.1.254 0 0 100 54 50 60 i
*> 114.0.0.0 54.1.1.254 0 0 100 54 i
*> 115.0.0.0 54.1.1.254 0 0 100 54 i
*> 116.0.0.0 54.1.1.254 0 0 100 54 i
*> 117.0.0.0 54.1.1.254 0 0 100 54 i
*> 118.0.0.0 54.1.1.254 0 0 100 54 i
*> 119.0.0.0 54.1.1.254 0 0 100 54 i
*> 155.1.0.0 0.0.0.0 32768 i
s> 155.1.146.0/24 0.0.0.0 0 32768 i
於是從BB1所學到的prefix就會先用local-as 100先prepend....這樣就會造成R1學不到prefix...因為looping prevent AS100.
Rack1R1#show ip bgp
BGP table version is 93, local router ID is 150.1.1.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
* 0.0.0.0 155.1.146.4 0 146 200 i
*> 155.1.13.3 0 200 i
*> 28.119.16.0/24 155.1.146.4 0 146 54 i
*> 28.119.17.0/24 155.1.146.4 0 146 54 i
*> 112.0.0.0 155.1.146.4 0 146 54 50 60 i
*> 113.0.0.0 155.1.146.4 0 146 54 50 60 i
*> 114.0.0.0 155.1.146.4 0 146 54 i
*> 115.0.0.0 155.1.146.4 0 146 54 i
*> 116.0.0.0 155.1.146.4 0 146 54 i
*> 117.0.0.0 155.1.146.4 0 146 54 i
*> 118.0.0.0 155.1.146.4 0 146 54 i
*> 119.0.0.0 155.1.146.4 0 146 54 i
* 155.1.0.0 155.1.146.6 0 0 146 i
*> 155.1.146.4 0 0 146 i
沒有留言:
張貼留言