
Debian 10 how to turn IPv6 on and off
Debian way to turn on and off IPv6
Check if the system has ipv6 kernel loaded
lsmod | grep ipv6
Return data similar to the following, it means that the ipv6 kernel is loaded
1
2
3
4
5
6
nf_reject_ipv6 16384 1 ip6t_REJECT
nf_log_ipv6 16384 5
nf_conntrack_ipv6 20480 8
nf_defrag_ipv6 16384 1 nf_conntrack_ipv6
nf_log_common 16384 2 nf_log_ipv6,nf_log_ipv4
nf_conntrack 114688 8 nf_conntrack_ipv6,nf_conntrack_ftp,nf_conntrack_ipv4,nf_conntrack_broadcast,nf_nat_ftp,nf_conntrack_netbios_ns,xt_conntrack,nf_nat
Check if there is an IPv6 address
1
2
3
ifconfig
ip address list
netstat -anptl
Command to temporarily close ipv6
1
2
sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1
Temporarily open the ipv6 command
1
2
sysctl -w net.ipv6.conf.all.disable_ipv6=0
sysctl -w net.ipv6.conf.default.disable_ipv6=0
Permanently shut down the system ipv6
1
2
3
4
5
6
7
8
echo " ">>/etc/sysctl.conf
echo "# made for disabled IPv6 in $(date +%F)">>/etc/sysctl.conf
echo 'net.ipv6.conf.all.disable_ipv6 = 1'>>/etc/sysctl.conf
echo 'net.ipv6.conf.default.disable_ipv6 = 1'>>/etc/sysctl.conf
echo 'net.ipv6.conf.lo.disable_ipv6 = 1'>>/etc/sysctl.conf
tail -5 /etc/sysctl.conf
sysctl -p
netstat -anptl
Or edit the system kernel configuration file
1
2
3
4
vi /etc/sysctl.conf //编辑系统内核文件,添加以下代码
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
Open the system's ipv6 permanently, and change the 1 in the above code to 0. . .
View system ipv6 status command
1
2
cat /proc/sys/net/ipv6/conf/all/disable_ipv6
cat /proc/sys/net/ipv6/conf/default/disable_ipv6
Return 0 to enable, 1 to disable ipv6
💘 相关文章
- How to turn off ubuntu's IPv6
- Debian系统设置ipv4优先或者ipv6优先
- debian 10單網卡添加多個IPv6地址的方法
- Debian 10 开启和关闭Ipv6的方法
- debian/ubuntu系统删除docker虚拟网桥
- ubuntu/Debian出现 libcrypto.so.1.1: cannot open shared object file:的解决方法
- 亲测可用debian 9添加多ip实例的方法
- 更改或设置debian时区的方法
- Debian 12 one-click installation of Broadcom network card
- 在ubuntu和Debian系统单网卡绑定多个IP v6地址的方法