How to Disable IPv6 on Ubuntu Linux
You disable IPv6 on Ubuntu Linux by editing its network configuration settings.
IPv6 is the latest version of the Internet Protocol, designed to provide a massive number of unique IP addresses, succeeding the older IPv4 system. Most modern operating systems, including Ubuntu Linux, enable it by default.
You might want to disable IPv6 on your Ubuntu 22.04 LTS system if you’re experiencing network compatibility issues with older hardware or specific applications.
Following these steps will help you turn off IPv6, potentially resolving connectivity problems and ensuring your system uses the most compatible network protocol for your environment.
Disable IPv6 by adding ‘net.ipv6.conf.all.disable_ipv6 = 1’ to /etc/sysctl.conf. Apply changes with ‘sudo sysctl -p’. Verify with ‘ip address show’.
Disable IPv6
There are multiple ways to disable IPv6 on Ubuntu. However, the simplest way is to disable it in the [/etc/sysctl.conf] file.
Run the command below to disable IPv6.
sudo bash
echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
Next, apply your changes by running the command below.
sudo sysctl -p
Display your IP address details.
ip address show
The output should show that IPv6 is no longer usable on the machine.
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:0c:29:bc:b2:46 brd ff:ff:ff:ff:ff:ff
altname enp2s1
inet 192.168.156.130/24 brd 192.168.156.255 scope global dynamic noprefixroute ens33
valid_lft 1716sec preferred_lft 1716sec
That should do it!
Conclusion:
- Disabling IPv6 on Ubuntu Linux can enhance compatibility with older applications and network infrastructures that do not support it.
- This process is straightforward and can be accomplished with a few simple commands.
- Users can easily revert the changes if they decide to enable IPv6.
- Verifying the IP address details is essential to ensure that IPv6 is effectively disabled.
- Always back up configuration files before making changes to prevent unintended network issues.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
No comments yet — be the first to share your thoughts!