我正在尝试为我的所有接口关闭 IPv6 自动配置(我有 4 个)。我想用
net.ipv6.conf.all.autoconf = 0
Run Code Online (Sandbox Code Playgroud)
在我的 sysctl 配置中(下/etc/sysct.d)但是设置不适用于任何接口,但是对于net.ipv6.conf.all.autoconf它的工作参数,因此运行以下命令:`
sysctl -a | grep "net\.ipv6\.conf" | grep "autoconf"
net.ipv6.conf.all.autoconf = 0
net.ipv6.conf.eth0.autoconf = 1
net.ipv6.conf.eth1.autoconf = 1
net.ipv6.conf.eth2.autoconf = 1
net.ipv6.conf.eth3.autoconf = 1
Run Code Online (Sandbox Code Playgroud)
然后我尝试使用动态设置
sysctl -w net.ipv6.conf.all.autoconf=0
Run Code Online (Sandbox Code Playgroud)
但它的工作。你知道任何解决方法吗?不想一一做的原因(net.ipv6.conf.eth3.autoconf = 0手动),因为有时候我的接口也比较多(只是不是一直连接)