All Collections
PureVPN
Linux
How to manually disable IPv6 on Linux
How to manually disable IPv6 on Linux

Here is how to disable IPV6 on Linux.

Updated over a week ago

Want to know how to disable IPV6 on Linux? Here is a easy guide for you to disable IPv6 on linux.

Red Hat distributions

Here are the steps to disable the IPv6 on Red Hat distribution.

  1. Open a terminal window.

  2. Change to the root user.

  3. Type these commands:

    sysctl -w net.ipv6.conf.all.disable_ipv6=1
    sysctl -w net.ipv6.conf.default.disable_ipv6=1
    sysctl -w net.ipv6.conf.tun0.disable_ipv6=1

  4. For enabling IPv6 again you must type the below commands:

    sysctl -w net.ipv6.conf.all.disable_ipv6=0
    sysctl -w net.ipv6.conf.default.disable_ipv6=0
    sysctl -w net.ipv6.conf.tun0.disable_ipv6=0
    sysctl -p

Debian based distributions

Here are the steps to disable the IPv6 on Debian distribution.

  1. Open a terminal window.

  2. Type the below command:

    sudo nano /etc/sysctl.conf

  3. Add the following at the bottom of the file:

    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

  4. Save and close the file.

  5. Reboot the device.

  6. To re-enable IPv6, remove the above lines from /etc/sysctl.conf and reboot the device.

Did this answer your question?