/etc/network/interfaces 中的更改导致 2 个 ip 数字

/etc/network/interfaces 中的更改导致 2 个 ip 数字

我使用备用 IP 号码 (xxx3) 运行了 Ubuntu 14.04 到 16.04 服务器升级。升级完成后,我将 /etc/network/interfaces 改回正确的号码 (xxx9,见下文)。

现在显示旧号码,揭示两个号码,并且实际上可以通过两个号码访问系统!

我真的很想知道发生了什么,以及如何摆脱旧的 IP 号码。

root@fast:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 52:54:00:fc:e6:d0
          inet addr:xxx.xxx.xxx.3  Bcast:xxx.xxx.xxx.255  Mask:255.255.255.0
          inet6 addr: blah Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1492  Metric:1
          RX packets:77037 errors:0 dropped:6525 overruns:0 frame:0
          TX packets:12999 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7384634 (7.3 MB)  TX bytes:10674567 (10.6 MB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:328 errors:0 dropped:0 overruns:0 frame:0
          TX packets:328 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:38225 (38.2 KB)  TX bytes:38225 (38.2 KB)
root@fast:~# ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    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 1492 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:fc:e6:d0 brd ff:ff:ff:ff:ff:ff
    inet xxx.xxx.xxx.3/24 brd xxx.xxx.xxx.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet xxx.xxx.xxx.9/24 brd xxx.xxx.xxx.255 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet6 blah scope link
       valid_lft forever preferred_lft forever
root@fast:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address xxx.xxx.xxx.9
        netmask 255.255.255.0
        gateway xxx.xxx.xxx.254
        mtu 1492


相关内容