BGP Path Attributes - AS Path

ccnp-routing
Influence which path BGP prefers by prepending entries to the AS path with a route map, shown with Cisco configuration and verification.
Published

Jan 21, 2018

In our scenario, R6 reaches 12.12.12.0/24 through R3. Let us change it to R5 by playing with the AS path.

I put the snapshot here again:

bgp2
R6#show ip bgp 12.12.12.0/24 longer-prefixes 
BGP table version is 7, local router ID is 6.6.6.6

     Network          Next Hop            Metric LocPrf Weight Path
 *   12.12.12.0/24    5.5.5.5                                0 64510 64500 i
 *>                   3.3.3.3                                0 64500 i
R6(config)#ip prefix-list ASPATH seq 10 permit 12.12.12.0/24
R6(config)#route-map RmASPATH permit 10
R6(config-route-map)#match ip address prefix-list ASPATH
R6(config-route-map)#set as-path prepend 64500 64500 64500
R6(config-route-map)#exit
R6(config)#route-map RmASPATH permit 20               
R6(config-route-map)#exit
R6(config)#router bgp 64520
R6(config-router)#neighbor 3.3.3.3 route-map RmASPATH in
R6(config-router)#end
R6#clear ip bgp 3.3.3.3 soft
To verify:
R6#show ip bgp 12.12.12.0/24 longer-prefixes 
BGP table version is 8, local router ID is 6.6.6.6

     Network          Next Hop            Metric LocPrf Weight Path
 *>  12.12.12.0/24    5.5.5.5                                0 64510 64500 i
 *                    3.3.3.3                                0 64500 64500 64500 64500 i
Back to top