CentOS禁用ipv6
前言
如何禁用ipv6?
实践操作
根本解决办法
修改grub,在引导时就不加载IPV6模块
1 | # vim /etc/default/grub // 第6行添加ipv6.disable=1参数 |
修改内核参数
1 | # cat /proc/sys/net/ipv6/conf/all/disable_ipv6 |
If the output is 0, IPv6 is enabled.
If the output is 1, IPv6 is already disabled.
修改前后ifconfig查看网卡信息区别

完整操作步骤:
Step 1: add this rule in /etc/sysctl.conf : net.ipv6.conf.all.disable_ipv6=1
Step 2: add this rule in /etc/sysconfig/network: NETWORKING_IPV6=no
Step 3: add this setting for each nic X (X is the corresponding number for each nic) in /etc/sysconfig/network-scripts/ifcfg-ethX: IPV6INIT=no
Step 4: disable the ip6tables service : chkconfig ip6tables off
Step 5: Reload the sysctl configuration: sysctl -p or reboot
FQA
注意:禁用IPV6后,可能会导致某些服务无法启动,比如VSFTP,对于VSFTP,需要修改如下设置
1 | vim /etc/vsftpd/vsftpd.conf |
参考资料
https://blog.csdn.net/bluishglc/article/details/41390785
======================================================
希望各位朋友支持一下
- 领取我的阿里云幸运券,谢谢.
- 使用腾讯云资源
- Linode VPS
- 搬瓦工VPS
- 阿里云1888元云产品通用代金券点我
- 阿里云最新活动全民云计算升级-拼团上云更优惠
本文作者:dongsheng
本文地址: https://mds1455975151.github.io/archives/7da246ab.html
版权声明:转载请注明出处!


