Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

BGP traffic shapping

Hi techies,

can any one help me out , i have 2 router each at 2 diffrent AS, they are connectd through 2 diffrent service providers.the dia is enclosed, on router A i want to route seg 1 traffic on normal senirio and seg 1 & 2 traffic only when SP2 fails.

on router B , seg 2 and 1 & 2 on failing SP1 .

also on routers C ,i want to route seg 3 traffic in normal condition and seg 3 & 4 traffic only when sp2 fails.

Router D , segment 4 on normal confition & 3&4 on SP1 FAIL.

Ebgp - external protocal

Ibgp - b/n rourers in same AS.


New Member

Re: BGP traffic shapping


Hall of Fame Super Silver

Re: BGP traffic shapping

Hello Raahi,

because there are other ASes in the middle you can only use AS path prepending in a selective way.


route-map selective_prepending permit 10

match ip address match_seg2

set as-path prepend 100 100 100

route-map selective_prepending permit 20

! empty block to allow seg1 with no changes

router bgp 100

neigh router.isp1.ipaddr remote-as ISP1.AS

neigh router.isp1.ipaddr route-map selective_prepending out

! then you have the iBGP session

neigh RB remote-as 100

the same has to be done on all the four routers: the routes with prepending applied should be the less preferred and used only in case of failure of the other link/eBGP session

the ACL can be a standard ACL or a prefix-list (in that case you need to use

match ip address prefix-list prefix-list-name inside the route-map)

Hope to help


New Member

Re: BGP traffic shapping

fine .if i configure

match ip address match_seg1

for route-map ...... 20 for router A

what would be the impact.

Super Bronze

Re: BGP traffic shapping

Another method to accomplish this, run iBGP between your routers within the same AS, direct LAN segment traffic to the primary router for that segment, and adjust incoming AS hops either incoming from eBGP peer or between iBGP peers. (The purpose of the latter is to make the path from other iBGP router less or equally attractive vs. via eBGP peer, but if eBGP peer drops or some route(s) lost, that route's traffic will flow across iBGP and via the other provider.)