Debian 禁用 IPv6

Author Avatar
青枫 2023年01月06日
  • 在其它设备中阅读本文章

1. 编辑 /etc/sysctl.conf 文件

vi /etc/sysctl.conf

2. 添加或者编辑以下变量

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

eth0 为网卡名称,需要根据实际情况修改

3. 按 ESC 键,再敲 :wq 保存退出

4. 重载系统参数使设置生效

sysctl -p