前言
最近发现青龙面板上的自动签到,每过4天就会提示签到失败,错误提示则是 ETIMEDOUT
通过 systemctl restart NetworkManager
重启网络后,IPv6 恢复正常
通过查看路由器日志,发现每次报错前一天下午的五点半左右,运营商会重新拨号,导致 IPv6 地址变化
Feb 19 17:34:29 pppd[585]: local LL address fe80::49ee:1ba4:67a7:2c72
Feb 19 17:34:29 pppd[585]: remote LL address fe80::0200:5eff:fe00:010b
Feb 19 17:34:29 pppd[585]: local IP address 100.67.115.194
Feb 19 17:34:29 pppd[585]: remote IP address 100.67.112.1
Feb 23 17:34:59 pppd[585]: local LL address fe80::29d6:8887:0c1a:1848
Feb 23 17:34:59 pppd[585]: remote LL address fe80::0200:5eff:fe00:0104
Feb 23 17:34:59 pppd[585]: local IP address 100.67.59.117
Feb 23 17:34:59 pppd[585]: remote IP address 100.67.56.1
Feb 27 17:35:18 pppd[585]: local LL address fe80::b905:473d:0b68:ecf9
Feb 27 17:35:18 pppd[585]: remote LL address fe80::0200:5eff:fe00:0107
Feb 27 17:35:19 pppd[585]: local IP address 100.67.120.191
Feb 27 17:35:19 pppd[585]: remote IP address 100.67.120.1
同时,使用 ip -6 address show
查看报错时的 IPv6 地址,发现地址仍为重新拨号前的地址,且租期未到期,不能获取到新的地址,导致 IPv6 无法使用
inet6 240e:xxxx:xxxx:xxxx::xxxx/64 scope global temporary dynamic
valid_lft 599843sec preferred_lft 86343sec
解决方案
默认情况下,IPv6 的租期较长,当运营商重新拨号后,客户端没能及时更新 IPv6 地址。因此我们只需要将 IPv6 设置为有状态 (Stateful),同时将租期设置的短一些即可解决 IPv6 自动掉线的问题