Interface Routing

Hello,

Can I create a route and specify the interface as the gateway in RouterOS?

eg. ip route add dst-address=10.0.0.0/24 gateway=ether1

Thanks
Tiaan

No.

I have requested this several times, too :wink:

Best regards,
Christian Meis

I wish this was there too - i lost that feature when we threw out the ciscos.

Sam

Especially as this would allow load-balancing over multiple ADSL uplinks which all have the same default gateway (ip address)…

Best regards,
Christian Meis

exactly the reason I wished it was there…

:smiley:

But I think MikroTik did not realize the need for this until now.
The answer to my requests (explaining the need for that) was always “no” (as I could do it with policy routing or the like - which is not true if you have the same gateway ip address on multiple uplinks).

Perhaps some more guys jumping onboard this request could help?

It shouldn’t be too hard to implement - it’s there in every standard linux distribution…

Best regards,
Christian Meis

Note that this is a particularly bad example for the requested feature, giving an ethernet interface as the gateway. If this feature is implemented at all then it should be implemented for point-to-point interfaces only.

Why is using this with ethernet (or any broadcast / shared-media interface type for that matter) a bad idea? Well, if no next-hop IP address is given but only an interface (like in the example), then there is no way a MAC address can be resolved (using ARP), because without a next-hop IP address, for what IP address would you ARP for? So the only possible way to transfer the packet is to send it out of the interface with a MAC layer broadcast destination address (MAC FF:FF:FF:FF:FF:FF). This will make every packet a broadcast and flood all your switch ports with every packet, as far as ethernet is concerned.

The only situation I would ever find this acceptable is when the physical topology is strictly point-to-point, e.g. a crossover cable between two ethernet devices and nothing else.

On point-to-point interfaces it’s a nice feature, though.

–Tom

Hello Tom,

of course that’s true (and I have discussed this topic so much I just forgot to add this)!

My application scenario would be for PPP links, which are point-to-point of course.
Using interface based routing to force traffic out a normal ethernet interface could create interesting effects on your network, yes :wink:

Best regards,
Christian Meis

Hallo,

I’ll explain the reason why I asked the question, maybe someone can give me another solution.

I’ve got 3 connections on my router; satellite, 3G and wireless. I need to use the cheapest path available to send data to a server on the internet, no other connections will be made from within the network. The data also have priorities, i.e. some data will only be send when the router enters a wireless cloud, etc. I will monitor the state of the interface from within the application to make these decisions.

The problem is that the interfaces gets dynamic IPs. My plan was to create static routes with different metrics and then specify the interface as the gateway.

Thanks
Tiaan

I would still like to see interface routing…

however, you can use dynamic routing filter (dynamic-in) to somewhat get around this … as you learn the DHCP default gateway you can change the distance of it on the fly … the problem is that you can’t decipher which DHCP client to mangle to what. It would be nice to have a routing filter that would also include interface or something.

Yeah, or a parameter under /ip dhcp-client to name a script that will be called after receiving a new client lease…


–Tom

I’ve been seriously looking for interface routing since around v2.8.11. The other so called solutions have been outrageously inefficient, overly complicated with unacceptable short comings such as the ones cmit mentioned.