linux禁用ipv6_如何在现代Linux上禁用IPv6

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值