Return to protonvpn.com Facebook   Twitter   Reddit   Instagram   Mastodon   ProtonMail
Support Center / How to disable the IPv6 on Linux

How to disable the IPv6 on Linux

This proposed solution is for Debian-based distributions. We recommend disabling IPv6 if you are using a manual VPN connection, such as OpenVPN.

1) Open Terminal and enter the command sudo nano /etc/sysctl.conf

2) Add all the lines to the bottom of the file and save it:

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

3) Now make the system read the file and confirm the changes using this line:

sudo sysctl -p

That’s it! In order to check whether IPv6 was disabled on your computer, you can do an IPv6 leak test here.

Related articles:

How to disable IPv6 on Windows
How to disable IPv6 on macOS

Post Comment

16 comments

  1. Robin S. Hicks

    I’ve found that the following method, for improving DNS privacy in Firefox, solves the VPN leakage problem without disabling IPv6, but I believe that this only works for Firefox.
    https://blog.nightly.mozilla.org/2018/06/01/improving-dns-privacy-in-firefox/

  2. ProtonVPN Team

    Hello Robin, thank you for pointing this out, this does help but only for few of our customers in our experience, so we hope that someone will find your comment helpful!

  3. Robin S. Hicks

    The only problem I’ve found with this method (Running Ubuntu 18.04). Is that after every restart, you have to rerun the ‘sudo sysctl -p’ command to initialize the disabling of IPv6, otherwise the system just falls back to enabling IPv6.

  4. genn

    Hi,
    I added those 4 lines to /etc/sysctl.conf but after I run “sudo sysctl -p” I get this error:
    cannot stat /proc/sys/net/ipv6/conf/tun0/disable_ipv6: no such file or directory.
    How can I resolve? Thanks

  5. ProtonVPN Team

    Hello Glenn, first of all, are you sure you are leaking ipv6 requests? Please contact our customer support team with detailed information about your current device. https://protonvpn.com/support-form

  6. FrustdUsr

    After execute this command “sudo sysctl -p” my Linux Mint Sylvia is telling me this:
    “net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    net.ipv6.conf.lo.disable_ipv6 = 1
    sysctl: can’t execute stat on /proc/sys/net/ipv6/conf/tun0/disable_ipv6: file or directory doesn’t exist”

    How can i fix this?

  7. ProtonVPN Team

    Hello, tun0 is the network interface for the VPN. If you do not have VPN on or installed, it could be that its not able to locate it. If you are leaking the IPV6 addresses, just try to test the connection again now after doing those commands.

  8. Terance

    Hello!
    After i edited the sysctl.conf file and run the cli tool I get this message:
    [!] This is an error in enabling ipv6 on the machine. Please enable it manually.
    Which is a abit confusing?

  9. ProtonVPN Team

    Hello Terance, could you please run the command sudo protonvpn-cli -init ? if that does not help and you are sure that you are using OpenVPN credentials, please contact our customer support team – https://protonvpn.com/support-form

  10. kullanici

    r
    I could not connect ProtonVPN because I got this error:

    Connecting …
    [!] Error connecting to VPN.
    [!] There are issues in managing IPv6 in the system. Please test the system for the root cause.
    Not being able to manage IPv6 by protonvpn-cli might cause issues in leaking the IPv6 address

    I still can not connect when I apply the method described here. I’m warning you:

    Connecting …
    [!] Error connecting to VPN.
    [!] This is an error in enabling ipv6 on the machine. Please enable it manually

    I’m using Linux Mint 18.3

  11. ProtonVPN Team

    Hello, Could you please try running sudo protonvpn-cli -init and make sure you are using your OpenVPN credentials from your account page on ProtonVPN.com , if that does not help, please contact our customer support team. https://protonvpn.com/support-form

  12. bashroot

    Lewis is correct (just tested it on my 17.10 machine).
    For anyone running ubuntu 17.10: You have to run
    sudo sysctl -p
    after the sysctl.conf file has been edited and saved in order for the ipv6 settings to take effect.

  13. ProtonVPN Team

    Hello,
    Thank you for pointing that out, we will add it to the article, even though we were not able to replicate it. If you spot anything else or have any improvement suggestions, feel free to let us know!

  14. Lewis

    Just wanted to comment that I tried this, but I still got 10/10 ‘readiness score’ for IPv6 on the test you linked to. Kubuntu 17.10.

  15. ProtonVPN Team

    Hello Lewis,

    Could you please provide more detailed information and attached screenshots of few sites like http://www.ipleak.net and http://www.ipv6leak.com to our support https://protonvpn.com/support-form ?

  16. Lewis

    Hello, ProtonVPN Team,

    About the failure to stop IPv6, there’s really little to say or show, other than that I got test results showing me my actual IPv6 address (in my ISP country), while my IPv4 test result was that of the VPN tunnel exit location.

    I have, however, found the following solution, via this AskUbuntu thread: https://askubuntu.com/questions/309461/how-to-disable-ipv6-permanently

    Add the following lines to /etc/sysctl.conf
    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    net.ipv6.conf.lo.disable_ipv6 = 1
    Then run
    sudo sysctl -p
    to “enable” the new settings, I guess. This seems to have taken care of all my VPN leakage.
    In addition, I’ve been in the network settings, under IPv6 tab, and set Method > Ignored. Dunno if this made any difference, but there it is.

    I hope you’ll have a look into this, and update the guide if you as well find it to be a working solution, and not just a lucky strike by me.

Leave a Reply

Your email address will not be published. Required fields are marked *

Don't find your answer? We're happy to help you!     Contact Our Support Team

Secure Your Internet Today

Get ProtonVPN