Skip to content
Follow
Ubuntu Linux

How to Disable IPv6 on Ubuntu Linux

Richard
Written by
Richard
Jul 10, 2023 Updated Aug 13, 2026 2 min read
How to Disable IPv6 on Ubuntu Linux
How to Disable IPv6 on Ubuntu Linux

Disabling IPv6 on Ubuntu Linux stops your computer from using the newer internet address standard and forces it to use older IPv4 connections instead. IPv6 is the protocol that assigns IP addresses to devices on a network, but it sometimes causes connection drops or slow speeds on certain routers and older hardware running Ubuntu 22.04 LTS.

Turning off IPv6 takes just a few minutes using the network settings menu or the terminal. You can safely turn it off if your home network or internet service provider does not fully support it yet.

⚡ Quick Answer

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

Editing a system configuration file handles the protocol shutdown by telling the kernel to ignore IPv6 traffic.

Run the command below to disable IPv6.

🐧Bash / Shell
sudo bash
echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf

Next, apply your changes by running the command below.

🐧Bash / Shell
sudo sysctl -p

Display your IP address details.

💻Code
ip address show

The terminal output should confirm that IPv6 addresses are no longer bound to the active network interfaces.

💻Code
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

The system configuration update is now complete.

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.

Should I disable IPv6 on Ubuntu?

Disabling the protocol causes no issues if the machine relies exclusively on local addresses (fe80::) rather than active network services. Active global unicast addresses (2000::/3) or unique local addresses (fc00::/7) depend on IPv6 remaining active for proper network connectivity.

How to temporarily disable IPv6 on Linux?

To disable IPv6 temporarily, use `disable_ipv6=1` for immediate effect on current interfaces and as the default for future ones. For persistence across reboots, create `/etc/sysctl.d/99-disable-ipv6.conf`. Apply changes with `sysctl --system`.

Was this guide helpful?

Was this helpful?
Richard

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.

📚 Related Tutorials

How to Turn "Week Numbers" On or Off for Calendar in Ubuntu Linux
Ubuntu Linux How to Turn "Week Numbers" On or Off for Calendar in Ubuntu Linux
How to Install OpenLiteSpeed on Ubuntu Linux
Ubuntu Linux How to Install OpenLiteSpeed on Ubuntu Linux
How to Install Nginx on Ubuntu Linux
Ubuntu Linux How to Install Nginx on Ubuntu Linux
How to Install Ubuntu Linux
Ubuntu Linux How to Install Ubuntu Linux

No comments yet — be the first to share your thoughts!

Leave a Comment

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