Page 1 of 1

Choosing short path for an internet address from multiple gateways

Posted: Fri Apr 13, 2018 10:27 pm
by crt
Hello community,
i have 2 gateways to the internet on different ISPs. BGP protocol is up with each ISP. My wireless network behind, on the LAN side, is running OSPF.
Let's assume one of my customers point the browser to youtube, github or somesite.com. Is there a way to forward the packet on the gateway closer - speaking in hops - to the choosed destination ?
I'm trying to figure out the solution but i'm not so good at BGP protocol. Maybe i'm not so good at all :)

Thanks in advance,
Cristiano aka .:[CRT]:. - running the ROS since 2004.

Re: Choosing short path for an internet address from multiple gateways

Posted: Fri Apr 13, 2018 11:14 pm
by Vooray
No.

Re: Choosing short path for an internet address from multiple gateways

Posted: Sat Apr 14, 2018 10:36 pm
by maznu
If you are receiving full tables (almost 700k routes now) from both your upstreams, then by default RouterOS will use AS path length as one of the criteria for BGP route selection. Assuming you've not set higher local preference or metrics on the routes (by using "in" filters), then you will be getting this behaviour already. This will sort-of-but-not-quite be "number of hops" (technically it is the number of networks on the path between your router and the destination - some networks are very flat, carrier networks can be very long).

If, however, you are only receiving a default route from both your upstreams, then you will not be able to use BGP for this.

Bear in mind that your upstreams are probably doing this for you already - choosing the "best" path to the destination - so don't feel too disheartened if you are only taking default routes. But "best" means different things to different providers (might be cheapest, might be lowest latency, might be based on BGP communities, or might be simply based on AS-path length). And remember that two full tables will tax a router with less than 2Gb RAM, and takes about 5 minutes for RouterOS on Tile architecture to converge the table (quite slow!).

Re: Choosing short path for an internet address from multiple gateways

Posted: Sun Apr 15, 2018 2:02 am
by crt
Thank you both repliers.
So what i'm thinking is real. It's quite impossible to get the whole internet routing table in my routers :)
It was only a theoretical question to understand if a "least cost hop route" feature can give better service and experience on customer side.

But - as i understand from your replies - effort is more expensive than benefits.

Regards, and thank you again.

Cristiano aka .:[CRT]:. - evolve or die.

Re: Choosing short path for an internet address from multiple gateways

Posted: Sun Apr 15, 2018 9:12 pm
by Vooray
Speaking theoretical if you redistribute your full views into ospf, then yes. But i have not heared any success stories on doing that.

Re: Choosing short path for an internet address from multiple gateways

Posted: Sun Apr 15, 2018 10:16 pm
by maznu
Speaking theoretical if you redistribute your full views into ospf, then yes. But i have not heared any success stories on doing that.
I would strongly advise against redistributing 700k BGP routes into OSPF. Probably better to have your loopbacks in OSPF and carry your full tables in BGP.

…now if only MikroTik would fix multihop path resolution for IPv6! (but I digress)