December 19, 2013

Lab 13: BGP AS-Path Prepending

Configure BGP on all routers. After the configuration R1's BGP routing table will be like this:

R1#show ip bgp
BGP table version is 4, local router ID is 13.0.0.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
*  12.0.0.0/30      10.0.0.2                               0 200 400 500 ?
*>                  13.0.0.2                               0 300 500 ?
*  14.0.0.0/30      10.0.0.2                               0 200 400 500 ?
*>                  13.0.0.2                               0 300 500 ?
*  192.168.0.1/32   10.0.0.2                               0 200 400 500 ?
*>                  13.0.0.2                               0 300 500 ?

As you see, 13.0.0.2 (R3) is the next-hop for 192.168.0.1. Let's modify AS-PATH on R3:

access-list 10 permit 192.168.0.1

route-map RM_AS_PATH permit 10
 match ip address 10
 set as-path prepend 300 300

router bgp 300
 neighbor 13.0.0.1 route-map RM_AS_PATH out

As a result, 10.0.0.2 (R2) becomes the next-hop for 192.168.0.1 because the route advertised from R3 has a longer AS-PATH:

R1#show ip bgp
BGP table version is 7, local router ID is 13.0.0.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
*> 12.0.0.0/30      10.0.0.2                               0 200 400 500 ?
*> 14.0.0.0/30      10.0.0.2                               0 200 400 500 ?
*  192.168.0.1/32   13.0.0.2                               0 300 300 300 500 ?
*>                  10.0.0.2                               0 200 400 500 ?

# DOWNLOAD LAB 13 GNS3 FILE