我遇到的问题是,我的服务器无法从配置“/etc/network/interfaces”接管我的网关 (10.0.0.1)。重新启动后,它总是更改为我之前的旧网关 (192.168.178.1)。
## /etc/network/interfaces ##
# The loopback network interface
auto lo eth0
iface lo inet loopback
# The primary network interface
iface eth0 inet static
address 10.0.0.5
netmask 255.255.255.0
gateway 10.0.0.1
## Kernel IP routing table ##
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.178.1 0.0.0.0 UG 202 0 0 eth0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.178.0 0.0.0.0 255.255.255.0 U 202 0 0 eth0
## IP´s ##
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:30:05:cb:cc:00 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.5/24 brd 10.0.0.255 scope global eth0
valid_lft forever preferred_lft forever
inet 192.168.178.5/24 brd 192.168.178.255 scope global noprefixroute eth0
valid_lft forever preferred_lft forever
inet6 fd54:c52a:6301:1:4fcd:6215:d975:ba24/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 2591827sec preferred_lft 604627sec
inet6 2003:dc:f72d:d400:3941:34f8:51c0:e2aa/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 7027sec preferred_lft 1043sec
inet6 fe80::3067:148d:bae7:e488/64 scope link
valid_lft forever preferred_lft forever
对不起,我的英语不好...
此致,
泽罗尼克斯