Is it possible to use local pref attribute to influence outbound routing for a given network that is advertised by different ASNs? So, I have a single network, for e.g., and I own, for e.g. AS100 and AS200, and I am advertising this network from both the ASNs. If I tag a higher local pref for this route from AS100, and tag a lower pref for this route from ASN200, and advertise to my neighbors, would my neighbors then always route the traffic to AS100?

If this is not possible, is there any other attribute I can use in my route advertisement to ensure traffic always comes into my AS100?

  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
    – Ron Maupin
    Feb 19, 2018 at 4:17

2 Answers 2


You are actually asking about inbound routing if you want to influence routing to your ASes.

The local preference is local to the AS, and it is for outbound routing. What local preference you have in one AS has no effect on the routing in a different AS, whether or not you own both ASes. Other ASes cannot see your local preference. You could try setting a lower MED on the preferred AS, but another AS may ignore that, or you could try prepending to the AS_PATH, or aonther method, but that, too, can be ignored by another AS.

You can try to influence routing in a different AS, but the point of ASes (Autonomous Systems) is that they are actually autonomous; each AS makes its own routing policies and decisions, independent of any other AS. The administrators of an AS are free to follow your hints (MED, AS_PATH prepending, etc.), or ignore them altogether.

Think about it, you would not want someone in a different AS dictating your routing policy in you AS. The same holds true for other ASes; they don't want you dictating routing policy to them.

In practice, you can probably influence other ASes with AS_PATH prepending. Some may pay attention to your MED. The only real way to be sure that your hints are respected is to get a business agreement with the other AS.

  • Hi many thank for your reply, so lets for example say i have BGP peering over GRE tunnels with a peer who has 2 ASN's but advertising the same prefix eg: , is it possible for him to use a community and raise the local pref advertised from one ASN, so when i send the traffic back to him, i can prefer the route with the highest local pref So when i do show ip bgp 192168.100.0/24, i should be seeing 2 route advertisements from 2 ASN's, however my router will be prefer the one with highest local ASN, is my understanding right?
    – venkyjack
    May 25, 2017 at 7:06
  • Local preference is not advertised outside an AS; it is local. It is possible that you and he could come to an agreement about what communities mean, and you could create a policy to prefer, or not, different paths based on the communities he sets. The simplest method would be for you to just trust the AS_PATH and or MED he advertises, which would be the default for you, and simple for him to implement.
    – Ron Maupin
    May 25, 2017 at 13:22

In order to influence outbound router decisions you would want to utilize AS PREPEND. If you look at the BGP route decision ordering, the default behavior is to choose the route with the shortest AS PATH. In this case, you can advertise out AS200 with the AS 200 prepended (typically you would prepend it three times).

Example for Router in AS200:

ip access list standard ACL_MATCH_NET

route-map RM_AS_PREPEND permit 10 
match ip address ACL_MATCH_NET
set as-path prepend 200 200 200 

router bgp 200 
network mask
neighbor x.x.x.x remote-as xxxx
neighbor x.x.x.x route-map RM_AS_PREPEND out

Keep in mind that the upstream router doesn't have to accept the as path, and can filter or change the path you set too.

  • Hello, thanks for your comment, i understand AS-PATH prepend will influence outbound routing, but isnt it for the same AS? In this case the upstream router might still route traffic to AS200 as its a different ASN from AS100?
    – venkyjack
    May 25, 2017 at 7:13
  • 1
    @venkyjack, the upstream router sending traffic to you is inbound routing. The traffic you send to the upstream router is outbound routing. Based on your question, you want to influence inbound routing, and you can try to do that by prepending the AS_PATH. You could do that for your outbound routing, too, but it is easier for you to use the local preference in your own AS for outbound routing. In any case, you simply cannot dictate a routing policy to another AS, just as the other AS cannot dictate the routing policies in your AS. That is the point of an AS.
    – Ron Maupin
    May 25, 2017 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.