BGP Directing Traffic

I am trying to direct a few select subnets to prefer one path (we'll call it PPL) instead of the other (we'll call it Sprint).

The subnet in question is 63.174.244.0/24.

With the following configuration EVERYTHING goes out PPL, which is what I would expect: router bgp 26383 neighbor 160.81.248.77 remote-as 1239 neighbor 160.81.248.77 description ebgp link to sprint neighbor 160.81.248.77 version 4 neighbor 160.81.248.77 soft-reconfiguration inbound neighbor 160.81.248.77 route-map addmyas in neighbor 160.81.248.77 route-map addmyas out ! ip prefix-list sendoutppl description Sends Traffic Out PPL ip prefix-list sendoutppl seq 5 permit 63.174.244.0/24 ! ip prefix-list sendoutsprint description Sends Traffic Out Sprint ip prefix-list sendoutsprint seq 5 deny 0.0.0.0/0 ! route-map addmyas permit 10 match ip address prefix-list sendoutsprint ! route-map addmyas permit 20 match ip address prefix-list sendoutppl set as-path prepend 26383 26383

With the following configuration, my 63.174.244.0/24 block is still going out Sprint, why? router bgp 26383 neighbor 160.81.248.77 remote-as 1239 neighbor 160.81.248.77 description ebgp link to sprint neighbor 160.81.248.77 version 4 neighbor 160.81.248.77 soft-reconfiguration inbound neighbor 160.81.248.77 route-map addmyas in neighbor 160.81.248.77 route-map addmyas out ! ip prefix-list sendoutppl description Sends Traffic Out PPL ip prefix-list sendoutppl seq 5 permit 63.174.244.0/24 ! ip prefix-list sendoutsprint description Sends Traffic Out Sprint ! route-map addmyas permit 10 match ip address prefix-list sendoutsprint ! route-map addmyas permit 20 match ip address prefix-list sendoutppl set as-path prepend 26383 26383

Reply to
mhoppes
Loading thread data ...

Use local preference to control / influence how traffic is routed OUTBOUND

Use AS path prepend to control / influence how traffic is routed INBOUND

Reply to
Merv

Ok.. what you say jives with other things I have heard and learned... however, I'm a little confused on local-pref. I have 2 routers. A&B. If my main network is hanging off of router B, what command would I put in router B to make one of my subnets favor the route out router A better then the route out router B?

I know I can set local pref in each router, but that only seems to make it always take the route out the local router. So let's say with the above config, what do I need to put in those match statements, to make my traffic for 63.174.244.0/24 go OUT my PPL pipe?

Reply to
mhoppes

Lets say that you have routers A & B and providers 1 & 2 hanging of those routers. On router B you get a route from provider 2 for say 10.1.2.0/24 (as an example). You also get see a route for this prefix from provider 1 on router A, but for what ever reason (as-path perhaps) provider 2 is preferred.

When you look at the route on your network using 'sh ip bgp 10.1.2.0' you can see that the local pref for the route via router B is 200. But .. you want to use router A and provider 1 for that traffic.

On router A you want to tag the inbound route with a higher local pref so that it's preferred. So, I do it like this.

---------------------------------------------------- ip prefix-list override-local-pref seq 10 permit 10.1.2.0/24

route-map Adjust-Inbound permit 100 match ip address prefix-list override-local-pref set local-pref 500

router bgp 12345 neighbor 1.2.3.4 route-map Adjust-Inbound in

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

If you then refresh your routes ..

clear ip bgp 1.2.3.4 in

The prefix 10.1.2.0/24 will be tagged with a local pref of 500 when received from that BGP peer. The other route from router B is still 200 and so now traffic to that destination goes via router A and provider 1.

I use this to re-route traffic for certain prefixes if going via one transit provider seems to be causing a problem and I want to force it out of the other provider.

I hope that this helps.

Chris.

Reply to
Chris

Chris, Thanks... that was most helpful.. and I now have figured out how to route traffic out provider A or provider B based on the subnet I am trying to get to. I also know how to do as-prepends to make traffic coming in prefer A or B better. The only last outstanding question is:

If I have a subnet on MY end (ie 19.2.168.0.1/24) that I want to always send out one peer, how would I do that?

Reply to
mhoppes

Routes that fall in your address space that you advertise will attract INBOUND traffic

Thus you would use AS path prepend since the traffic will be INBOUND

If you only want to advertise a specific prefix to one of your ISP then you would apply outbound prefix filtering

Setup a inbound and outbound route-map for each ISP:

neighbor x.x.x.x route-map AS-xxxx-IN in neighbor x.x.x.x route-map AS-xxxx-OUT out

neighbor y.y.y.y route-map AS-xxxx-IN in neighbor y.y.y.y route-map AS-xxxx-OUT out

Then construct the appropriate route-maps to implement the desired routing policies

Reply to
Merv

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.