Skip to main content
All CollectionsVPSVPS Management
How to disable IPv6 on Linux distributions
How to disable IPv6 on Linux distributions
Updated over a week ago

Although we advise against permanently disabling IPv6 on your VPS, temporarily turning off the protocol can be helpful for troubleshooting network issues. This guide explains how to disable IPv6 on your VPS.

Red Hat-based Linux Distributions

If you’re using a Red Hat-based system, follow these steps to disable IPv6:

  • Login to your VPS using ssh root@your-vps-ip or enter your VPS using the browser terminal.

  • Enter the following 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

To enable IPv6 again, use these 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 Linux Distributions

For Debian-based systems, here’s how to disable IPv6:

  • Open a terminal using the same methods as mentioned previously.

  • Run the following command to edit the configuration file:

sudo nano /etc/sysctl.conf
  • Add these lines to 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
  • Save the changes by pressing CTRL X, then Y and Enter to close the file.

  • Reboot your device.

To re-enable IPv6, simply delete the lines you added to /etc/sysctl.conf and reboot your system.

Did this answer your question?