BGP and Best Path

Hi Guys,

We are running v4.11 and multi homed with 2 providers.

currently when I did a traceroute from a 3rd network, I have noticed that BGP is not sending our the traffic to the best path.

Any tips to make sure traffic/routes is advertise to the best path for our user?

For controlling inbound traffic with two different providers there’s only one thing you can do: prepend your AS in the advertisements sent to the worse provider. Without knowing details I guess prepend between 3 and 5 times. The shorter path will now be preferred by the Internet at large.

Unless I’m misunderstanding and you’re talking about outbound traffic (how your router gets to the Internet at large), in which case a simple solution would be assigning a better weight to the better path.

Either would require using routing filters, which you presumably already have to make sure you’re only advertising your own IP space and don’t become a transit AS.

If you need a more detailed reply you need to post more details on your specific configuration.

Hi Fewi,

Is there anyway to automatically sending user to the best path without manually setting the attributes?

Thank you for the reply :slight_smile:

I don’t understand the question. Can you explain a little more? How do you define a ‘best path’? What would you consider “automatic”? What are you actually trying to do - as in, what problem are you trying to solve? Generally speaking routers can’t automatically do things because they have to be told what you want them to do.

I have 2 ISPs peering with. One of them needs to route to US before can access this 3rd network, the other ISP has direct peering. For some strange reason, our path has been chosen to use the one that needs to traverse to US.

I would like and hoping to achieve BGP advertising routes for us based on lowest latency (first criteria) and shortest path

BGP doesn’t care about latency. BGP is about making policy decisions. You cannot factor latency into BGP routing decisions. That’s not what BGP is for, by design.

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094431.shtml
That links describes BGP’s best path algorithm. Are you setting weights? If not, weights are equal for routes from both providers and it goes to the next step. You only have one BGP router so there’s no internal BGP peers, so there are no local preferences and it goes to the next step. You didn’t originate these routes, so it goes to the next step. Whatever route has the shortest AS path now gets chosen.

So to summarize:

I would like and hoping to achieve BGP advertising routes for us based on lowest latency (first criteria)

That’s impossible with BGP.

and shortest path

According to your still relatively vague description your router is already doing that, unless you’re setting weights in routing filters. If you are setting weights in routing filters adjust that until your routing policy reflects what you want it to be.

If you need further help beyond this at the very least post your BGP configuration and routing filters, together with the relevant routes, traceroutes you’ve taken, tests you’ve run together with the results and what you expected to get instead.
http://wiki.mikrotik.com/wiki/Manual:BGP_HowTo_%26_FAQ#Question:_How_to_seen_routes_advertised_to.2C_and_routes_received_from_a_particular_peer.3F describes on how to look at routes received from a peer. Have you checked the two routes from the two peers to the destination network, and actually verified that you get routes from both peers, and that their AS path lengths are what you expected them to be? That would be the first place to look.
Shortest path for BGP means “fewest number of AS to traverse” - it has nothing to do with latency, or hops, or anything like that. You say that the path that wasn’t chosen peers directly with the destination network, which would imply an AS path length of 2 - if that’s true the path should have gotten chosen. Yet it didn’t. So check and post here the proof that your assumption is in fact true first. If the router did (and I still think it did) choose the correct path as per the BGP best path algorithm and you want to force a different result you’ll have to use routing filters to change weight or AS path lengths to achieve that goal.

Hope this helps.