How can I disable IPv6 on Digital ocean droplet?

July 2, 2017 4.7k views
IPv6

I followed the directions in the tutorial "How To Enable IPv6 for DigitalOcean Droplets". I've decided not to use IPv6 with this droplet and would like to disable it.

1 comment
  • HELL YEAH, thanks a lot for this thread! Spent lots of time telnet-ing, dig-ing etc.
    For anyone with this kind of problems - DO NOT USE digitalocean's IPv6 if you need SMTP in some way. With it enabled your connections will struggle huge speed loss when trying to do
    telnet smtp.gmail.com 465
    openssl s_client -host smtp.yandex.ru -port 465
    And your Swiftmailer (or what you use) will fail with timeout exception. If that looks familiar - use @hansen proposed solution

3 Answers

Why would you want to?

  • One of the reasons why I decided to move back to IPV4 is that Digitalocean blocks all SMTP outgoing connections on port 25 over IPV6. I do regret a lot about switching to IPV6 after I went through a long tutorial here on DO because it consumed me a lot of time just to figure out later that my WordPress site and any other application completely stopped sending emails.

    That's a shame DO haven't solved this issue already. DO should make it clear it'd block all and every connections, protocols and ports need by sendmail, postfix etc.

Hi @digitalocean718

Since you haven't noted what OS you're using, so I'm guessing it's Ubuntu/Debian.
Go and edit this file /etc/network/interfaces.
And remove the IPv6 section that looks similar to this and then reboot the server:

iface eth0 inet6 static
        address primary_ipv6_address
        netmask 64
        gateway ipv6_gateway
        autoconf 0
        dns-nameservers 2001:4860:4860::8844 2001:4860:4860::8888 209.244.0.3

It's not possible to remove the "IPv6" nor "Private Networking" from the droplet via the control panel after it's been activated.
But by removing the configuration, we actually disable the functionality completely.

  • You misunderstand my question. OS is irrelevant. Each droplet has an option in the control panel to enable IPv6. Once you enable it, there is no option to disable it.

    • You didn't read the last part of my comment:
      It's not possible to remove the "IPv6" nor "Private Networking" from the droplet via the control panel after it's been activated.

Is the reboot necessary after updating those IPv6 settings? I have issues with IPv6 and some third party server monitoring software and it is on my production database server. I can't afford to have that server down and setting up a hot-swap or standby server will be time consuming for my very limited needs.

Have another answer? Share your knowledge.