我想在 debian 11.6 中配置 eth0 和 eth1
目前,我已将其配置如下
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.125
netmask 255.255.255.0
gateway 192.168.1.1
allow-hotplug eth1
iface eth1 inet static
address 192.168.1.126
netmask 255.255.255.0
gateway 192.168.1.2
配置后我只能 ping eth0 而不是 eth1
任何帮助将非常感激!
答案1
route add -net 192.168.1.126 netmask 255.255.255.255 gw 192.168.1.2 dev eth1