Issues with disabling iPv6 on Ubuntu 14.0.4

8,851

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.

Share:
8,851

Related videos on Youtube

Mr. Hobo
Author by

Mr. Hobo

Happy-Go-Lucky person trying my hands on Linux!

Updated on September 18, 2022

Comments

  • Mr. Hobo
    Mr. Hobo almost 2 years

    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.

  • Mr. Hobo
    Mr. Hobo over 8 years
    I guess I will leave it like that since it is working fine for now. If problem arises then will go through this.
  • Anders
    Anders about 8 years
    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.