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. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

Policy routing in BGP











I have two routers, R1 is connected to ISP1 and ISP2, R2 is connected to ISP3. I advertise and to ISP1 and ISP2, but I only advertise to ISP3 (for political reason).

What I intend to do:

To configure equal local-preference to all ISP or higher local-preference to ISP3.


When I do that, network will exit ISP3 but it will drop because I only advertise to ISP3.

Someone tell me that policy routing will solve my problem. Anybody can give me a sample on how to do it from the given information above? I tried to configure it but it doesn't work.


Re: Policy routing in BGP

What does this mean, it sounds like a contradiction>

"What I intend to do:

To configure equal local-preference to all ISP or higher local-preference to ISP3. "

Even if traffic from goes out ISP3 it should still work. The responses shouold come back through ISP1.

Re: Policy routing in BGP

As I said is not advertised to ISP3 but if the destination is nearer via ISP3, host from will choose that path and will be drop because of filtering in the interface and bgp.

New Member

Re: Policy routing in BGP

in your AS and as you wanna your route policy you need to configer Weight on your two routers

as you know in BGP you chosse the best path by useing the BGP attributes so configer BGP if you know evrey thing knows about BGP

as you talk about Local-Preference its effect on your AS and thats mine when you configer it on Router2 in your AS which connects to ISP3 so best path for BGP is Router2 as you tell to your router

but in Weight attributes its effect on a router not on AS so you can fwd your traffice from other routers by configer that command

Re: Policy routing in BGP

Nope, we don't use weight cause weight is local to router only. As you know we have two routers with iBGP, if weight is used - it will not propagate to the second router.


Re: Policy routing in BGP

You didn't day you were filtering packets, just routes.

A simple policy would check the source address of DATA packets and force the next hop to R1's address. create an access list that catches all traffic from the network not suppossed to use ISP3. Be careful if there are more routers in between R1, R2 or if r2 also does any interior routing for If it doesn't try an access list route-map like this. Syntax may not be perfect but its close; check it out with ? or documentation.

access-list 101 permit ip any

route-map set-next-hop permit 10

match ip addr 101

set next-hop x.x.x.x

route-map set-next-hop permit 20

int fax/x

desc inside iface on r2

ip policy route-map set-next-hop

If R2 also does interior routing for then add some deny's to the front of the access list so interior bound packets wont get the next hop forced.

Re: Policy routing in BGP


I'll try and let you know the outcome. It seems to work as I look at it, I made a mistake - I'm barking at the wrong tree (trying to do it in BGP route-map filtering).