linux禁用ipv6
IPv6 is enabled by default on most Linux distros. However, IPv6 is not used for some situations for most of time and it may cause troubles and requires effort to protect the network and ensure the security. This post introduces how to disable IPv6 support on Linux (newer modern Kernel versions).
大多数Linux发行版都默认启用IPv6。 但是,IPv6在大多数情况下不会在某些情况下使用,它可能会引起麻烦,并且需要努力保护网络并确保安全性。 这篇文章介绍了如何在Linux (较新的现代内核版本)上禁用IPv6支持。
First, add these lines to /etc/sysctl.conf:
首先,将这些行添加到/etc/sysctl.conf中:
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1
IPv6 on Linux can be easily configured via sysctrl. To make it take effect, run as root:
Linux上的IPv6可以通过sysctrl轻松配置。 要使其生效,请以root身份运行:
sysctl -p
To verify, check the network interfaces whether IPv6 addresses disappear by ifconfig
.
要进行验证,请通过ifconfig
检查网络接口是否消失了IPv6地址。
You may also check that the kernel variable contains 1:
您还可以检查内核变量是否包含1:
cat /proc/sys/net/ipv6/conf/all/disable_ipv6
The settings are in sysctl.conf and after restarts, Linux will load them and the settings will still take effect.
这些设置位于sysctl.conf中,重新启动后,Linux将对其进行加载,并且这些设置仍将生效。
翻译自: https://www.systutorials.com/disabling-ipv6-on-fedora-17-linux/
linux禁用ipv6