IPv6 Web 伺服器無法訪問
我買了一個新的專用伺服器,有 2 個 IPv4 地址和一個 /56 IPv6 子網。當我在專用伺服器上 ping 到我的域名時,我會收到一條消息。但是當我從外面ping通時,什麼也沒有發生。
因此,我通過 IPv6.nl 等進行了測試,除了與我的 Web 伺服器的連接外,一切都很好。測試無法到達我的伺服器。我試圖打開防火牆的埠,但它似乎不起作用。
我的主機名是 cp.hshweb.eu,在專用伺服器 (CentOS6.6) 上執行,並為虛擬主機安裝了 Odin plesk。我可以執行哪些步驟並嘗試使用 IPv6 從外部訪問我的 we 伺服器?
當我重置網路時,我收到以下消息:
[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
最好的辦法是檢查您是否可以從您的伺服器與 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