Does anyone already have experience with network bonding under ResinOS 2.0?
Some of my devices are on sketchy internet connections, so there I would like to install a 3g-modem (usb dongle) as a BACKUP. Now I noticed that ResinOS 2.0 does this almost perfectly, because if I have both LAN and 3g enabled, the LAN connection has higher priority in the routing table and will therefore get all the traffic.
Also when the LAN is unplugged, the 3g connection takes over without a problem.
But in many of the RealLife cases the LAN connection is not actually unplugged, but it is the MODEM (behind the router) that is giving trouble. The LAN keeps being connected to the router still has a gateway address. Therefore the RasPi will still give priority to the LAN connection, resulting in an unreachable RasPi.
I think this might be solved by bonding the LAN & 3g connections. Any experience with this?
@FransvanHoogstraten, in general anything you can do with network manager should be possible in resinOS.
I had a quick google and it is supported so I suggest grabbing a dev image and giving it a try - I thought that this link looked the most promising, under the “Configuring bonded interface” section.
In the blogpost they configure NetworkManager with the “nmcli” command. I can’t imagine I am able to control the ResinOS NetworkManager from within my container right? I think I should do it via configuration files in the /system-connections folder on the SD?
Did any of you succeed with this?
I was planning to play around with bonding but I get operation not supported as soon as I attempt to enable a bonded connection.
I have another solution for this which has been working flawlessly on all my device. I have a script that
continuously monitors all network interfaces: whether they can ping 8.8.8.8 and wat their latency is.
if the current default gateway loses its internet connection or latency becomes too high, I switch to the gateway of the other internet interface (if available). Switching is done via dbus.
The way this works is by having an external URL that a device regularly checks from all available interfaces. By default it is an URL on our API servers. If the URL cannot be reached then the route metric for the tested interface is given less priority by NetworkManager. Thus if a LAN connection is up, but the Internet cannot be reached through it, a secondary connection like cellular or WiFi will end up having a better route metric and Internet will be accessed through it.
Other methods could be employed as well of course, since we are running the standard Linux networking stack and all is accessible for configuration from the application containers.
@FransvanHoogstraten thanks for the quick response. I was considering doing something similar had @majorz not responded what he did above.
@majorz that seems like great standard functionality to handle failover from one interface to another. However, without hijacking this thread, what I actually want to do is to increase the throughput by e.g. balancing two gsm interfaces in a bonded interface. Also, if one degrades or completely fails the other should be used as failover.