Assuming 'Network A' is having 2 ISPs which are directly connected to 'Network B', which path will be used to connect to 'Network B'?

Network A --> IP Transit A / IP Transit B --> Network B

  • 1
    Which ever one has the shortest AS Path.
    – Ricky
    Commented Jul 3, 2016 at 4:05
  • You use the word "connect", the two halves of a connection can use different (sometimes quite different) routes. All of the answers so far only talk about packets from A to B. Packets from B to A can (and often do) take a different path.
    – MAP
    Commented Jul 5, 2016 at 4:15

1 Answer 1


BGP has a long list of checks to determine which path is "best". The algorithm goes through the list from top to bottom, and stops as soon as a difference is found.

You can find a good description of this list at Cisco and Juniper (and probably on many more locations and books), including advise on how to manipulate the path selection.

In your case, the tie breakers (in order) will probably be:

  • Prefer the path with higher local preference.
  • Prefer the path with the shortest autonomous system (AS) path value.
  • Prefer the path that was received first (the oldest one).
  • Prefer the path that comes from the BGP router with the lowest router ID.
  • I believe local preference is only used within an I-BGP peering so I think in his case, like Ricky mentioned, the first criteria would be AS path. Correct me if I'm wrong please.
    – Izy-
    Commented Jul 4, 2016 at 4:44
  • Izy: you're half right. Local Pref as a BGP attribute is only passed on to other routers over IBGP, not over EBGP. However, when you apply local pref on a route, it also has effect on the routing table of the router where you apply it. So in this case, "Network A" can choose which ISP to prefer by setting a local preference at the border router.
    – RobinG
    Commented Jul 4, 2016 at 5:14
  • Oh, thank you. So you're saying that if we set the border router to chose a particular path as best by altering it's local preference, because it's the best path according to the bgp table, the edge router will pass that along to the other side?
    – Izy-
    Commented Jul 4, 2016 at 5:23
  • Keep in mind that BGP routing decisions are unidirectional. Setting local pref will mean that your router prefers a specific path for outbound traffic, but this will have no impact on inbound traffic (which will probably use AS path to determine the best path).
    – RobinG
    Commented Jul 4, 2016 at 8:54

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.