I want to realize a fallback internet connection over mobile broadband. I have a umts stick which behaves like a network interface in linux (eth1) and a normal tethered connection (eth0).
I am working with dhcpcd as networkmanager for convenience and my interfaces file looks like this:
auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet manual
auto eth1
allow-hotplug eth1
iface eth1 inet manual
That's the output of route -n
:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.42.0.1 0.0.0.0 UG 202 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 400 0 0 eth1
10.42.0.0 0.0.0.0 255.255.255.0 U 202 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 400 0 0 eth1
When I unplug eth0 routes for eth0 get deleted and eth1 is used as internet connection. But when eth0 is still connected but has no internet, eth0 is used nevertheless causing an internet outage.
My question is: How can I tell linux / dhcpcd to stop using an interface, if it has got no internet connectivity?