在过去的一天里,我一直在与VMWare网络巨头作斗争,但最终决定寻求帮助。我在VMWare Workstation 8.0.2 build-591240上使用NAT,在Windows 7上运行CentOS 6映像,并且由于某种原因,我无法再使用静态IP地址连接到互联网。这似乎仅适用于静态IP,而不是DHCP,这告诉我要么是:在我的Windows 7操作系统上某个程序阻止了该IP地址的连接,或者是在CentOS映像上的配置发生了一些奇怪的问题。
我不知道这是否是由于yum更新引起的,所以尝试重新安装VMWare工具。但这似乎没有解决问题。我还尝试了以下操作:
- 确保VMnet连接已连接(很傻,但必须检查... 另外我可以使用DHCP连接到互联网)
- 确保我的Windows防火墙允许VMware连接到互联网
- 我看到/读到Windows有时会阻止ping请求,所以我在Firefox中尝试访问www.google.com,结果得到“服务器未找到”的响应...那么我需要做一些不同的DNS配置吗?
- 我检查了我的Windows机器注册表,只有一个默认网关条目
就像我说的,这似乎是突然发生的。映像以前可以无问题连接到互联网。是否有人知道可能引起这种情况的CentOS更新?为了节省一些调试周期,我在下面添加了我的配置:
[root@MyCentOS ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:A0:51:BD
inet addr:192.168.88.128 Bcast:192.168.88.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:683 errors:0 dropped:0 overruns:0 frame:0
TX packets:67 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:64242 (62.7 KiB) TX bytes:8055 (7.8 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1049 errors:0 dropped:0 overruns:0 frame:0
TX packets:1049 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:68417 (66.8 KiB) TX bytes:68417 (66.8 KiB)
[root@MyCentOS ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
IPV6INIT="no"
NM_CONTROLLED="no"
ONBOOT="yes"
IPADDR=192.168.88.128
NETMASK=255.255.255.0
GATEWAY=192.168.88.2
TYPE="Ethernet"
[root@MyCentOS ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=MyCentOS
GATEWAY=192.168.88.2
[root@MyCentOS ~]# service iptables status
iptables: Firewall is not running.
[root@MyCentOS ~]# service ip6tables status
ip6tables: Firewall is not running.
[root@MyCentOS ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
[root@MyCentOS ~]# ping 192.168.88.2
PING 192.168.88.2 (192.168.88.2) 56(84) bytes of data.
64 bytes from 192.168.88.2: icmp_seq=1 ttl=128 time=0.391 ms
64 bytes from 192.168.88.2: icmp_seq=2 ttl=128 time=0.271 ms
^C
--- 192.168.88.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1349ms
rtt min/avg/max/mdev = 0.271/0.331/0.391/0.060 ms
[root@MyCentOS ~]# ping www.google.com
ping: unknown host www.google.com
[root@MyCentOS ~]# uname -a
Linux MyCentOS 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[root@MyCentOS ~]# vmware-toolbox-cmd -v
8.8.2.10499 (build-590212)