CentOS7徹底關閉IPV6


參考博文:http://www.mamicode.com/info-detail-2171992.html  按該博文操作,無錯誤。

環境:

[root@backup ~]#cat /etc/redhat-release 
CentOS Linux release 7.4.1708 (Core) 
[root@backup ~]#uname -r
3.10.0-693.el7.x86_64

 

1、查看服務監聽的IP中是否有IPv6格式的地址

netstat -tuln

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

 

ipv6.disable=1

 

3、修改完畢后保存,運行grub2-mkconfig -o /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是否關閉。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM