![IPv6 Web 服务器无法访问](https://linux22.com/image/660893/IPv6%20Web%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%97%A0%E6%B3%95%E8%AE%BF%E9%97%AE.png)
我购买了一台新的专用服务器,它有 2 个 IPv4 地址和一个 /56 IPv6 子网。当我在专用服务器上 ping 域名时,我会收到一条消息。但是当我从外部 ping 时,什么也没有发生。
所以我通过 IPv6.nl 等进行了测试,除了与我的 Web 服务器的连接外,一切都很好。测试无法访问我的服务器。我尝试打开防火墙的端口,但似乎不起作用。
我的主机名是 cp.hshweb.eu,运行在专用服务器 (CentOS6.6) 上,虚拟主机安装了 Odin plesk。我可以采取哪些步骤,尝试使用 IPv6 从外部访问我的服务器?
当我重置网络时,我收到此消息:
[root@cp network-scripts]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0:
Determining IP information for eth0... done.
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
Determining if ip address 85.214.148.249 is already in use for device eth0...
[ OK ]
ip addr show 显示以下内容:
[root@cp ~]# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 40:61:86:ee:be:3f brd ff:ff:ff:ff:ff:ff
inet 85.214.208.177/32 brd 85.214.208.177 scope global eth0
inet 85.214.148.249/32 brd 85.214.148.249 scope global eth0:1
inet6 2a01:238:4317:d800:cafe:dead:beef:0/128 scope global
valid_lft forever preferred_lft forever
inet6 2a01:238:4317:d800::feed/128 scope global
valid_lft forever preferred_lft forever
inet6 2a01:238:4317:d800::/56 scope global
valid_lft forever preferred_lft forever
inet6 2a01:238:4317:d800:0:bad:a55:cafe/128 scope global
valid_lft forever preferred_lft forever
inet6 2a01:238:4317:d800:d108:898c:628f:a199/128 scope global
valid_lft forever preferred_lft forever
inet6 fe80::4261:86ff:feee:be3f/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 40:61:86:ee:be:40 brd ff:ff:ff:ff:ff:ff
这是我的 ifcfg-eth0 文件:
DEVICE="eth0"
BOOTPROTO="dhcp"
DHCPV6C="no"
IPV6INIT="yes"
IPV6_AUTOCONF="no"
IPV6_ROUTER="yes"
NM_CONTROLLED="no"
ONBOOT="yes"
HWADDR=40:61:86:EE:BE:3F
IPV6ADDR="2a01:238:4317:d800:d108:898c:628f:a199/128"
IPV6ADDR_SECONDARIES="2a01:238:4317:d800:0:bad:a55:cafe/128 2a01:238:4317:d800::/56 2a01:238:4317:d800::feed/128 2a01:238:4317:d800:cafe:dead:beef:0/128 2a01:238:4317:d800:d108:898c:628f:a199/128 2a01:238:4317:d800::feed/128 2a01:238:4317:d800:0:bad:a55:cafe/128 2a01:238:4317:d800:cafe:dead:beef:0/128 2a01:238:4317:d800:d108:898c:628f:a199/128 2a01:238:4317:d800::/0"
IPV6_DEFAULTGW=2a01:238:4317:d800::1
IPV6FORWARDING=yes
我的网络配置是:
HOSTNAME=cp.domain.tld
NETWORKING=yes
NETWORKING_IPV6=yes
IPV6_DEFAULTDEV=eth0
IPV6FORWARDING=yes
IPV6_AUTOCONF=no
IPV6_AUTOTUNNEL=no
IPV6_DEFAULTGW=2a01:238:4317:d800::1
ip-6路由:
[root@cp ~]# ip -6 route
::/96 via :: dev sit0 metric 256 mtu 1480 advmss 1420 hoplimit 4294967295
unreachable ::/96 dev lo metric 1024 error -101 mtu 65536 advmss 65476 hoplimit 4294967295
unreachable ::ffff:0.0.0.0/96 dev lo metric 1024 error -101 mtu 65536 advmss 65476 hoplimit 4294967295
unreachable 2002:a00::/24 dev lo metric 1024 error -101 mtu 65536 advmss 65476 hoplimit 4294967295
unreachable 2002:7f00::/24 dev lo metric 1024 error -101 mtu 65536 advmss 65476 hoplimit 4294967295
unreachable 2002:a9fe::/32 dev lo metric 1024 error -101 mtu 65536 advmss 65476 hoplimit 4294967295
unreachable 2002:ac10::/28 dev lo metric 1024 error -101 mtu 65536 advmss 65476 hoplimit 4294967295
unreachable 2002:c0a8::/32 dev lo metric 1024 error -101 mtu 65536 advmss 65476 hoplimit 4294967295
unreachable 2002:e000::/19 dev lo metric 1024 error -101 mtu 65536 advmss 65476 hoplimit 4294967295
2a01:238:4317:d800::feed dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295
2a01:238:4317:d800:0:bad:a55:cafe dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295
2a01:238:4317:d800:cafe:dead:beef:0 dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295
2a01:238:4317:d800:d108:898c:628f:a199 dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295
2a01:238:4317:d800::/56 dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295
unreachable 3ffe:ffff::/32 dev lo metric 1024 error -101 mtu 65536 advmss 65476 hoplimit 4294967295
fe80::/64 dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295
default via 2a01:238:4317:d800::1 dev eth0 metric 1 mtu 1500 advmss 1440 hoplimit 4294967295
Ping 到 google 返回:
[root@cp ~]# ping6 ipv6.google.com -c 6
PING ipv6.google.com(ham02s13-in-x07.1e100.net) 56 data bytes
From 2a01:238:4317:d800:cafe:dead:beef:0 icmp_seq=2 Destination unreachable: Address unreachable
From 2a01:238:4317:d800:cafe:dead:beef:0 icmp_seq=3 Destination unreachable: Address unreachable
From 2a01:238:4317:d800:cafe:dead:beef:0 icmp_seq=4 Destination unreachable: Address unreachable
From 2a01:238:4317:d800:cafe:dead:beef:0 icmp_seq=5 Destination unreachable: Address unreachable
From 2a01:238:4317:d800:cafe:dead:beef:0 icmp_seq=6 Destination unreachable: Address unreachable
--- ipv6.google.com ping statistics ---
6 packets transmitted, 0 received, +5 errors, 100% packet loss, time 15001ms
答案1
最好的办法是检查您是否可以从服务器与 IPv6 站点(例如 ipv6.google.com)通信。这将帮助您确定问题是本地配置还是 IPv6 连接 - 如果您可以 ping 远程 IPv6 站点,则问题可能是防火墙或 HTTP 守护程序,但如果不能,则问题在于连接。
您有一个可路由的地址。因此,这可能是您的主机或传输提供商的问题,或者是其他地方的路由问题。
值得一提的是,在撰写本文时,我无法从我的 HE.net 隧道 ping 您的服务器。
鉴于更新的信息,我记得我遗漏了其他一些内容。如果您已明确配置了地址(即它不是由 RA 自动配置的),由于该地址是助记符并且我在您的静态配置中看到它,因此它可能只是不知道其网关配置。配置它的方式取决于您的发行版,但它应该就在您配置 IP 的位置旁边。
对于您自己,您只需要在 ifcfg-eth0 中添加一行:
IPV6_DEFAULTGW=2a01:238:4317:d800::1
如果地址不同,请用正确的网关替换该地址。检查您ping6
是否也可以使用该地址 ping 该网关。
奇怪的是,您的发行版似乎也没有为您配置的静态地址添加本地网络路由(因此,它找不到网关)。因此,您需要将其添加到/etc/sysconfig/network-scripts/route6-eth0
:
2a01:238:4317:d800::/56 dev eth0