Debian开启IPv6

发布于 2020-06-19  604 次阅读


在/etc/network/interfaces中添加:

iface eth0 inet6 static
address 2a03:90c0:b5::28
netmask 48
gateway 2a03:90c0:b5::1
autoconf 0
dns-nameservers 2001:4860:4860::8888

其中,网卡接口“eth0”跟文件里已有的IPv4信息保持一致,2-4行根据IP提供商来设置,DNS可更换为任意IPv6 DNS。

修改完成后,保存并重启即可。

禁用IPv6

只需在/etc/sysctl.conf中添加如下两行:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

之后执行:

sysctl -p

便禁用了IPv6。


Love is merely a madness.