Community discussions

MUM Europe 2020
 
forne
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Tue Feb 15, 2011 3:18 pm

Feature request: routing via dynamic gateway w/out scripting

Tue Feb 22, 2011 10:20 am

The problem
There is a way to set up load balancing with failover without scripting described here: http://wiki.mikrotik.com/wiki/Advanced_ ... _Scripting. All is working fine. We may use "virtual" hops and rely on recursive nexthop lookup. However in order to make it working, we have to define at least one route that points to the real gateway. Here is an example from the mentioned article:
/ip route
add dst-address=Host1 gateway=GW1 scope=10
add dst-address=Host2 gateway=GW2 scope=10
GW1 and GW2 must be ip addresses. If we use interface names here, recursive nexthop lookup will not be working. But what to do in cases when a gateway address may change? If we reconnect to ISP and get a new gateway address, all our static routes related to that ISP will become inactive because they are still using an old gateway address.

There is a workaround for that if we connect to ISP using ppp (pppoe, pptp, l2tp, etc). We can specify a static remote ip address for particular connection in the ppp profile. But what to do in case of getting a dynamic gateway address via DHCP? We can use scripting here and change all the related routes according to the new gateway address. But I think the OS specially designed for routing should allow to do such things without scripting, shouldn't it?

The solution
I would propose to add the following new option to dhcp-client, pppoe-client, l2tp-client and all other clients:

gateway-alias (IP; Default: "")

If this option is specified, Router OS will automatically add the following dynamic route to the routing table when the connection is going up (the connected route is added):

/ip route add dst-address=<gateway-alias>/32 gateway=<real-gateway> distance=1 scope=10 target-scope=10

This route will be automatically removed when the connection is going down (the connected route is removed). So we can use <gateway-alias> as a gateway in our static routes and there is no need to change routes any more even if the real gateway is dynamic. Moreover, using this approach we can change ISP without need to change any static routes at all.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8327
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Feature request: routing via dynamic gateway w/out scrip

Wed Feb 23, 2011 8:17 pm

Can anybody explain me ethernet network design, when GW can be changed during DHCP address renewal?..
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
forne
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Tue Feb 15, 2011 3:18 pm

Re: Feature request: routing via dynamic gateway w/out scrip

Fri Feb 25, 2011 4:26 pm

I suppose that there are several routers in one broadcast segment running in order to do load balancing.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8327
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Feature request: routing via dynamic gateway w/out scrip

Fri Feb 25, 2011 5:55 pm

but in that case previous gateway should also work, I believe...
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
forne
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Tue Feb 15, 2011 3:18 pm

Re: Feature request: routing via dynamic gateway w/out scrip

Sat Feb 26, 2011 4:38 am

That is true if the previous gateway is in the same network as a newly assigned ip address. Otherwise it will not work. Example of possible load balancing in the same broadcast segment:

dhcp1: network=10.10.1.0/24 router=10.10.1.1
dhcp2: network=10.10.2.0/24 router=10.10.2.1
dhcp3: network=10.10.3.0/24 router=10.10.3.1
 
forne
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Tue Feb 15, 2011 3:18 pm

Re: Feature request: routing via dynamic gateway w/out scrip

Thu Mar 10, 2011 11:14 am

It's strange not to see other comments, especially from MT team. This question has been asked many times and every time a script has been suggested as a solution:

http://forum.mikrotik.com/viewtopic.php?f=9&t=40417
http://forum.mikrotik.com/viewtopic.php?f=2&t=14461
http://forum.mikrotik.com/viewtopic.php?f=6&t=6007
http://forum.mikrotik.com/viewtopic.php?f=6&t=2622

I believe my solution is simple to use, easy to implement and completely solves the problem of policy routing via dynamic gateway. Would it be correct if I e-mail this feature request to support@?
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8327
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Feature request: routing via dynamic gateway w/out scrip

Thu Mar 10, 2011 7:31 pm

yeah, having some additional options in DHCP client would be nice... like

default-route-routing-mark=
default-route-scope=
default-route-target-scope=
default-route-override-dst-address=

write to support@, I'll be glad to see their answer here
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
forne
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Tue Feb 15, 2011 3:18 pm

Re: Feature request: routing via dynamic gateway w/out scrip

Sat Mar 12, 2011 7:22 am

If an pppoe/pptp/l2tp client on RouterOS wants to always use a static remote ip address specified in a ppp profile, can an ISP deny doing that or not? Does anyone know for certain?
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8327
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Feature request: routing via dynamic gateway w/out scrip

Sat Mar 12, 2011 8:06 pm

no, you cannot - you don't know that. do you need that?
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
rborz
newbie
Posts: 29
Joined: Sat Nov 29, 2008 11:41 pm

Re: Feature request: routing via dynamic gateway w/out scrip

Sat Aug 06, 2011 10:20 pm

On the first sight I think we're on the same wavelenght...

I also want an additional option for the DHCP client for almost the same thing you mentioned. ;-)

See: http://forum.mikrotik.com/viewtopic.php?f=1&t=47781

Has anyone submitted this feature request to support@mikrotik.com yet?

Regards,
Robert
 
pedja
Long time Member
Long time Member
Posts: 684
Joined: Sat Feb 26, 2005 5:37 am

Re: Feature request: routing via dynamic gateway w/out scrip

Thu Aug 11, 2011 1:16 pm

This has been several time in last few years but Mikrotik stuff is categorical not to add such option.

Even windows has it. When you set DHCP client there is simple check box to choose wether to automatically add DHCP provided gateway as default gateway or not. You can even set metrics for that default route.
 
pkelly1603
Frequent Visitor
Frequent Visitor
Posts: 78
Joined: Mon Jun 15, 2009 11:13 pm

Re: Feature request: routing via dynamic gateway w/out scrip

Tue Aug 16, 2011 5:47 pm

I had a similar request:

http://forum.mikrotik.com/viewtopic.php?f=2&t=50273

It is very difficult to do failover with a dhcp WAN connection on Mikrotik.
 
jabavox
just joined
Posts: 4
Joined: Fri Jul 18, 2014 2:36 pm

Re: Feature request: routing via dynamic gateway w/out scrip

Mon Oct 13, 2014 8:02 am

Is it any solution on this question yet,...Ohhh mikrotik
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Feature request: routing via dynamic gateway w/out scrip

Mon Oct 13, 2014 1:32 pm

/ip dhcp-client add add-default-route=
no  special-classless  yes
and another option
default-route-distance
 
jabavox
just joined
Posts: 4
Joined: Fri Jul 18, 2014 2:36 pm

Re: Feature request: routing via dynamic gateway w/out scrip

Tue Oct 14, 2014 10:00 am

Hello janisk,
I'm new with mikrotik,believe... your reply only for dhcp-client(is it?), my point is solution for "pppoe-client". i really need it for load balancing with failover without scripting.
There is a workaround for that if we connect to ISP using ppp (pppoe, pptp, l2tp, etc). We can specify a static remote ip address for particular connection in the ppp profile.
I'm not try that yet(Can i?,with mikrotik) because my ISP always provide dynamic ip(if i need static ip..have to pay more:( ). So what do you suggest?

Thanks in advance.
 
jabavox
just joined
Posts: 4
Joined: Fri Jul 18, 2014 2:36 pm

Re: Feature request: routing via dynamic gateway w/out scrip

Thu Oct 23, 2014 7:38 pm

Reply from Microtik support:
Hello, It is not possible because of current nexthop resolution algorithm. There will be a lot of improvements in version 6, so most likely this feature will also be added. You can try looking in our wiki http://wiki.mikrotik.com/wiki/User/Routing There are a lot of load balancing examples, for example, "ECMP Failover Script" Regards, Maris B. 10/23/2014 15:27
Thank you very much Maris,I hope so...very soon.What took you so long? Ohh...Mikrotik.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8327
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Feature request: routing via dynamic gateway w/out scrip

Fri Oct 24, 2014 11:29 am

seems like it should be 'in version 7' =)
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
jabavox
just joined
Posts: 4
Joined: Fri Jul 18, 2014 2:36 pm

Re: Feature request: routing via dynamic gateway w/out scrip

Fri Oct 24, 2014 1:32 pm

seems like it should be 'in version 7' =)
Hi Chupaka,
Is it that long? hah! >_<

Who is online

Users browsing this forum: dbar, Google [Bot], Mariusoft and 54 guests