linux7下永久关闭ipv6
ipv6.disable=1
[root@ht01 ~]# cat /etc/default/grub GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="resume=/dev/mapper/klas-swap rd.lvm.lv=klas/root rd.lvm.lv=klas/swap rhgb quiet crashkernel=1024M,high" GRUB_DISABLE_RECOVERY="true" GRUB_CMDLINE_LINUX="ipv6.disable=1"
修改grub2
grub2-mkconfig -o /boot/grub2/grub.cfg
重启主机,永久禁用ipv6