我想通过移动宽带实现回退互联网连接。 我有一个在Linux(eth1)和普通连接连接(eth0)中的networking接口。
我正在使用dhcpcd作为networkmanager以方便我的接口文件如下所示:
auto lo iface lo inet loopback auto eth0 allow-hotplug eth0 iface eth0 inet manual auto eth1 allow-hotplug eth1 iface eth1 inet manual
这是route -n的输出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
当我拔掉eth0的eth0路由被删除,eth1被用作internet连接。 但是,当eth0仍然连接,但没有互联网,使用eth0,但造成互联网中断。
我的问题是:如何告诉linux / dhcpcd停止使用一个接口,如果它没有互联网连接?