Disabling IPv6 on Linux and Windows VPS

Sometimes when we use a new VPS the server has both IPv4 and IPv6. So because many times an extra IP is a problem and more work, I disable IPv6. Below we will see how it is done…


To disable IPv6 on a VPS, you can use the sysctl command. The best reliable, permanent method depends on your operating system.

See more articles from iGuRu.gr when you search for news on Google.

On Linux VPS (Ubuntu, Debian, CentOS, AlmaLinux)

For a permanent change that is not affected by reboots, add the shutdown parameters to your system configuration.

Connect to your VPS via SSH as root or as a user with sudo privileges.

Open or create a custom sysctl configuration file using a text editor like nano:

sudo nano /etc/sysctl.d/99-disable-ipv6.conf

Add the following lines to completely disable IPv6 on all current and loopback interfaces:

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

Save and close the file (in nano, press Ctrl+x, then y, then Enter).

Apply changes immediately without rebooting:

sudo sysctl --system

Note: If you are using a cloud provider, remember to check your provider's control panel, as some hypervisors (like OVH) may automatically re-enable IPv6 via cloud-init scripts.

For Windows VPS

To completely disable IPv6 in Windows Server, you need to modify the registry.
Connect to your Windows VPS using Remote Desktop.

Open the Start menu, type cmd, right-click Command Prompt, and select Run as administrator.

Run the command below to add the registry value that completely disables IPv6:

reg add HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters /v DisabledComponents /t REG_DWORD /d 0xff /f

Restart your VPS to read the changes.


Google preferences

Leave a Comment

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

Your message will not be published if:
1. Contains insulting, defamatory, racist, offensive or inappropriate comments.
2. Causes harm to minors.
3. It interferes with the privacy and individual and social rights of other users.
4. Advertises products or services or websites.
5. Contains personal information (address, phone, etc.).