How To Disable IPv6 Support of Ubuntu

October 2016

The new IPv6, or Internet Protocol version 6 brings forth a number of fixes to Linux's IPv4 protocol, including an updated architectural structure, additional addresses per person, smaller routing tables, and mobile IP.

Despite this new protocol's growing popularity, some users may decide that they want to disable IPv6 in order to address troubleshooting issues. While this is not recommended, if you are keen on doing so, there are methods that are much more safe and effective for your computer. Here's how to disable IPv6 on Ubuntu.

How To Disable IPv6

Before performing any operation, we recommend educating yourself as much as possible regarding IPv6 and your internet connections.

Please note that disabling IPv6 (which is now a mandatory part of Windows Vista, as well as some later Windows operating systems) may cause some applications to function improperly. Also note that, unlike other protocols, you cannot disable IPv6 by disabling the protocol on each of your network interfaces.

To disable IPv6 support under Ubuntu, open your terminal and edit the /etc/sysctl.conf file by typing:

net.ipv6.conf.all.disable_ipv6=1  
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1

Adding these lines will disable IPv6 support in loopback, a default for all available etc interfaces. Next, reboot the network interfaces by entering:

/etc/init.d/networking restart

This code will modify the following files by changing the contents from 0 to 1:

/proc/sys/net/ipv6/conf/lo/disable_ipv6  
/proc/sys/net/ipv6/conf/all/disable_ipv6
/proc/sys/net/ipv6/conf/default/disable_ipv6

Here are the commands:

echo '1' > /proc/sys/net/ipv6/conf/lo/disable_ipv6  
echo '1' > /proc/sys/net/ipv6/conf/lo/disable_ipv6
echo '1' > /proc/sys/net/ipv6/conf/all/disable_ipv6
echo '1' > /proc/sys/net/ipv6/conf/default/disable_ipv6

Blacklisting IPV6

To disable IPv6 support in Ubuntu, edit the file /etc/modprobe.d/blacklist by making the following edits to command line
gksu gedit /etc/modprobe.d/blacklist.conf
.

First, add
blacklist ipv6
to the end of the line, and then reboot your system.

To ensure that IPv6 is disabled, type
ip a | grep inet6
into a terminal. If this command returns nothing, it means that IPv6 is disabled.

Disable IPv6 on Ubuntu 9.10

Ubuntu 9.10 users can disable IPv6 via a grub command.

Insert
gksu gedit /etc/default/grub
.

Next, change the line
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
to read
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 quiet splash"
.

Next, update
sudo update-grub
.

Sources: Help.Ubuntu.com and http://ftbeowulf.wordpress.com/... FT Beowulf.

Related :

This document entitled « How To Disable IPv6 Support of Ubuntu » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.