Linux – disable IPv6

This article describes how to disable IPv6 functionality in Oracle Linux 5 according to note “How to disable IPV6 on Oracle Linux 5 (Doc ID 1666028.1)


Open terminal as root and execute (1) ifconfig -a |grep inet to see if we have IPv6 enabled.
As you can see we have IPv6 entries assigned to network interfaces. We need to modify few files to disable IPv6.

disable_IPv6_on_Linux_01

First file which should be modified is “/etc/modprobe.conf”
Open terminal as root and execute (1)­ grep -i ipv6 /etc/modprobe.conf

Add line to modprobe.conf file (2) echo "options ipv6 disable=1" >>/etc/modprobe.conf

Now you can check again if changes were written (3) grep -i ipv6 /etc/modprobe.conf

disable_IPv6_on_Linux_02

Next file which must be updated is “/etc/sysconfig/network”
In the same terminal as root execute (1)­ grep -i ipv6 /etc/sysconfig/network

As you can see NETWORKING_IPV6 is set to “yes” value (2). We need to update this to “no” Execute sed command (3) sed -i 's/NETWORKING_IPV6=yes/NETWORKING_IPV6=no/g' /etc/sysconfig/network

Now you can check again if value was updated (4)  grep -i ipv6 /etc/sysconfig/network

disable_IPv6_on_Linux_03

Finally we need to disable IP6 firewall service from all boot modes

Execute command chkconfig ip6tables --list to list current status of service for all boot level modes (1)

Execute command chkconfig ip6tables off to disable starting ip6tables service in all modes (2)
Execute again command chkconfig ip6tables --list to list current status of service for all boot level modes (3)
Restart machine using reboot command to apply changes (4)

disable_IPv6_on_Linux_04
After restart open terminal as root and execute (1) ifconfig -a |grep inet . Now we can see that IPv6 is not presented.
disable_IPv6_on_Linux_05