Abh*_*nda 25 ipv6 networking 12.04
我在运行 ssh 和 rsync 的 Ubuntu 机器上禁用了 IPv6。但是这两者仍在侦听 IPv6 地址。我应该如何解决这个问题?
root@box.com:~# sysctl net.ipv6.conf.all.disable_ipv6
net.ipv6.conf.all.disable_ipv6 = 1
root@box.com:~# sysctl net.ipv6.conf.default.disable_ipv6
net.ipv6.conf.default.disable_ipv6 = 1
root@box.com:~# sysctl net.ipv6.conf.lo.disable_ipv6
net.ipv6.conf.lo.disable_ipv6 = 1
Run Code Online (Sandbox Code Playgroud)
和
root@box.com:~# ss -lnp6
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 :::22 :::* users:(("sshd",1505,4))
LISTEN 0 5 :::873 :::* users:(("rsync",3423,5))
Run Code Online (Sandbox Code Playgroud)
boa*_*der 39
这对我有用:
将这些行添加到 sysctl.conf 的底部
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
Run Code Online (Sandbox Code Playgroud)
然后运行sudo sysctl -p
或重启
来源:http : //www.noobslab.com/2012/05/disable-ipv6-if-your-internet-is.html
这当然不会阻止 bind 盲目尝试使用 ipv6,所以你也需要/etc/default/bind9
像这样改变:
# run resolvconf?
RESOLVCONF=yes
# startup options for the server
OPTIONS="-4 -u bind"
Run Code Online (Sandbox Code Playgroud)
来源:http : //blog.evilcoder.net/disable-ipv6-on-bind9-linux/#sthash.U95y4s6U.dpuf
小智 21
要检查 IPv6 是启用还是禁用,请从终端窗口:
$ cat /proc/sys/net/ipv6/conf/all/disable_ipv6
Run Code Online (Sandbox Code Playgroud)
0 表示启用,1 表示禁用。
禁用 IPv6
$ sudo su -
# nano /etc/sysctl.conf
Run Code Online (Sandbox Code Playgroud)
并将这些行添加到 sysctl.conf 文件中
#disable ipv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
Run Code Online (Sandbox Code Playgroud)
使用新配置保存 sysctl.conf 文件,然后重新启动系统
# reboot
Run Code Online (Sandbox Code Playgroud)
再次检查您的系统
$ cat /proc/sys/net/ipv6/conf/all/disable_ipv6
Run Code Online (Sandbox Code Playgroud)
现在你应该看到“1?表示您的系统已禁用 IPv6。
来自http://namhuy.net/1419/disable-ipv6-ubuntu-linux-mint.html