2015-10-06 57 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中禁用搜索...行