突然间,我无法 ping 具有 IPv6 地址的域。我运行以下命令:
ping google.com
但我没有看到任何返回的内容...它只是返回了这个:
PING google.com(iad30s15-in-x0e.1e100.net (2607:f8b0:4004:807::200e)) 56 data bytes
仅此而已。我按 CTRL+C 取消,结果出现以下信息:
--- google.com ping statistics ---
7 packets transmitted, 0 received, 100% packet loss, time 6125ms
我可以 ping IPv4 地址。我没有做任何防火墙更改。这台机器上发生的唯一变化是通常的 apt-get 更新和重新启动。
这是我的防火墙设置:
sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
To Action From
-- ------ ----
80,443/tcp (Apache Full) ALLOW IN Anywhere
22/tcp (OpenSSH) ALLOW IN Anywhere
25/tcp (Postfix) ALLOW IN Anywhere
22 ALLOW IN Anywhere
80,443/tcp (Apache Full (v6)) ALLOW IN Anywhere (v6)
22/tcp (OpenSSH (v6)) ALLOW IN Anywhere (v6)
25/tcp (Postfix (v6)) ALLOW IN Anywhere (v6)
22 (v6) ALLOW IN Anywhere (v6)
我的 /etc/hosts/ 文件:
cat /etc/hosts
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
网络配置:
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
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP
group default qlen 1000
link/ether bc:76:4e:20:2c:c3 brd ff:ff:ff:ff:ff:ff
inet 104.239.249.27/24 brd 104.239.249.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 2001:4802:7806:102:be76:4eff:fe20:12b6/64 scope global
valid_lft forever preferred_lft forever
inet6 2001:4802:7805:103:be76:4eff:fe20:2ccd/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::be76:4eff:fe20:2cc3/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether bc:76:4e:20:2c:f5 brd ff:ff:ff:ff:ff:ff
inet 10.209.160.56/19 brd 10.209.191.255 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::be76:4eff:fe20:2cf5/64 scope link
valid_lft forever preferred_lft forever
ip -6 route 的输出:
ip -6 route
2001:4802:7805:103::/64 dev eth0 proto kernel metric 256 pref medium
2001:4802:7806:102::/64 dev eth0 proto kernel metric 256 pref medium
fe80::/64 dev eth1 proto kernel metric 256 pref medium
fe80::/64 dev eth0 proto kernel metric 256 pref medium
default via fe80::def dev eth0 metric 1024 pref medium
traceroute6 的输出:
traceroute6 google.com
traceroute to google.com (2607:f8b0:4004:82f::200e) from
2001:4802:7806:102:be76:4eff:fe20:12b6, 30 hops max, 24 byte packets
1 * * *
2 * * *
3 * * *
答案1
我这边可以 ping 2001:4802:7805:103:be76:4eff:fe20:2ccd,但无法 ping 2001:4802:7806:102:be76:4eff:fe20:12b6。后一个地址显然用作传出连接的源地址(如 traceroute 所示)。
这个设置有问题。
您可以尝试从配置中删除有问题的地址,并检查这是否有帮助:
ip -6 addr del 2001:4802:7806:102:be76:4eff:fe20:12b6 dev eth0
或者类似的东西,我记不清了。