Fallback interface if no connectivity is present
Hello :)
I have a system that contains two network interfaces - one through Ethernet, and one through Cellular modem. I want to use the Ethernet connection while there's a connection to the internet from it. When there is no connection to the internet from Ethernet, which by that I mean "connected but no connectivity" - Got a local IP from the router but there is no connectivity, I want NetworkManager to switch to the cellular modem until there's connectivity again in the Ethernet interface.
So far, I've tried to configure 2 network connections with different route metrics, so that while there's connectivity from the Ethernet, its metric will be lower than the cellular modem. I've disconnected the Ethernet connection from the internet and then waited for the connectivity penalty. I expected NetworkManager to try and check if there's connectivity to internet through the modem cellular, but instead both of the connections received metric penalty. I believe the problem lies somewhere in the resolv.conf that is generated by NetworkManager, because there's a ping to 8.8.8.8 through the cellular modem interface, but not with the the website URL we are using for connectivity check. I believe the DNS requests to nameservers in the resolv.conf are still going through the ethernet connection and not the cellular modem connection.
Is there a simple way to config this system to work as expected? Or a simple solution to the DNS problem?
Thank you! Dvir