CentOS7彻底关闭IPV6

发表于 LINUX 分类,标签:
[root@template ~]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
[root@template ~]# uname -r
3.10.0-1062.9.1.el7.x86_64

1、查看服务监听的IP中是否有IPv6格式的地址

netstat -tuln

2、编辑/etc/default/grub,在GRUB_CMDLINE_LINUX加上的后面句首加上ipv6.disable=1

netstat -tuln


3、修改完毕后保存,运行grub2-mkconfig -/boot/grub2/grub.cfg重新生成grub.cfg文件。

复制代码
[root@backup bin]#grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-693.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-693.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-73e63ad4010f4d139b807a97a262ccde
Found initrd image: /boot/initramfs-0-rescue-73e63ad4010f4d139b807a97a262ccde.img
done
复制代码

重启系统,查看ip6是否关闭。

 


0 篇评论

发表我的评论