中午睡完午觉起来,发现亚马逊上的服务器不能访问了 ssh 连上服务器,发现 ping www.google.com 报无效的 Host 修改了 dns 之后,可以 ping www.google.com,但是发现 wget 和 curl 无法使用了,一直超时
[ec2-user@ip-172-31-14-205 ~]$ wget http://www.google.com --2019-03-09 23:24:00-- http://www.google.com/ Resolving www.google.com (www.google.com)... 172.217.8.196, 2607:f8b0:4009:810::2004 Connecting to www.google.com (www.google.com)|172.217.8.196|:80... failed: Connection timed out. Connecting to www.google.com (www.google.com)|2607:f8b0:4009:810::2004|:80... failed: Network is unreachable.
[ec2-user@ip-172-31-14-205 ~]$ curl www.google.com curl: (7) Failed to connect to www.google.com port 80: Connection timed out
求解,这个问题怎么解决呢
1
ADANMEI OP 这是我的 ip 情况:[ec2-user@ip-172-31-14-205 ~]$ ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc pfifo_fast state UP group default qlen 1000 link/ether 02:c0:f9:f6:d0:1a brd ff:ff:ff:ff:ff:ff inet 172.31.14.205/20 brd 172.31.15.255 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::c0:f9ff:fef6:d01a/64 scope link valid_lft forever preferred_lft forever 这是我的 dns: [ec2-user@ip-172-31-14-205 ~]$ cat /etc/resolv.conf options timeout:2 attempts:5 ; generated by /sbin/dhclient-script search us-east-2.compute.internal nameserver 172.31.0.2 nameserver 8.8.8.8 这是网卡配置: [ec2-user@ip-172-31-14-205 network-scripts]$ cat ifcfg-eth0 DEVICE=eth0 BOOTPROTO=dhcp ONBOOT=yes TYPE=Ethernet USERCTL=yes PEERDNS=yes DHCPV6C=yes DHCPV6C_OPTIONS=-nw PERSISTENT_DHCLIENT=yes RES_OPTIONS="timeout:2 attempts:5" DHCP_ARP_CHECK=no DNS1=172.31.0.2 DNS2=8.8.4.4 |
2
julyclyde 2019-03-10 11:12:57 +08:00
你给 hosts 到哪儿去了?你确认那个 IP 上有网站服务?
|