7.50 BGP Local AS Replace-AS/Dual-AS
• Re-configure R1 to reside in AS 146 as well and act as a routing reflector for R4 and R6.
• All external Autonomous Systems should be unaware of the new AS
numbers used by these routers.
• R5 should peer with R4 using the AS number 146.
--------------------------------------------------------
將R1重新設定AS146, 並將R4與R6設定為routing reflector
所有的外部AS應該要不知道(unaware)新的AS number
--------------------------------------------------------
As you remember, when configuring the hide local AS feature, the external peers would see both the local-AS and the real AS number prepended in front of the AS_PATH.
Sometimes, it is desirable to completely hide the “real” AS number
(the one configured via router bgp <RealAS> command). To accomplish this, use the no-prepend replace-as parameters to the local-as command.
This combination will replace the real AS number with the one specified in the local-as command. The respective neighbor will be completely tricked into thinking that all routers are received from the AS number configured with the local-as command, as this number will appear in the AS_PATH and BGP OPEN message. Keep in mind that such replacement could lead to routing loops, if the original AS was partitioned using two AS numbers.
With the replace-AS feature is configured, it may happen that the external peer is configured to peer using the real AS number, for example the AS number that would be used after migration. In this case, it is possible to configure the “hiding” peer to initiate/accept BGP sessions using both AS numbers (the real number
and the local number).
The external peer will accept the correct number and negotiate the BGP session. The “hiding” peer will then use the negotiated AS number to prepend the updates sent to the external peer.
--------------------------------------------------------
R1:
no router bgp 100
router bgp 146
neighbor 155.1.146.4 remote-as 146
neighbor 155.1.146.6 remote-as 146
neighbor 155.1.146.4 route-reflector-client
neighbor 155.1.146.6 route-reflector-client
neighbor 155.1.13.3 remote-as 200
neighbor 155.1.13.3 local-as 100 no-prepend replace-as
R4:
router bgp 146
neighbor 155.1.146.1 remote-as 146
neighbor 155.1.45.5 local-as 100 no-prepend replace-as dual-as
neighbor 204.12.1.254 local-as 100 no-prepend replace-as
R5:
router bgp 200
neighbor 155.1.45.4 remote-as 146
R6:
router bgp 146
neighbor 155.1.146.1 remote-as 146
neighbor 155.1.67.7 local-as 100 no-prepend replace-as
neighbor 54.1.1.254 local-as 100 no-prepend replace-as
--------------------------------------------------------
R3從R1學到的prefix均為AS100
Rack1R3#show ip bgp neighbors 155.1.13.1 routes
BGP table version is 220, local router ID is 150.1.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
*> 28.119.16.0/24 155.1.13.1 0 100 54 i
*> 28.119.17.0/24 155.1.13.1 0 100 54 i
*> 112.0.0.0 155.1.13.1 0 100 54 50 60 i
*> 113.0.0.0 155.1.13.1 0 100 54 50 60 i
*> 114.0.0.0 155.1.13.1 0 100 54 i
*> 115.0.0.0 155.1.13.1 0 100 54 i
*> 116.0.0.0 155.1.13.1 0 100 54 i
*> 117.0.0.0 155.1.13.1 0 100 54 i
*> 118.0.0.0 155.1.13.1 0 100 54 i
*> 119.0.0.0 155.1.13.1 0 100 54 i
*> 155.1.0.0 155.1.13.1 0 100 i
Total number of prefixes 11
Rack1R3#
SW1從R6學到的prefix均為AS100
Rack1SW1#show ip bgp neighbors 155.1.67.6 routes
BGP table version is 195, 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 200 i
*> 28.119.16.0/24 155.1.67.6 0 100 54 i
*> 28.119.17.0/24 155.1.67.6 0 100 54 i
*> 112.0.0.0 155.1.67.6 0 100 54 50 60 i
*> 113.0.0.0 155.1.67.6 0 100 54 50 60 i
*> 114.0.0.0 155.1.67.6 0 100 54 i
*> 115.0.0.0 155.1.67.6 0 100 54 i
*> 116.0.0.0 155.1.67.6 0 100 54 i
*> 117.0.0.0 155.1.67.6 0 100 54 i
*> 118.0.0.0 155.1.67.6 0 100 54 i
*> 119.0.0.0 155.1.67.6 0 100 54 i
*> 155.1.0.0 155.1.67.6 0 0 100 i
* 205.90.31.0 155.1.67.6 0 100 200 254 ?
* 220.20.3.0 155.1.67.6 0 100 200 254 ?
* 222.22.2.0 155.1.67.6 0 100 200 254 ?
Total number of prefixes 15
Rack1SW1#
R5從R4學到的prefix均為AS146
Rack1R5#show ip bgp neighbors 155.1.45.4 routes
BGP table version is 208, 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
*> 28.119.16.0/24 155.1.45.4 0 146 54 i
*> 28.119.17.0/24 155.1.45.4 0 146 54 i
*> 112.0.0.0 155.1.45.4 0 146 54 50 60 i
*> 113.0.0.0 155.1.45.4 0 146 54 50 60 i
*> 114.0.0.0 155.1.45.4 0 146 54 i
*> 115.0.0.0 155.1.45.4 0 146 54 i
*> 116.0.0.0 155.1.45.4 0 146 54 i
*> 117.0.0.0 155.1.45.4 0 146 54 i
*> 118.0.0.0 155.1.45.4 0 146 54 i
*> 119.0.0.0 155.1.45.4 0 146 54 i
*> 155.1.0.0 155.1.45.4 0 0 146 i
Total number of prefixes 11
Rack1R5#
修改R5的R4 neighbor AS146->AS100, R5從R4學到的prefix就會為AS100
(因為R4設定R5 neighbor為dual-as AS100及AS146均可接受)
Rack1R5#config t
Enter configuration commands, one per line. End with CNTL/Z.
Rack1R5(config)#router bgp 200
Rack1R5(config-router)#neighbor 155.1.45.4 remote-as 100
Rack1R5(config-router)#^Z
Rack1R5#
*Mar 3 02:40:36.255: %BGP-5-ADJCHANGE: neighbor 155.1.45.4 Down Remote AS changed
*Mar 3 02:40:37.023: %SYS-5-CONFIG_I: Configured from console by console
Rack1R5#show ip bgp neighbors 155.1.45.4 routes
BGP table version is 230, 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
*> 28.119.16.0/24 155.1.45.4 0 100 54 i
*> 28.119.17.0/24 155.1.45.4 0 100 54 i
*> 112.0.0.0 155.1.45.4 0 100 54 50 60 i
*> 113.0.0.0 155.1.45.4 0 100 54 50 60 i
*> 114.0.0.0 155.1.45.4 0 100 54 i
*> 115.0.0.0 155.1.45.4 0 100 54 i
*> 116.0.0.0 155.1.45.4 0 100 54 i
*> 117.0.0.0 155.1.45.4 0 100 54 i
*> 118.0.0.0 155.1.45.4 0 100 54 i
*> 119.0.0.0 155.1.45.4 0 100 54 i
*> 155.1.0.0 155.1.45.4 0 0 100 i
Total number of prefixes 11
Rack1R5#
沒有留言:
張貼留言