How to Disable IPv6 on Ubuntu
Here's how to disable IPv6 on Ubuntu to help you resolve compatibility issues, network configurations, or specific use cases that require IPv6 deactivation.
How to permanently disable IPv6 on Ubuntu
Note : By default, IPv6 is enabled and used in parallel with IPv4.
To disable IPv6 on your Ubuntu system, open a terminal by pressing Ctrl + Alt + T and use the nano editor to open the sysctl configuration file:
sudo nano /etc/sysctl.conf
Now, add the following code to the configuration file to disable IPv6 services:
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1
In the code above:
- The first line disables IPv6 for all network interfaces on the system
- The second line specifically targets the default interface and disables it
- The third line disables IPv6 on the loopback interface, meaning the machine will not use IPV6 for internal communication.
After adding the given code, press Ctrl + O to save changes and exit the editor. Now, apply changes to the system with:
sudo sysctl -p
Restart your network services with:
sudo systemctl restart systemd-networkd
Verify the status of disabled IPv6 services by running:
cat /proc/sys/net/ipv6/conf/all/disable_ipv6
If the output shows a status of "1" , it means IPv6 has been successfully disabled on Ubuntu.
How to temporarily disable IPv6 on Ubuntu
To temporarily disable IPv6 on Ubuntu, run the following systemctl command with the -w option :
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
Now, restart network services with:
sudo systemctl restart systemd-networkd
Therefore, all dependencies will be configured to temporarily disable IPv6 services.
Ubuntu makes controlling IPv6 settings relatively simple, ensuring that you can configure your system's networking behavior to your specific needs. Remember to use this knowledge carefully as IPv6 will continue to play an important role in the global Internet infrastructure.
You should read it
- Disable IPv6 to troubleshoot Internet connectivity issues on Windows computers
- About IPv6 address
- Instructions for configuring IPv6 on Windows Server
- How to transfer IPv4 addresses to IPv6
- How to check IPv6 connection
- How to disable IPv6 rules in UFW to increase firewall security on Linux
- How to secure your VPN more secure?
- How to fix the error IPv6 No Network Access
- Things to know about IPv6 protocol
- 9 things to know when moving to IPv6
- Switching to IPv6 is not easy
- Instructions for configuring RIPng routing protocol for IPv6
Maybe you are interested
How to disable desktop mode in Firefox Android
How to disable custom scroll bars on Microsoft Edge
Why should you disable these 3 settings on your router?
Disable Wi-Fi on These 7 Devices to Boost Privacy
What is UPnP? Why should you disable it on your router?
How to Enable and Disable Tabs in File Explorer on Windows 11