1.)先使用ip a
命令查看网卡名称
root@debian-2gb-hil-1-landers-temp:~# ip a
1: lo:
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0:
link/ether 96:00:02:66:de:7d brd ff:ff:ff:ff:ff:ff
altname enp1s0
inet 5.78.93.255/32 brd 5.78.93.255 scope global dynamic eth0
valid_lft 81114sec preferred_lft 81114sec
2.)编辑/etc/sysctl.conf
,添加或者编辑以下变量:
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
3.)提交sysctl -p
reference:
https://wiki.debian.org/DebianIPv6
https://pa.ci/171.html