Completely Disable IPv6 CentOS/RHEL/OEL

Just copy the below lines into a shell as root and your done (optionally reboot if you want to get rid of the ipv6 module as well:

cat >> /etc/sysctl.conf << EOF net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 EOF sysctl -p cat >> /etc/sysconfig/network << EOF NETWORKING_IPV6=no IPV6INIT=no EOF cat >> /etc/modprobe.d/blacklist.conf << EOF blacklist net-pf-10 blacklist ipv6 EOF echo "install ipv6 /bin/true" > /etc/modprobe.d/ipv6_disabled.conf
sed -i -e s/rd_NO_DM/rd_NO_DM\ ipv6.disable=1/ /etc/grub.conf

Leave a Reply

Your email address will not be published.


This site uses Akismet to reduce spam. Learn how your comment data is processed.