2015-10-06 268 views
-2

最近在我的Windows 7主机中安装了centos虚拟机(虚拟机播放器)。无法从centos虚拟机登录谷歌

  • 我可以ping我的vm从内部网络没有任何问题。
  • 我也可以从我的vm到达内部网络而没有问题。
  • 但我的虚拟机不能访问互联网,我不能ping谷歌例如或任何其他外部网络。

我尝试了几种解决方案,我花了一个多星期的时间试图找出问题所在。

配置:

  • 我的VM被桥接和在DHCP模式下工作:

[根@本地〜]#的ifconfig

eth0  Link encap:Ethernet HWaddr 00:0C:29:2F:D7:52 
      inet addr:**172.31.44.128** Bcast:172.31.47.255 Mask:255.255.248.0 
      inet6 addr: fe80::20c:29ff:fe2f:d752/64 Scope:Link 
      UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 
      RX packets:15535 errors:0 dropped:0 overruns:0 frame:0 
      TX packets:503 errors:0 dropped:0 overruns:0 carrier:0 
      collisions:0 txqueuelen:1000 
      RX bytes:1099726 (1.0 MiB) TX bytes:38953 (38.0 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:16436 Metric:1 
      RX packets:36 errors:0 dropped:0 overruns:0 frame:0 
      TX packets:36 errors:0 dropped:0 overruns:0 carrier:0 
      collisions:0 txqueuelen:0 
      RX bytes:4098 (4.0 KiB) TX bytes:4098 (4.0 KiB) 

[根@本地〜 ]#more/etc/sysconfig/network

NETWORKING=yes 

NETWORKING_IPV6=yes 

HOSTNAME=localhost.localdomain 

[根@本地〜]#**

more /etc/sysconfig/network-scripts/ifcfg-eth0** 
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) 

DEVICE=eth0 

BOOTPROTO=dhcp 

DHCPCLASS= 

HWADDR=00:0C:29:2F:D7:52 

ONBOOT=yes 

[根@本地〜]#**

more /etc/resolv.conf** 
; generated by /sbin/dhclient-script 

search dhcp.city.country.company 
nameserver 172.31.41.2 
nameserver 172.17.25.22 
nameserver 172.16.25.10 

[根@本地〜]#

**netstat -rn** 

Kernel IP routing table 
Destination  Gateway   Genmask   Flags MSS Window irtt Iface 
172.31.40.0  0.0.0.0   255.255.248.0 U   0 0   0 eth0 
169.254.0.0  0.0.0.0   255.255.0.0  U   0 0   0 eth0 
0.0.0.0   172.31.40.1  0.0.0.0   UG  0 0   0 eth0 

我可以ping我的网关,可以ping我的DNS和代理也:

[根@本地〜]#

ping 172.31.40.1 

PING 172.31.40.1 (172.31.40.1) 56(84) bytes of data. 
64 bytes from 172.31.40.1: icmp_seq=1 ttl=255 time=11.9 ms 
64 bytes from 172.31.40.1: icmp_seq=2 ttl=255 time=1.18 ms 

[[email protected] ~]# ping 172.31.41.2 

PING 172.31.41.2 (172.31.41.2) 56(84) bytes of data. 
64 bytes from 172.31.41.2: icmp_seq=1 ttl=128 time=1.75 ms 
64 bytes from 172.31.41.2: icmp_seq=2 ttl=128 time=0.520 ms 
64 bytes from 172.31.41.2: icmp_seq=3 ttl=128 time=0.580 ms 

[[email protected] ~]# ping ptx.proxy.corp.company 

PING lmarcproxy100.ptx.fr.company (10.7.80.40) 56(84) bytes of data. 
64 bytes from lmarcproxy100.ptx.fr.company (10.7.80.40): icmp_seq=1 ttl=246 time=40.2 ms 
64 bytes from lmarcproxy100.ptx.fr.company (10.7.80.40): icmp_seq=2 ttl=246 time=40.1 ms 
64 bytes from lmarcproxy100.ptx.fr.company (10.7.80.40): icmp_seq=3 ttl=246 time=40.2 ms 
64 bytes from lmarcproxy100.ptx.fr.company (10.7.80.40): icmp_seq=4 ttl=246 time=40.2 ms 

网络接口高达&运行:

[[email protected] ~]# service network status 
Configured devices: 
lo eth0 
Currently active devices: 
lo eth0 

防火墙停止:

[[email protected] ~]# service iptables status 
Firewall is stopped. 
[[email protected] ~]# service ip6tables status 
Firewall is stopped. 

什么?我也可以吃!

但我无法连接到互联网!

在此先感谢您的帮助。

回答

0

尝试ping您的名称服务器IP地址,并尝试ping到您的网关地址。在resolv.conf中禁用搜索...行