CentOS 6/7 禁用ipv6

前端之家收集整理的这篇文章主要介绍了CentOS 6/7 禁用ipv6前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

CentOS 6

1、编辑/boot/grub/grub.conf在以下行结尾加上ipv6.disable=1

kernel /vmlinuz-2.6.32-279.el6.x86_64 ro root=UUID=5bd71e9a-7b05-45f8-8928-ce88a2921fa0 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet ipv6.disable=1


2、重启生效


CentOS 7


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

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="ipv6.disable=1 crashkernel=auto rhgb quiet net.ifnames=0"

GRUB_DISABLE_RECOVERY="true"


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

grub2-mkconfig -o /boot/grub2/grub.cfg

Generating grub configuration file ...

Found linux image: /boot/vmlinuz-3.10.0-514.el7.x86_64

Found initrd image: /boot/initramfs-3.10.0-514.el7.x86_64.img

Found linux image: /boot/vmlinuz-0-rescue-17d22e95741e42659fb29b8c611d8b33

Found initrd image: /boot/initramfs-0-rescue-17d22e95741e42659fb29b8c611d8b33.img

done

2、重启生效

原文链接:https://www.f2er.com/centos/375522.html

猜你在找的CentOS相关文章