centos 7禁用ipv6

方法一:

修改grub,在引导时就不加载IPV6模块

/etc/default/grub

GRUB_CMDLINE_LINUX="ipv6.disable=1 ..."

grub2-mkconfig -o {grub.cfg 路径}
路径可为:
/boot/grub2/grub.cfg

/boot/efi/EFI/centos/grub.cfg

方法二:
禁用IPV6的操作步骤(不如方法一彻底, 推荐)

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

注意:禁用IPV6后,可能会导致某些服务无法启动,比如VSFTP,对于VSFTP,需要修改/etc/vsftpd/vsftpd.conf文件中的listen和listen_ipv6两个选项:
listen=YES
listen_ipv6=NO

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值