1

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?

user2737037
  • 135
  • 4
  • I haven't done anything more than that above. I thought about a script checking for connectivity.... – user2737037 Jan 04 '16 at 15:34
  • Generally here at SF we like to see that you've tried everything you can to solve a problem before posting a question. As such, I would suggest writing such a script (which is the likely approach) and if you have a specific problem you can't solve, to come back to SF and ask a question to that effect. – GregL Jan 04 '16 at 16:18
  • I thought that there may be a standard way of doing this in linux that I do not know or can't find on the Internet. Having a reduntant data connection seems to me to be something I don't need to write a custom script for. A hint would be helpful. – user2737037 Jan 04 '16 at 16:31
  • Given that the connection appears to be functional, at least as far as the interface is concerned, it would likely take some manual/scripted intervention to fix the issue. – GregL Jan 04 '16 at 16:34

0 Answers0