我的 VMWare 客户机上的互联网运行出现问题,非常随机(大部分时间不工作),我不确定问题可能是什么。
有时互联网可以正常工作(这也包括可以通过 ssh 连接到主机),但大多数时候不能正常工作。
重新启动networking
没有用,任何ifdown
/ifup
也没有用。唯一可能开始工作的情况是重新启动整个 VM。即使这样,它也可能 10 次中只有一次开始工作。
到目前为止我注意到的唯一潜在问题是,当它不起作用时,VM 网络适配器的 MAC 地址会被交换 - 而如果它起作用,它们就会按配置进行。
细节:
- 主机:运行 VMWare Fusion 8.0.1 的 OS X El Capitan 10.11.4
- 来宾:Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64 GNU/Linux
VMWare虚拟机网络设置:
- 网络适配器 1 - NAT - 静态 MAC 地址
00:50:56:38:CC:21
- 网络适配器 2 - 仅主机 - 静态 MAC 地址
00:50:56:38:CC:22
在我的虚拟机.vmx
配置文件中我有这个(与接口相关):
ethernet0.present = "TRUE"
ethernet0.connectionType = "nat"
ethernet0.wakeOnPcktRcv = "FALSE"
ethernet0.addressType = "static"
ethernet0.linkStatePropagation.enable = "FALSE"
ethernet0.pciSlotNumber = "33"
ethernet0.address = "00:50:56:38:CC:21"
ethernet0.startConnected = "TRUE"
ethernet0.vnet = "vmnet2"
ethernet0.bsdName = "en0"
ethernet0.displayName = "Wi-Fi"
...
ethernet1.present = "TRUE"
ethernet1.connectionType = "hostonly"
ethernet1.virtualDev = "e1000"
ethernet1.wakeOnPcktRcv = "FALSE"
ethernet1.addressType = "static"
ethernet1.linkStatePropagation.enable = "FALSE"
ethernet1.pciSlotNumber = "37"
ethernet1.address = "00:50:56:38:CC:22"
ethernet1.startConnected = "TRUE"
主持人ifconfig
:
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=1<PERFORMNUD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether a0:99:9b:0b:bf:c5
inet6 fe80::a299:9bff:fe0b:bfc5%en0 prefixlen 64 scopeid 0x4
inet 10.230.82.42 netmask 0xffffc000 broadcast 10.230.127.255
nd6 options=1<PERFORMNUD>
media: autoselect
status: active
en1: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether 6a:00:01:ba:d6:30
media: autoselect <full-duplex>
status: inactive
en2: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether 6a:00:01:ba:d6:31
media: autoselect <full-duplex>
status: inactive
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=63<RXCSUM,TXCSUM,TSO4,TSO6>
ether a2:99:9b:b0:3e:00
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en1 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 5 priority 0 path cost 0
member: en2 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 6 priority 0 path cost 0
nd6 options=1<PERFORMNUD>
media: <unknown type>
status: inactive
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
ether 02:99:9b:0b:bf:c5
media: autoselect
status: inactive
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484
ether 7a:81:75:a1:0f:87
inet6 fe80::7881:75ff:fea1:f87%awdl0 prefixlen 64 scopeid 0x9
nd6 options=1<PERFORMNUD>
media: autoselect
status: active
vmnet1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 00:50:56:c0:00:01
inet 192.168.247.1 netmask 0xffffff00 broadcast 192.168.247.255
vmnet8: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 00:50:56:c0:00:08
inet 192.168.195.1 netmask 0xffffff00 broadcast 192.168.195.255
客人/etc/network/interfaces
:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.195.200
netmask 255.255.255.0
gateway 192.168.195.2
auto eth1
iface eth1 inet static
address 192.168.247.200
netmask 255.255.255.0
访客ifconfig
(当互联网可用时):
eth0 Link encap:Ethernet HWaddr 00:50:56:38:cc:21
inet addr:192.168.195.200 Bcast:192.168.195.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe38:cc21/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:470 errors:0 dropped:0 overruns:0 frame:0
TX packets:461 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:74106 (72.3 KiB) TX bytes:53650 (52.3 KiB)
Interrupt:19 Base address:0x2000
eth1 Link encap:Ethernet HWaddr 00:50:56:38:cc:22
inet addr:172.16.121.132 Bcast:172.16.121.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe38:cc22/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1648 (1.6 KiB) TX bytes:578 (578.0 B)
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:61 errors:0 dropped:0 overruns:0 frame:0
TX packets:61 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:24465 (23.8 KiB) TX bytes:24465 (23.8 KiB)
访客ifconfig
(当互联网无法使用时):
eth0 Link encap:Ethernet HWaddr 00:50:56:38:cc:22
inet addr:192.168.195.200 Bcast:192.168.195.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe38:cc22/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:217 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2472 (2.4 KiB) TX bytes:9398 (9.1 KiB)
eth1 Link encap:Ethernet HWaddr 00:50:56:38:cc:21
inet addr:192.168.247.200 Bcast:192.168.247.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe38:cc21/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:26 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3498 (3.4 KiB) TX bytes:620 (620.0 B)
Interrupt:19 Base address:0x2000
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:219 errors:0 dropped:0 overruns:0 frame:0
TX packets:219 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:42755 (41.7 KiB) TX bytes:42755 (41.7 KiB)
在这里我可以看到唯一的区别 - 与配置方式相比,MAC 地址是相反的。
当互联网工作时:
- 从客户机上 ping 所有 192.168.195.* 都可以正常工作(.200、.2 和 .1)
- 从主机,我可以 ping 我自己 (.1) 和客户机 (.200),ping .2 会出现“请求超时”错误
当它不起作用时:
- 从客户机我可以 ping 自己(192.168.195.200),但 ping 任何其他 192.168.195.*(.2 或 .1)时会出现“目标主机无法访问”错误。ping 互联网时也是如此(例如 8.8.4.4)
- 从主机我可以 ping 自己(192.168.195.1),但 ping 任何其他 192.168.195.*(.2 或 .200)都会出现“请求超时”错误。
知道为什么会发生这种情况吗?我还可以尝试什么?
谢谢!
答案1
该问题现已解决。
我尝试了https://communities.vmware.com/message/2350978#2350978- 通常使用现有的 VMDK 虚拟磁盘(重新创建所有外部 VM 设置)创建一个新的 VM - 尽管有点过度,但它运行完美。
以防万一我保留了原始有问题的虚拟机的副本,然后,在得到VMWare 员工的帮助- 建议ethernet0.
从 VM 的.vmx
配置文件中删除 NAT 适配器设置(所有条目),然后删除网络适配器本身,然后重新添加它 - 一切都开始完美运行。
我想我只是在文件中有一些旧设置.vmx
,来自以前版本的 VMWare,或旧的 VM 配置......