2013/11/15

WB1 7.20 BGP Bestpath Selection - AS-Path Prepending

7.20 BGP Bestpath Selection - AS-Path Prepending
• Remove the BGP configuration for the previous task from R6.
• Using AS-Path Prepending, configure AS 200 so that traffic from AS 100 going to AS 254 enters via the link to AS 300.

 
Note
 
route-map PREPEND
match ...
set as-path prepend 100 100 100
!
router bgp 100
neighbor 54.1.1.254 route-map PREPEND out

 
The above example applies local AS number 3 times, instead of just one, to the prefixes matching the route-map criterion. Notice that even though you apply attribute manipulation in outbound direction, it affects the way that the external systems send traffic to your AS.

Manipulating the AS_PATH length is the common way to influence the incoming traffic paths to the local AS and is widely used on the Internet. Usually, the prefixes advertised on least preferred inbound link have the local AS path number prepended 3 or more times. This ensures that any further manipulations will not make those prefixes preferred over the subnets advertise across the “primary” entry point. Keep in mind that the remote AS may change your policy by applying the local preference attribute manipulations.

However, that process will only affect path selection within the single AS, not globally on the Internet.
 
Configuration

R1:
!
router bgp 200
 no synchronization
 neighbor 155.1.0.5 remote-as 200
 neighbor 155.1.13.1 remote-as 100
 neighbor 155.1.13.1 route-map TO_R1 out
 neighbor 155.1.23.2 remote-as 200
 neighbor 155.1.23.2 route-reflector-client
 neighbor 155.1.37.7 remote-as 300
 neighbor 155.1.58.8 remote-as 200
 neighbor 155.1.58.8 route-reflector-client
 neighbor 155.1.108.10 remote-as 200
 neighbor 155.1.108.10 route-reflector-client
 no auto-summary
!
ip as-path access-list 254 permit _254$
!
!
route-map TO_R1 permit 10
 match as-path 254
 set as-path prepend 200 200 200
!


R5:
!
router bgp 200
 no synchronization
 neighbor 155.1.0.2 remote-as 200
 neighbor 155.1.0.2 route-reflector-client
 neighbor 155.1.23.3 remote-as 200
 neighbor 155.1.45.4 remote-as 100
 neighbor 155.1.45.4 route-map TO_R4 out
 neighbor 155.1.58.8 remote-as 200
 neighbor 155.1.58.8 route-reflector-client
 neighbor 155.1.108.10 remote-as 200
 neighbor 155.1.108.10 route-reflector-client
 no auto-summary
!
ip as-path access-list 254 permit _254$
!
!
route-map TO_R4 permit 10
 match as-path 254
 set as-path prepend 200 200 200
!


----------------------------------------------------------

AS100裡,每一台Router 修改前、修改後
 
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#show ip bgp regexp _254$
BGP table version is 52, 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    100      0 300 200 254 ?
*                   155.1.13.3                             0 200 200 200 200 254 ?
*>i220.20.3.0       155.1.67.7               0    100      0 300 200 254 ?
*                   155.1.13.3                             0 200 200 200 200 254 ?*>i222.22.2.0       155.1.67.7               0    100      0 300 200 254 ?
*                   155.1.13.3                             0 200 200 200 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#show ip bgp regexp _254$
BGP table version is 50, 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    100      0 300 200 254 ?
*                   155.1.45.5                             0 200 200 200 200 254 ?*>i220.20.3.0       155.1.67.7               0    100      0 300 200 254 ?
*                   155.1.45.5                             0 200 200 200 200 254 ?*>i222.22.2.0       155.1.67.7               0    100      0 300 200 254 ?
*                   155.1.45.5                             0 200 200 200 200 254 ?Rack1R4#



Rack1R6#show ip bgp regexp _254$
BGP table version is 34, 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
*>i205.90.31.0      155.1.13.3               0    100      0 200 254 ?
*                   155.1.67.7                             0 300 200 254 ?
*>i220.20.3.0       155.1.13.3               0    100      0 200 254 ?
*                   155.1.67.7                             0 300 200 254 ?
*>i222.22.2.0       155.1.13.3               0    100      0 200 254 ?
*                   155.1.67.7                             0 300 200 254 ?
Rack1R6#show ip bgp regexp _254$
BGP table version is 41, 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
*> 205.90.31.0      155.1.67.7                             0 300 200 254 ?
*> 220.20.3.0       155.1.67.7                             0 300 200 254 ?
*> 222.22.2.0       155.1.67.7                             0 300 200 254 ?

Rack1R6#

沒有留言:

張貼留言