Route Prioritization for multiple default destination

Hello,

I am trying to configure route prioritisation between eth0, wlan0 and usb0 for default destination but can’t find a way to do it. This is for a server 15.3 Leap.

This is what I would do on a Debian-based linux for this situation:

Destination     Gateway      Genmask         Indic Metric Ref    Use Iface
0.0.0.0         192.168.150.1   0.0.0.0         UG    202    0        0 eth0
0.0.0.0         192.168.150.1   0.0.0.0         UG    203    0        0 wlan0
0.0.0.0         192.168.225.1   0.0.0.0         UG    300    0        0 usb0
192.168.150.0   0.0.0.0         255.255.255.0   U     202    0        0 eth0
192.168.150.0   0.0.0.0         255.255.255.0   U     203    0        0 wlan0
192.168.225.0   0.0.0.0         255.255.255.0   U     300    0        0 usb0

eth0 should have the priority if up, then wlan0 should be the one if eth0 is now and finally usb0. The reason is that this is a device that can move and have ethernet, wifi and 3G/lte (through usb card) connection to the internet.

Client IP are acquired by DHCP. I understand that metrics are set to 0 by default for DHCP (/etc/sysconfig/network/dhcp)

The documetation here (https://doc.opensuse.org/documentation/leap/reference/html/book-opensuse-reference/cha-network.html) says that “the current kernel does not use metric in static routing”. I am not sure how to interpret this nor a better way to do it.

Can you point me in the right direction to configure Opensuze for such a use case?

Have a lovely day,
Torpi

       DHCLIENT_ROUTE_PRIORITY
              This option allows to set a metric/priority for DHCPv4 routes. Default is 0.

For as long as you’ve been simply assigning routing priorities, wondering if you’ve been satisfied how it works.
Problem I’d always run into is that it only works if the network connection is totally working or totally broken, nothing in between.
So, for example, if you had intermittent but substantial network congestion on your primary route, it would go down intermittently so your system would fail over to the next route, but your original route might come back up again automatically when the congestion subsides.
Each time your system switches from one route to another, it breaks your session which has to be recreated because if you connect through a different interface the remote machine will recognize your connection as coming from a different machine… TCP/IP is a 2-way protocol, and your local and the remote machine you’re connecting to are always verifying each is talking to the other and not some interloper.

I haven’t set up the multi-path daemon before, but it looks like it addresses the problem I describe… a “controller” (the multipath daemon) tracks each route’s status and chooses a particular route and switches to another route only when the first fails and your gateway won’t change again unless that fails. You’ll find more “stickiness” to a specific route which should mean less disruption to your sessions connecting to remote services.

Bottom line…
For what you are doing, I suspect you shouldn’t be doing it the way you describe, and try to set up the multipath daemon to control your routing.

TSU