虚拟接口显示在 ifconfig 中,但无法与之建立连接。怎么了?

PHL*_*LAK 5 networking

我有一个安装了 Ubuntu 12.04 的 VPS,但无法将第二个 IP 设置为虚拟接口。我已经配置了接口,您可以从我的 /etc/networking/interfaces 文件中看到:

# The loopback network interface
auto lo
iface lo inet loopback

# Interfaces brought up durring boot
auto eth0 eth0:0 eth0:1

# eth0 - Public IP, WAN access
iface eth0 inet static
    address 72.14.191.251
    netmask 255.255.255.0
    gateway 72.14.191.1

# eth0:0 - Public IP, WAN access
iface eth0:0 inet static
    address 173.255.199.148
    netmask 255.255.255.0
    gateway 173.255.199.1

# eth0:1 - Private IP, LAN access
iface eth0:1 inet static
    address 192.168.128.46
    netmask 255.255.128.0
Run Code Online (Sandbox Code Playgroud)

有问题的接口eth0:0的 IP 为173.255.199.148,无法连接到该 IP。我什至无法ping通。如果我运行ifconfig,所有界面都显示为:

eth0      Link encap:Ethernet  HWaddr f2:3c:91:ae:a0:8b  
          inet addr:72.14.191.251  Bcast:72.14.191.255  Mask:255.255.255.0
          inet6 addr: 2600:3c00::f03c:91ff:feae:a08b/64 Scope:Global
          inet6 addr: fe80::f03c:91ff:feae:a08b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3664 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2908 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:330670 (330.6 KB)  TX bytes:970665 (970.6 KB)
          Interrupt:44 

eth0:0    Link encap:Ethernet  HWaddr f2:3c:91:ae:a0:8b  
          inet addr:173.255.199.148  Bcast:173.255.199.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:44 

eth0:1    Link encap:Ethernet  HWaddr f2:3c:91:ae:a0:8b  
          inet addr:192.168.128.46  Bcast:192.168.255.255  Mask:255.255.128.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:44 

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:16436  Metric:1
          RX packets:135 errors:0 dropped:0 overruns:0 frame:0
          TX packets:135 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:141948 (141.9 KB)  TX bytes:141948 (141.9 KB)
Run Code Online (Sandbox Code Playgroud)

尝试关闭或打开界面也无济于事:

chris@Optimus:~$ sudo ifdown eth0:0
ifdown: interface eth0:0 not configured
chris@Optimus:~$ sudo ifup eth0:0
RTNETLINK answers: File exists
Failed to bring up eth0:0.
Run Code Online (Sandbox Code Playgroud)

重启网络也不行:

chris@Optimus:~$ sudo /etc/init.d/networking restart
 * Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
 * Reconfiguring network interfaces...                                                                                                                                                                                                         resolvconf: Error: /etc/resolv.conf isn't a symlink, not doing anything.
resolvconf: Error: /etc/resolv.conf isn't a symlink, not doing anything.
resolvconf: Error: /etc/resolv.conf isn't a symlink, not doing anything.
ssh stop/waiting
ssh start/running, process 4289
RTNETLINK answers: File exists
Failed to bring up eth0:0.
resolvconf: Error: /etc/resolv.conf isn't a symlink, not doing anything.
ssh stop/waiting
ssh start/running, process 4361
Run Code Online (Sandbox Code Playgroud)

即使完全重新启动系统也没有任何作用。这里有什么问题?我错过了什么?

PHL*_*LAK 1

我不知道发生了什么,但我再次重新启动服务器,现在它似乎可以工作了。我真的很困惑,但至少它有效。