AS_PATH Prepending

AS_Path Prepending is the practice of adding additional AS numbers at the beginning of a path update. This makes the path for this route longer, and thus decreases its preference.

AS_Path Prepending can be applied on either outbound or inbound paths. AS_Path Prepending may not be honored if it is over-ruled by a neighbor.

 

AS_PATH Prepending: Outbound and Inbound Path Configurations

Outbound Path Configuration

Inbound Path Configuration

router bgp 12345

bgp router-id 10.50.165.233

network 12.34.5.0/24

neighbor 10.50.165.228 remote-as 7675

neighbor 10.50.165.228 route-map long out

!

route-map long permit 10

set as-path prepend 12345 12345

router bgp 7675

bgp router-id 10.50.165.228

network 7.6.7.0/24

neighbor 10.50.165.233 remote-as 12345

neighbor 10.50.165.233 route-map prepend in

!

route-map prepend permit 10

set as-path prepend 12345 12345

 

This configuration leads to a route being installed to the neighbor 10.50.165.233 with the AS_Path Prepended as 12345 12345. This can be viewed by entering the show ip bgp command.

ARS BGP>show ip bgp
BGP table version is 98, local router ID is 10.50.165.228
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, l - labeled
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 12.34.5.0/24 10.50.165.233 0 0 12345 12345 12345 i
*> 7.6.7.0/24 0.0.0.0 100 32768 i
Total number of prefixes 2