Support Center / How to manually disable IPv6 on Linux

How to manually disable IPv6 on Linux

Proton VPN now offers an official Linux app with graphical user interface and an official Linux CLI. Both these clients have built-in IPv6 leak protection, with no user configuration required.

We recommend using our official Proton VPN apps on Linux. However, it is also possible to manually configure a VPN connection in Linux using the  OpenVPN or IKEv2 VPN protocols.

If using a manual VPN connection, we recommend disabling IPv6. The following solution should work for most Debian-based distros.

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 use Proton VPN on Linux
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.

Comments are closed.

Secure
your internet

Get Proton VPN
Get Proton VPN

For customer support inquiries, please submit the following form for the fastest response:
Support Form

For all other inquiries:
contact@protonvpn.com


-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: OpenPGP.js v4.10.10
Comment: https://openpgpjs.org

xsBNBFiYeeIBCACpwuYcTsACyjQaqY3tOUonokamGZf3VDuLvcA9nQnu4vlB
n1RFFUJa5Pmf2yZ9EjJFSldTl5lreE3tFf53CcZ9wKa1R6aMnN/0VqURJho0
ZTqevQlCvuJ9kKHkDck3Em0/1WWnhDJgabp+fOa5HAHoAvcNy5gVPuexTT/N
wp6QcfB7w+qFhf73s0bcSn5RC+FAYlQxZVFhFtA7/7LthBVatDJrYLYP9XJd
zOZqz9AX0XZwKal25RcVeGHkNKgloo0bTgro4D88MR7saqXFHTRhy3+Wss7c
uqrh0uIkVmqtadoK/rAbqOyFXQ2DlvSMVrEMLUvwlZbC0taqcKDfNA+FABEB
AAHNLWNvbnRhY3RAcHJvdG9udnBuLmNvbSA8Y29udGFjdEBwcm90b252cG4u
Y29tPsLAfwQQAQgAKQUCWJh54wYLCQcIAwIJEN4dfnhhw11TBBUIAgoDFgIB
AhkBAhsDAh4BAA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