Skip to content
Follow
Ubuntu Linux

How to Disable IPv6 on Ubuntu Linux

Richard
Written by
Richard
Jul 10, 2023 Updated Jun 20, 2026 2 min read
How to Disable IPv6 on Ubuntu Linux
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.

⚡ 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

You can disable IPv6 on Ubuntu using a few different methods, but the easiest way involves changing a system settings file. This guide shows you how to disable IPv6 on Ubuntu by editing the `/etc/sysctl.conf` file, which is a straightforward process for most users.

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 output should show that IPv6 is no longer usable on the machine.

💻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

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.

Should I disable IPv6 on Ubuntu?

If you have no IPv6 addresses other than link-local (fe80::) and no services are using it, it is safe to disable. If you have an IPv6 address in use, such as a global unicast address (2000::/3) or unique local address (fc00::/7), disabling will affect connectivity.

How to temporarily disable IPv6 on Linux?

disable_ipv6=1 for immediate effect on current interfaces and as the default for future interfaces, and create /etc/sysctl. d/99-disable-ipv6. conf for persistence across reboots. Apply 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

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

Leave a Comment

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