Completely disabling IPv6 in RedHat
I was looking to disable IPv6 across bunch of servers. And not in some adhoc way. This in one of those “note to myself” posts. I was dealing with RedHat 5 and 6 servers.
For RedHat 5:
[root@vm-prd-007 ~]# echo "alias net-pf-10 off" >> /etc/modprobe.conf
[root@vm-prd-007 ~]# echo "options ipv6 disable=1" >> /etc/modprobe.conf
[root@vm-prd-007 ~]# sed -i 's/NETWORKING_IPV6=yes/NETWORKING_IPV6=no/g' /etc/sysconfig/network
[root@vm-prd-007 ~]# /sbin/chkconfig ip6tables off
[root@vm-prd-007 ~]# reboot
…and for RedHat 6:
[root@vm-prd-007 ~]# echo "options ipv6 disable=1" >> /etc/modprobe.d/ipv6.conf
[root@vm-prd-007 ~]# /sbin/chkconfig ip6tables off
[root@vm-prd-007 ~]# reboot
And finally, to check:
[root@vm-prd-007 ~]# lsmod | grep ipv6
[root@vm-prd-007 ~]#