2017-04-12 159 views
2

我在windows上使用virtualbox中的centos7。流浪漢做了它,用http或https獲得ping錯誤。也捲曲。有人可以幫助我如何解決並讓它工作。ping:http://google.com:名稱或服務未知

[[email protected] ~]# ping google.com 
PING google.com (61.91.161.217) 56(84) bytes of data. 
64 bytes from chatenabled.mail.google.com (61.91.161.217): icmp_seq=1 ttl=43 time=404 ms 
64 bytes from chatenabled.mail.google.com (61.91.161.217): icmp_seq=2 ttl=43 time=408 ms 
64 bytes from chatenabled.mail.google.com (61.91.161.217): icmp_seq=3 ttl=43 time=407 ms 
64 bytes from chatenabled.mail.google.com (61.91.161.217): icmp_seq=4 ttl=43 time=408 ms 
^C 
--- google.com ping statistics --- 
5 packets transmitted, 4 received, 20% packet loss, time 4000ms 
rtt min/avg/max/mdev = 404.297/407.234/408.956/1.887 ms 
[[email protected] ~]# ping https://google.com 
ping: https://google.com: Name or service not known 
[[email protected] ~]# ping https://61.91.161.217 
ping: https://61.91.161.217: Name or service not known 

`

的resolv.conf

[[email protected] ~]# cat /etc/resolv.conf 
nameserver 10.0.2.3 
nameserver 8.8.8.8 
nameserver 8.8.4.4 
search localhost 

`

的ifconfig

[[email protected] ~]# ifconfig 
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 
     inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255 
     inet6 fe80::5054:ff:fe73:fb1 prefixlen 64 scopeid 0x20<link> 
     ether 52:54:00:73:0f:b1 txqueuelen 1000 (Ethernet) 
     RX packets 610587 bytes 48453952 (46.2 MiB) 
     RX errors 0 dropped 0 overruns 0 frame 0 
     TX packets 468759 bytes 41290880 (39.3 MiB) 
     TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 
     inet 192.168.33.10 netmask 255.255.255.0 broadcast 192.168.33.255 
     inet6 fe80::a00:27ff:fe0e:ae16 prefixlen 64 scopeid 0x20<link> 
     ether 08:00:27:0e:ae:16 txqueuelen 1000 (Ethernet) 
     RX packets 3069145 bytes 2674132747 (2.4 GiB) 
     RX errors 0 dropped 0 overruns 0 frame 0 
     TX packets 2531212 bytes 213727091 (203.8 MiB) 
     TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 

網絡文件自動從流浪

創建
[[email protected] ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 
NAME="eth0" 
ONBOOT=yes 
NETBOOT=yes 
UUID="704aa015-53dd-4ba7-9689-b9b8bf6e09a5" 
IPV6INIT=yes 
BOOTPROTO=dhcp 
TYPE=Ethernet 
DEFROUTE=yes 
IPV4_FAILURE_FATAL=no 
IPV6_AUTOCONF=yes 
IPV6_DEFROUTE=yes 
IPV6_FAILURE_FATAL=no 
PEERDNS=yes 
PEERROUTES=yes 
IPV6_PEERDNS=yes 
IPV6_PEERROUTES=yes 
HWADDR=52:54:00:73:0f:b1 
DNS1=8.8.8.8 
[[email protected] ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1 
NM_CONTROLLED=no 
BOOTPROTO=none 
ONBOOT=yes 
IPADDR=192.168.33.10 
NETMASK=255.255.255.0 
DEVICE=eth1 
PEERDNS=no 
DNS1=8.8.8.8 

回答

1

平無關與HTTP或HTTPS:

平將使用ICMP協議,它屬於TCP/IP

平通過發送互聯網控制消息協議(ICMP)回送請求分組進行操作到目標主機並等待ICMP響應。

其實ping的工作水平比HTTP或HTTPS低得多,只接受主機名,而不接受URL。

+0

」實際上ping的工作級別比HTTP或HTTPS低得多,只接受主機名,而不接受URL。「是的。同意。不可能更簡潔。 –

2

首先確保您的虛擬機設置中啓用了網絡適配器。

您用於連接到互聯網的網絡接口可能不是主動的。

  1. 要檢查這一點,使用 「須藤nmcli d」 命令。

  2. 如果它斷開,用「須藤nmtui」 - >編輯連接,選擇您的網絡界面,選擇‘自動連接’選項(通過 按下空格鍵),然後選擇確定。

  3. 「sudo reboot now」登錄後,執行「ping www.google.com」。

您應該能夠立即連接。 「

相關問題