我的/etc/network/interfaces
样子是这样的:
# The primary network interface
allow-hotplug enp3s0
iface enp3s0 inet dhcp
# iface enp3s0 inet6 dhcp
# USB 3.0 Gigabit Ethernet
allow-hotplug enx00249b170da2
iface enx00249b170da2 inet static
address 192.168.1.67
netmask 255.255.255.0
# WiFi
allow-hotplug wlp2s0
iface wlp2s0 inet dhcp
# iface wlp2s0 inet6 dhcp
wpa-conf /etc/wpa_supplicant.conf
像route -n
这样:
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 wlp2s0
25.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 ham0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp2s0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 enp3s0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 enx00249b170da2
我希望enp3s0
成为默认网关(并且通常优先于wlp2s0
)
一个关键的要求是,在任何情况下,即使有任何接口缺失或关闭,也能完成启动。