ipv6地址显示异常:
inet6 x: x : x:x ::1/64 scope global tentative dadfailed
无法使用命令ping6 这个地址,原因是当另一台主机关闭,但ipv6地址未被删除,并且新主机无法使用此地址时。
为防止这种情况发生:
$ sysctl -a | grep accept_dad #查看physic网卡的值
net.ipv6.conf.all.accept_dad = 0
net.ipv6.conf.default.accept_dad = 0
net.ipv6.conf.eth0.accept_dad = 0
net.ipv6.conf.eth1.accept_dad = 0
net.ipv6.conf.lo.accept_dad = -1
net.ipv6.conf.tun0.accept_dad = -1
net.ipv6.conf.tun1.accept_dad = -1
# 然后将physic网卡的值更改为0
$ sysctl -w net.ipv6.conf.eth0.accept_dad=0
$ sysctl -w net.ipv6.conf.eth1.accept_dad=0
accept_dad的解释如下:
accept_dad - INTEGER
Whether to accept DAD (Duplicate Address Detection).#是否接受DAD(重复地址检测)。
0: Disable DAD #关闭检测
1: Enable DAD (default)#开启检测(默认)
2: Enable DAD, and disable IPv6 operation if MAC-based duplicate
link-local address has been found.#如果发现基于MAC的重复链路本地地址,则禁用IPv6操作。
来自:内核文档中的ip-sysctl.txt