Question

How can I disable IPv6 on an Ubuntu 13 VM?

  • Posted October 15, 2013

I added blacklist ipv6 to /etc/modprobe.d/blacklist.conf and GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 console=ttyS0" to /etc/default/grub and rebooted but I’m still seeing IPv6 interfaces. Docker has an issue where if it sees ipv6 interfaces it won’t bind to any ipv4 ones.

Is there any way I can disable ipv6 on digital ocean?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Ah, that’s better…

Sigh, why have I got that name displayed?

Nope: <br> <br>ifconfig | grep inet <br> inet addr:xx.xx.xx.xx Bcast:95.85.45.255 Mask:255.255.255.0 <br> inet6 addr: fexx::xxx:xxxx:xxxx:xxx/64 Scope:Link <br> inet addr:127.0.0.1 Mask:255.0.0.0 <br>

Try running the following commands: <br> <br><pre>echo net.ipv6.conf.lo.disable_ipv6 = 1 | sudo tee -a /etc/sysctl.conf</pre> <br> <br>and then rebooting your droplet.

I started a new VM and I can see the IPv6 interfaces: <br> <br># ifconfig | grep inet <br> inet addr:192.241.137.243 Bcast:192.241.137.255 Mask:255.255.255.0 <br> inet6 addr: fe80::e01:9ff:feae:8301/64 Scope:Link <br> inet addr:127.0.0.1 Mask:255.0.0.0 <br> inet6 addr: ::1/128 Scope:Host <br> <br>But /etc/network/interfaces isn’t showing any parameters that could be removed and disable IPv6: <br> <br># cat /etc/network/interfaces <br># This file describes the network interfaces available on your system <br># and how to activate them. For more information, see interfaces(5). <br> <br># The loopback network interface <br>auto lo <br>iface lo inet loopback <br> <br># The primary network interface <br>auto eth0 <br>iface eth0 inet static <br> address 192.241.137.243 <br> netmask 255.255.255.0 <br> gateway 192.241.137.1 <br> dns-nameservers 8.8.4.4 <br>

Have you tried deleting the IPv6 interface from <code>/etc/network/interfaces</code> via <code>sudo vi /etc/network/interfaces</code>; followed by <code>i</code> making the edits; finally saving your changes by typing <code>Esc</code>; <code>:</code>; <code>w</code>; <code>q</code>; <code>Enter</code>? <br> <br>Then, restarting networking via <code>/etc/init.d/networking restart</code>. <br> <br>P.S. I realize you prob. know how to use <code>vi</code>; I added all the excruciating detail in the event a n00b stumbles across this thread in the future.

This is probably easier to read than the original steps I described: <br> <br>$ echo ‘blacklist ipv6’ >> /etc/modprobe.d/blacklist.conf <br>$ echo ‘GRUB_CMDLINE_LINUX_DEFAULT=“ipv6.disable=1 console=ttyS0”’ >> /etc/default/grub <br>$ update-grub <br>$ reboot

For the record, I also tried the following and it didn’t work: <br> <br>echo ‘1’ > /proc/sys/net/ipv6/conf/lo/disable_ipv6
<br>echo ‘1’ > /proc/sys/net/ipv6/conf/lo/disable_ipv6
<br>echo ‘1’ > /proc/sys/net/ipv6/conf/all/disable_ipv6
<br>echo ‘1’ > /proc/sys/net/ipv6/conf/default/disable_ipv6 <br>/etc/init.d/networking restart <br> <br>I’m using the #350076 Ubuntu 13.04 x64 image on NYC2.