Centos 7 IPV6“崩溃”

Centos 7 IPV6“崩溃”

我不太确定从哪里开始调试这个问题,真心希望有人能给我指出正确的方向。我花了很多时间四处搜索,但考虑到事情似乎只持续了几个小时/几天,这并没有真正取得成果。

但简而言之,根据 ping6 日志显示,IPV6 似乎在我的 Centos 7 系统上在有限的时间内运行良好:

PING ipv6.google.com(par21s05-in-x0e.1e100.net (2a00:1450:4007:812::200e)) 56 data bytes
64 bytes from par21s05-in-x0e.1e100.net (2a00:1450:4007:812::200e): icmp_seq=1 ttl=58 time=0.830 ms
64 bytes from par21s05-in-x0e.1e100.net (2a00:1450:4007:812::200e): icmp_seq=2 ttl=58 time=0.863 ms
64 bytes from par21s05-in-x0e.1e100.net (2a00:1450:4007:812::200e): icmp_seq=3 ttl=58 time=0.856 ms

--- ipv6.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 0.830/0.849/0.863/0.036 ms

然后出于某种原因,几个小时或几天后无论我尝试什么,都无法让 IPv6 工作,直到我从终端重新启动机器(使用“rebo​​ot”命令),然后一切都会在有限的时间内再次工作,然后需要重复该过程。

我使用的主机设置 IPv6 的原始指南在这里 (https://documentation.online.net/en/dedicated-server/network/ipv6/prefix) - 忽略 Dibbler 警告,因为我不使用它。碰巧我以前用过,我可以证明它比当前解决方案的工作时间更短。

我的机器详细信息如下;

         Icon name: computer
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-693.5.2.el7.x86_64
      Architecture: x86-64

希望有人自己遇到过这个问题并且可以建议一个更好的解决方案,而不需要我设置 cron 来每天重启系统?

编辑原始帖子以添加额外信息:

我不知道有任何防火墙限制(除非 IPv6 有特定限制),但是,为了解决这个问题,我禁用了 IP 表和 Centos 防火墙,以尝试排除这些限制。它们已启用,如下所示。

我所知道的路由信息​​:

首先,当它不工作的时候。

root > ping6 ipv6.google.com
PING ipv6.google.com(par21s05-in-x0e.1e100.net (2a00:1450:4007:812::200e)) 56 data bytes
--- ipv6.google.com ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 3999ms



root > route
Kernel IP routing table
Destination     Gateway             Genmask         Flags Metric Ref    Use Iface
default         62-210-***-***.rev  0.0.0.0         UG    100    0        0 eth0
62.210.***.0    0.0.0.0             255.255.255.0   U     100    0        0 eth0



root > route -6
Kernel IPv6 routing table
Destination                    Next Hop                   Flag Met Ref Use If
[::]/96                        [::]                       !n   1024 0     0 lo
0.0.0.0/96                     [::]                       !n   1024 0     0 lo
<MY HOSTNAME>/56               [::]                       U    256 0     0 eth0
2002:a00::/24                  [::]                       !n   1024 0     0 lo
2002:7f00::/24                 [::]                       !n   1024 0     0 lo
2002:a9fe::/32                 [::]                       !n   1024 0     0 lo
2002:ac10::/28                 [::]                       !n   1024 0     0 lo
2002:c0a8::/32                 [::]                       !n   1024 0     0 lo
2002:e000::/19                 [::]                       !n   1024 0     0 lo
3ffe:ffff::/32                 [::]                       !n   1024 0     0 lo
gateway/128                    [::]                       U    100 0     2 eth0
fe80::/64                      [::]                       U    256 1    47 eth0
[::]/0                         gateway                    UG   100 1    23 eth0
[::]/0                         [::]                       !n   -1  1    81 lo
localhost/128                  [::]                       Un   0   9  1157 lo
<MY HOSTNAME>/128              [::]                       Un   0   5     8 lo
<MY HOSTNAME>/128              [::]                       Un   0   2     8 lo
ff00::/8                       [::]                       U    256 5   224 eth0
ff00::/8                       [::]                       U    256 0     0 eth1
[::]/0                         [::]                       !n   -1  1    81 lo



root > ip route
default via 62.210.***.*** dev eth0 proto static metric 100
62.210.***.***/24 dev eth0 proto kernel scope link src 62.210.***.*** metric 100

现在它可以正常工作了(两者之间的唯一区别是我已经重新启动了服务器)

root > ping6 ipv6.google.com
PING ipv6.google.com(par21s05-in-x0e.1e100.net (2a00:1450:4007:812::200e)) 56 data bytes
64 bytes from par21s05-in-x0e.1e100.net (2a00:1450:4007:812::200e): icmp_seq=1 ttl=58 time=0.808 ms
64 bytes from par21s05-in-x0e.1e100.net (2a00:1450:4007:812::200e): icmp_seq=2 ttl=58 time=0.863 ms
64 bytes from par21s05-in-x0e.1e100.net (2a00:1450:4007:812::200e): icmp_seq=3 ttl=58 time=0.867 ms
64 bytes from par21s05-in-x0e.1e100.net (2a00:1450:4007:812::200e): icmp_seq=4 ttl=58 time=0.869 ms
?
--- ipv6.google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 0.808/0.851/0.869/0.043 ms



root > route
Kernel IP routing table
Destination     Gateway             Genmask         Flags Metric Ref    Use Iface
default         62-210-***-***.rev  0.0.0.0         UG    100    0        0 eth0
62.210.***.0    0.0.0.0             255.255.255.0   U     100    0        0 eth0



root > route -6
Kernel IPv6 routing table
Destination                    Next Hop                   Flag Met Ref Use If
[::]/96                        [::]                       !n   1024 0     0 lo
0.0.0.0/96                     [::]                       !n   1024 0     0 lo
<MY HOSTNAME>/56 [::]                       U    256 0     0 eth0
2002:a00::/24                  [::]                       !n   1024 0     0 lo
2002:7f00::/24                 [::]                       !n   1024 0     0 lo
2002:a9fe::/32                 [::]                       !n   1024 0     0 lo
2002:ac10::/28                 [::]                       !n   1024 0     0 lo
2002:c0a8::/32                 [::]                       !n   1024 0     0 lo
2002:e000::/19                 [::]                       !n   1024 0     0 lo
3ffe:ffff::/32                 [::]                       !n   1024 0     0 lo
gateway/128                    [::]                       U    100 0    10 eth0
fe80::/64                      [::]                       U    256 0     4 eth0
[::]/0                         gateway                    UG   100 11   752 eth0
[::]/0                         [::]                       !n   -1  1   777 lo
localhost/128                  [::]                       Un   0   13 15498 lo
<MY HOSTNAME>/128 [::]                       Un   0   13   241 lo
<MY HOSTNAME>/128 [::]                       Un   0   4    12 lo
ff00::/8                       [::]                       U    256 10  2254 eth0
ff00::/8                       [::]                       U    256 0     0 eth1
[::]/0                         [::]                       !n   -1  1   777 lo



root > ip route
default via 62.210.***.*** dev eth0 proto static metric 100
62.210.***.***/24 dev eth0 proto kernel scope link src 62.210.***.*** metric 100

现在适用的配置文件

/etc/dhcp/dhclient6.conf

interface "eth0" {
   send dhcp6.client-id <MY DUID - This was provided by the host>;
}

/etc/systemd/system/dhclient.service

[Unit]
Description=dhclient for sending DUID IPv6
Wants=network.target
Before=network.target

[Service]
Type=forking
ExecStart=/usr/sbin/dhclient -cf /etc/dhcp/dhclient6.conf -6 -P -v eth0

[Install]
WantedBy=multi-user.target

/etc/sysconfig/网络脚本/ifcfg-eth0

# Generated by parse-kickstart
UUID="2688a41f-e07a-****-****-************"
DNS1="62.210.***.***"
BOOTPROTO="static"
DEVICE="eth0"
ONBOOT="yes"
TYPE=Ethernet
IPADDR="62.210.***.***"
PREFIX=24
GATEWAY="62.210.***.***"
NETMASK="255.255.255.0"
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT="yes"
IPV6ADDR="2001:bc8:****:***::/56" 
IPV6_AUTOCONF=yes
NAME="System eth0" 

相关内容