To disable iPv6 on Ubuntu 14.0.4 (LTS) I added these lines in sysctl.conf file:

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

Since I was getting 0, when I used the command:

$ cat /proc/sys/net/ipv6/conf/all/disable_ipv6

As informed here, I followed the steps given. When I tried to use:

sudo sysctl -p

I'm getting an output in the Terminal as:

sysctl: cannot stat /proc/sys/net/ipv6/conf/disable_ipv6: No such file or directory
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

I have checked the directory and found that the file/directory is present.

Additional information: I'm trying to install Apache Hadoop (ver. 2.7.2) in my system. Though all the services are up and running, I am unsure if it will work with my network configuration. Since it is informed (here) that Hadoop doesn't work well with iPv6 connection, so I tried to run:

sudo sed -i 's/net.ipv6.bindv6only\ =\ 1/net.ipv6.bindv6only\ =\ 0/' \/etc/sysctl.d/bindv6only.conf && sudo invoke-rc.d procps restart

When I do this, I get a message:

sed: can't read /etc/sysctl.d/bindv6only.conf: No such file or directory

**There is no such file in the directory when I searched manually.

up vote 0 down vote accepted

The only thing you need to do, if you really want to do this, is to see to that the inet6 module isn't loaded when the computer reboots.

Just try this (as root user).

$ cat >/etc/modprobe.d/blacklist-ipv6.conf <<EOF
# Turn of IPv6 by blacklisting the module.
# Even though it isn't needed.
blacklist ipv6

EOF
$

But really, you shouldn't need to do this. As long as you don't have a IPv6 network in your LAN, it will not interfere with your IPv4 net.

Don't forget to remove those changes you have added to /etc/sysctl.conf.

  • 1
    I guess I will leave it like that since it is working fine for now. If problem arises then will go through this. – Mr. Hobo Mar 24 '16 at 18:00
  • That sounds like an ok choice. But I would still recommend that you don't stop IPv6. And as I wrote, the simplest and secure way to turn off IPv6 is to just remove and blacklist the module ipv6. – Anders Mar 26 '16 at 22:24

The Hadoop page you linked to is really not saying that IPv6 will cause you problems. What it is saying will cause you problems is if you turn off IPv4 and try to use IPv6 instead.

So, your goal shouldn't be to get rid of IPv6. It should be to leave IPv4 working.

Now, the page does mention a configuration option that they recommend setting. It has to do with how Hadoop would register with the OS to listen for incoming requests. Ubuntu gives you the option to register to listen for only IPv4 connections, only IPv6, or both.

Some (older, I'm pretty sure) versions of Debian (which Ubuntu is based on) thought they would try to help apps with the transition, and changed some settings with how what listening setup would work. That setting is what the wiki page you mentioned is referring to. To turn it off, you just need to put the following in the /etc/sysctl.conf file:

net.ipv6.bindv6only = 0

and while you are there, remove the lines:

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

Then run sysctl -p and you should be all set.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.