How to Disable IPv6 on Ubuntu Linux

This article outlines how to disable IPv6 on Ubuntu Linux, which is enabled by default. It recommends disabling IPv6 when network infrastructure or applications do not support it. The simplest method involves modifying the /etc/sysctl.conf file and executing specific commands to apply the changes. The user can then verify that IPv6 is disabled.

This article explains how to disable IPv6 on Ubuntu Linux.

IPv6, or Internet Protocol Version 6, is the most recent version of the Internet Protocol (IP), used for identifying network devices through an addressing system. It was developed to replace IPv4, which has limited addresses.

IPv6 is automatically enabled on Ubuntu Linux. You can disable it with a single command if you do not want to use it.

Disabling IPv6 on Ubuntu may be recommended in certain situations, like when your network infrastructure or applications do not support IPv6. Some users report that specific applications behave better with IPv4, especially if they are not fully optimized for IPv6.

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.

Comments

Leave a Reply

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