• Remove the BGP configuration for the previous task from SW1.
• Use the local-preference in R6 so that traffic from AS 100 going to AS 254 transits through AS 300.
Notes
Local Preference attribute is carried along with the prefix through the single AS (i.e. relayed across iBGP sessions) but does not leave the AS boundaries. This AS wide propagation ensures that all routers within the single AS perform deterministic path selection.
route-map SET_LP
match ip address| match ip as-path ...
set local-preference 1000
Configuration
router bgp 100
no synchronization
network 155.1.146.0 mask 255.255.255.0
aggregate-address 155.1.0.0 255.255.0.0 summary-only
neighbor 54.1.1.254 remote-as 54
neighbor 155.1.67.7 remote-as 300
neighbor 155.1.67.7 route-map FROM_SW1 in
neighbor 155.1.146.1 remote-as 100
no auto-summary
!
ip as-path access-list 254 permit _254$
!
route-map FROM_SW1 permit 10
match as-path 254
set local-preference 1000
!
route-map FROM_SW1 permit 20
!
-----------------------
Rack1R6#show ip bgp
BGP table version is 25, 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
* i28.119.16.0/24 204.12.1.254 0 100 0 54 i
*> 54.1.1.254 0 54 i
* i28.119.17.0/24 204.12.1.254 0 100 0 54 i
*> 54.1.1.254 0 54 i
* i112.0.0.0 204.12.1.254 0 100 0 54 50 60 i
*> 54.1.1.254 0 0 54 50 60 i
* i113.0.0.0 204.12.1.254 0 100 0 54 50 60 i
*> 54.1.1.254 0 0 54 50 60 i
* i114.0.0.0 204.12.1.254 0 100 0 54 i
*> 54.1.1.254 0 0 54 i
* i115.0.0.0 204.12.1.254 0 100 0 54 i
*> 54.1.1.254 0 0 54 i
* i116.0.0.0 204.12.1.254 0 100 0 54 i
*> 54.1.1.254 0 0 54 i
* i117.0.0.0 204.12.1.254 0 100 0 54 i
*> 54.1.1.254 0 0 54 i
* i118.0.0.0 204.12.1.254 0 100 0 54 i
*> 54.1.1.254 0 0 54 i
* i119.0.0.0 204.12.1.254 0 100 0 54 i
*> 54.1.1.254 0 0 54 i
* i155.1.0.0 155.1.146.4 0 100 0 i
*> 0.0.0.0 32768 i
s> 155.1.146.0/24 0.0.0.0 0 32768 i
*>i192.10.1.0 155.1.13.3 0 100 0 200 i
* 155.1.67.7 0 300 200 i
* 205.90.31.0 155.1.67.7 0 300 200 254 ?
*>i 155.1.13.3 0 100 0 200 254 ?
* 220.20.3.0 155.1.67.7 0 300 200 254 ?
*>i 155.1.13.3 0 100 0 200 254 ?
* 222.22.2.0 155.1.67.7 0 300 200 254 ?
*>i 155.1.13.3 0 100 0 200 254 ?
Rack1R6#
例如原本R6原本路徑為:
(AS100)R6-----AS200(R3)-----AS254
因為某些因素所以我們想改變SW路徑為:
(AS100)R6-----AS300(SW1)-----AS200-----AS254
最後結果如下:
Rack1R6#show ip bgp
BGP table version is 28, 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
* i28.119.16.0/24 204.12.1.254 0 100 0 54 i
*> 54.1.1.254 0 54 i
* i28.119.17.0/24 204.12.1.254 0 100 0 54 i
*> 54.1.1.254 0 54 i
* i112.0.0.0 204.12.1.254 0 100 0 54 50 60 i
*> 54.1.1.254 0 0 54 50 60 i
* i113.0.0.0 204.12.1.254 0 100 0 54 50 60 i
*> 54.1.1.254 0 0 54 50 60 i
* i114.0.0.0 204.12.1.254 0 100 0 54 i
*> 54.1.1.254 0 0 54 i
* i115.0.0.0 204.12.1.254 0 100 0 54 i
*> 54.1.1.254 0 0 54 i
* i116.0.0.0 204.12.1.254 0 100 0 54 i
*> 54.1.1.254 0 0 54 i
* i117.0.0.0 204.12.1.254 0 100 0 54 i
*> 54.1.1.254 0 0 54 i
* i118.0.0.0 204.12.1.254 0 100 0 54 i
*> 54.1.1.254 0 0 54 i
* i119.0.0.0 204.12.1.254 0 100 0 54 i
*> 54.1.1.254 0 0 54 i
* i155.1.0.0 155.1.146.4 0 100 0 i
*> 0.0.0.0 32768 i
s> 155.1.146.0/24 0.0.0.0 0 32768 i
*>i192.10.1.0 155.1.13.3 0 100 0 200 i
* 155.1.67.7 0 300 200 i
*> 205.90.31.0 155.1.67.7 1000 0 300 200 254 ?
*> 220.20.3.0 155.1.67.7 1000 0 300 200 254 ?
*> 222.22.2.0 155.1.67.7 1000 0 300 200 254 ?
Rack1R6#
Rack1R6#traceroute 222.22.2.1
Type escape sequence to abort.
Tracing the route to 222.22.2.1
1 155.1.67.7 12 msec 20 msec 12 msec
2 155.1.37.3 16 msec 28 msec 16 msec
3 155.1.23.2 20 msec 16 msec 20 msec
4 192.10.1.254 [AS 200] 40 msec 16 msec 36 msec
Rack1R6#
同時間R1與R4往AS254的最佳路徑也跟著被改變
Rack1R1#show ip bgp regexp _254$
BGP table version is 40, 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
*>i205.90.31.0 155.1.67.7 0 1000 0 300 200 254 ?* 155.1.13.3 0 200 254 ?
*>i220.20.3.0 155.1.67.7 0 1000 0 300 200 254 ?* 155.1.13.3 0 200 254 ?
*>i222.22.2.0 155.1.67.7 0 1000 0 300 200 254 ?* 155.1.13.3 0 200 254 ?
Rack1R1#
Rack1R4#show ip bgp regexp _254$
BGP table version is 32, 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
*>i205.90.31.0 155.1.67.7 0 1000 0 300 200 254 ?
* 155.1.45.5 0 200 254 ?
*>i220.20.3.0 155.1.67.7 0 1000 0 300 200 254 ?
* 155.1.45.5 0 200 254 ?
*>i222.22.2.0 155.1.67.7 0 1000 0 300 200 254 ?
* 155.1.45.5 0 200 254 ?
Rack1R4#
沒有留言:
張貼留言