How to Disable IPv6 on Windows and Linux

On Windows, IPv6 can be disabled using the Registry Editor or PowerShell. Here’s a step-by-step guide to disable it on your Windows machine.

Method 1: Disabling IPv6 via Registry Editor

  1. Open PowerShell as Administrator:
  • Press Win + X and select Windows PowerShell (Admin) or Command Prompt (Admin).
  1. Modify the Registry: Run the following command in PowerShell to add a registry key that disables IPv6 globally:
reg add hklm\system\currentcontrolset\services\tcpip6\parameters /v DisabledComponents /t REG_DWORD /d 0xFF /f

Here’s a breakdown of what this command does:

  • reg add: Adds or modifies a registry key.
  • hklm\system\currentcontrolset\services\tcpip6\parameters: The location in the registry where the change is made.
  • /v DisabledComponents: The name of the registry value being added or modified.
  • /t REG_DWORD: Specifies the type of value being added, in this case, a DWORD (32-bit value).
  • /d 0xFF: The value for the DisabledComponents registry key, which disables all IPv6 interfaces.
  • /f: Forces the operation without prompting for confirmation.
  1. Restart Your System: After running the command, restart your computer to apply the changes.

Method 2: Disabling IPv6 Tunneling

Sometimes, specific tunneling protocols used by IPv6 may need to be disabled for troubleshooting or other reasons. To disable IPv6 tunneling:

  1. Open PowerShell as Administrator: As before, press Win + X, select Windows PowerShell (Admin).
  2. Run the Disable Command: Execute the following command to disable the IPv6 tunneling protocol:
Get-NetAdapterBinding –ComponentID “ms_tcpip6” | Disable-NetAdapterBinding –ComponentID “ms_tcpip6” –PassThru

This command disables the IPv6 binding on the network adapters. The ms_tcpip6 component ID corresponds to IPv6.

  1. Restart the System: As with the previous method, restart the system to finalize the changes.

How to Disable IPv6 on Linux

On Linux systems, disabling IPv6 can be accomplished by modifying the configuration files. Below are the steps to disable IPv6 on Linux.

Method 1: Disabling IPv6 via sysctl.conf

  1. Open the sysctl.conf File: In a terminal window, use your preferred text editor to open the /etc/sysctl.conf file. You’ll need root privileges to make changes to this file:
sudo nano /etc/sysctl.conf
  1. Edit the Configuration File: In the sysctl.conf file, add the following lines to disable IPv6 for all interfaces:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Explanation of the settings:

  • net.ipv6.conf.all.disable_ipv6 = 1: Disables IPv6 on all network interfaces.
  • net.ipv6.conf.default.disable_ipv6 = 1: Ensures that IPv6 is disabled on all future network interfaces.
  • net.ipv6.conf.lo.disable_ipv6 = 1: Disables IPv6 on the loopback interface (localhost).
  1. Save the Changes: After making these changes, save and exit the text editor. For example, in Nano, press CTRL + O to save and CTRL + X to exit.
  2. Apply the Changes: To apply the changes made in the sysctl.conf file, run the following command:
sudo sysctl -p

This will apply the new configuration without needing to restart the system.


Method 2: Disabling IPv6 via Network Manager (for Desktop Systems)

For users running desktop distributions such as Ubuntu or Fedora, the Network Manager can also be used to disable IPv6 on specific network interfaces.

  1. Open Network Settings:
  • Go to your Network Settings (usually found in the system tray or under the settings menu).
  1. Select the Active Network Interface:
  • Choose the network interface (Ethernet or Wi-Fi) on which you want to disable IPv6.
  1. Disable IPv6:
  • In the network settings for that interface, look for the IPv6 Settings tab.
  • Change the Method to Ignore or Disabled to turn off IPv6 for that specific connection.
  1. Save and Exit:
  • Save the changes and restart your network interface or the system to apply the changes.

Verifying IPv6 is Disabled

After following the steps above, it’s important to verify that IPv6 has indeed been disabled on your system. Here’s how to check:

On Windows:

  1. Open Command Prompt and run the following command to check the IPv6 status:
ipconfig
  1. Look for the IPv6 Address under your network adapter settings. If you see an IPv6 address listed, the protocol has not been successfully disabled.You can also run:
netsh interface ipv6 show interface

This will show whether IPv6 is enabled on the network interfaces.

On Linux:

  1. Run the following command to check the network interfaces:
ifconfig
  1. Look for inet6 entries, which represent IPv6 addresses. If there are no inet6 addresses listed, then IPv6 is disabled successfully.
  2. Alternatively, you can use:
ip a

This will display all network interfaces. If you see no IPv6 addresses, it confirms that IPv6 is disabled.


Re-enabling IPv6

If you need to re-enable IPv6 in the future, simply reverse the changes you made.

On Windows:

  1. To undo the registry change, run the following command in PowerShell:
reg delete hklm\system\currentcontrolset\services\tcpip6\parameters /v DisabledComponents /f
  1. Restart your system to apply the changes.

On Linux:

  1. Open the /etc/sysctl.conf file and remove or comment out the lines you added to disable IPv6:
sudo nano /etc/sysctl.conf
  1. Remove or comment out the following lines:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
  1. Save the changes and apply them again with:
sudo sysctl -p
  1. Restart the system if needed.

Conclusion

Disabling IPv6 may be necessary in certain situations, especially for troubleshooting network issues or addressing compatibility concerns with older systems and applications. However, it’s important to remember that IPv6 offers significant advantages and is likely to become the dominant protocol in the future. Therefore, it’s advisable to enable IPv6 again once the underlying issues are resolved.

By following the steps above, you can easily disable IPv6 on both Windows and Linux systems when required and re-enable it when the situation changes.

Previous Article

How to Install and Configure Snipe-IT

Subscribe to our Newsletter! 📬

Subscribe to our email newsletter to get the latest posts delivered right to your email.
Pure inspiration, zero spam ✨