网络接口消失

网络接口消失

我有几个由 Vagrant 创建的 VirtualBox VM 实例。此 VM 的网络接口eth1定义为:

eth1      Link encap:Ethernet  HWaddr 08:00:27:61:1D:AA  
          inet addr:192.168.33.10  Bcast:192.168.33.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe61:1daa/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5095882 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8754306 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1412438221 (1.3 GiB)  TX bytes:10704698155 (9.9 GiB)

昨天,其中一个虚拟机实例丢失了eth1接口。当我这样做时,ifconfig -a我得到了:

eth0      Link encap:Ethernet  HWaddr 08:00:27:1B:06:06  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe1b:606/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:817 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1014 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:80141 (78.2 KiB)  TX bytes:111329 (108.7 KiB)

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:126 errors:0 dropped:0 overruns:0 frame:0
          TX packets:126 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:24798 (24.2 KiB)  TX bytes:24798 (24.2 KiB)

但我可以看到 的eth1定义/etc/udev/rules.d/70-persistent-net.rules

# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:f0:34:82", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

/etc/sysconfig/network-scripts/ifcfg-eth1有:

#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
NM_CONTROLLED=no
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.33.10
NETMASK=255.255.255.0
DEVICE=eth1
PEERDNS=no
#VAGRANT-END

因此看起来所有定义都存在但eth1尚未创建。重新启动并重启网络服务似乎没有帮助。有什么想法吗?

答案1



尝试ifup eth1 && tail -f /var/log/messages观察输出。
虚拟机有多个虚拟接口吗?
如果是,您可以删除所有网络接口脚本(如 ifcfg-eth0、ifcfg-eth1...)并重新创建它们。也许您的其他接口配置文件中存在问题,从而导致此问题。日志messages通常会告诉您问题发生的确切位置。

相关内容