Linux How-To

Methods to Disable IPv6 on Ubuntu Linux


Are you on the lookout for a strategy to disable IPv6 connections in your Ubuntu machine? On this article, I’ll train you precisely methods to do it and why you’ll think about this feature. I’ll additionally present you methods to allow or re-enable IPv6 in case you modify your thoughts.

What’s IPv6 and why would you wish to disable IPv6 on Ubuntu?

Web Protocol model 6 (IPv6) is the newest model of the Web Protocol (IP), the communications protocol that gives an identification and placement system for computer systems on networks and routes visitors throughout the Web. It was developed in 1998 to exchange the IPv4 protocol.

IPv6 goals to enhance safety and efficiency, whereas additionally ensuring we don’t run out of addresses. It assigns distinctive addresses globally to each system, storing them in 128-bits, in comparison with simply 32-bits utilized by IPv4.

Disable IPv6 UbuntuDisable IPv6 UbuntuDisable IPv6 Ubuntu

Though the purpose is for IPv4 to get replaced by IPv6, there’s nonetheless a protracted strategy to go. Lower than 30% of the websites on the Web makes IPv6 connectivity out there to customers (tracked by Google right here). IPv6 also can trigger issues with some functions at time.

Since VPNs present international providers, the truth that IPv6 makes use of globally routed addresses (uniquely assigned) and that there (nonetheless) are ISPs that don’t provide IPv6 help shifts this characteristic decrease down their precedence checklist. This fashion, they will give attention to what issues essentially the most for VPN customers: safety.

One other attainable motive you would possibly wish to disable IPv6 in your system is just not wanting to reveal your self to varied threats. Though IPv6 itself is safer than IPv4, the dangers I’m referring to are of one other nature. For those who aren’t actively utilizing IPv6 and its options, having IPv6 enabled leaves you susceptible to varied assaults, providing the hacker one other attainable exploitable device.

On the identical be aware, configuring fundamental community guidelines is just not sufficient. You need to pay the identical stage of consideration to tweaking your IPv6 configuration as you do for IPv4. This may show to be fairly a trouble to do (and likewise to take care of). With IPv6 comes a collection of issues completely different to these of IPv4 (lots of which will be referenced on-line, given the age of this protocol), giving your system one other layer of complexity.

Steered learn  How To Simply Improve Linux Kernel In Ubuntu And Linux Mint

Disabling IPv6 on Ubuntu [For Advanced Users Only]

On this part, I’ll be overlaying how one can disable IPv6 protocol in your Ubuntu machine. Open up a terminal (default: CTRL+ALT+T) and let’s get to it!

Be aware: For many of the instructions you’ll enter within the terminal you’ll want root privileges (sudo).

If you’re a daily desktop Linux person and like a secure working system, please keep away from this tutorial. That is for superior customers who know what they’re doing and why they’re doing so.

1. Disable IPv6 utilizing Sysctl

Initially, you may test you probably have IPv6 enabled with:

ip a

It is best to see an IPv6 tackle whether it is enabled (the title of your web card is likely to be completely different):

Ipv6 Address UbuntuIpv6 Address UbuntuIPv6 Deal with Ubuntu

You may have see the sysctl command within the tutorial about restarting community in Ubuntu. We’re going to use it right here as nicely. To disable IPv6 you solely should enter three instructions:

sudo sysctl -w web.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w web.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w web.ipv6.conf.lo.disable_ipv6=1

You may test if it labored utilizing:

ip a

It is best to see no IPv6 entry:

Ipv6 Disabled UbuntuIpv6 Disabled UbuntuIPv6 Disabled Ubuntu

Nevertheless, this solely quickly disables IPv6. The following time your system boots, IPv6 might be enabled once more.

One methodology to make this feature persist is modifying /and so forth/sysctl.conf. I’ll be utilizing vim to edit the file, however you should utilize any editor you want. Be sure to have administrator rights (use sudo):

Sysctl ConfigurationSysctl ConfigurationSysctl Configuration

Add the next strains to the file:


For the settings to take impact use:

sudo sysctl -p

If IPv6 remains to be enabled after rebooting, you could create (with root privileges) the file /and so forth/rc.native and fill it with:

# /and so forth/rc.native

/and so forth/sysctl.d
/and so forth/init.d/procps restart

exit zero

Now use chmod command to make the file executable:

sudo chmod 755 /and so forth/rc.native

What this may do is manually learn (throughout the boot time) the kernel parameters out of your sysctl configuration file.

Steered learn  Methods to Create a Slideshow of Photographs in Ubuntu 18.04

2. Disable IPv6 utilizing GRUB

Another methodology is to configure GRUB to go kernel parameters at boot time. You’ll should edit /and so forth/default/grub. As soon as once more, be sure you have administrator privileges:

GRUB ConfigurationGRUB ConfigurationGRUB Configuration

Now you want to modify GRUB_CMDLINE_LINUX_DEFAULT and GRUB_CMDLINE_LINUX to disable IPv6 on boot:

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash ipv6.disable=1″

Save the file and run:

sudo update-grub

The settings ought to now persist on reboot.

Re-enabling IPv6 on Ubuntu

To re-enable IPv6, you’ll should undo the adjustments you made. To allow IPv6 till reboot, enter:

sudo sysctl -w web.ipv6.conf.all.disable_ipv6=zero
sudo sysctl -w web.ipv6.conf.default.disable_ipv6=zero
sudo sysctl -w web.ipv6.conf.lo.disable_ipv6=zero

In any other case, in the event you modified /and so forth/sysctl.conf you may both take away the strains you added or change them to:


You may optionally reload these values:

sudo sysctl -p

It is best to as soon as once more see a IPv6 tackle:

Ipv6 Address Ubuntu 1Ipv6 Address Ubuntu 1IPv6 Reenabled in Ubuntu

Optionally, you may take away /and so forth/rc.native:

sudo rm /and so forth/rc.native

For those who modified the kernel parameters in /and so forth/default/grub, go forward and delete the added choices:


Now do:

sudo update-grub

Wrapping Up

On this information I supplied you methods in which you’ll disable IPv6 on Linux, in addition to supplying you with an concept about what IPv6 is and why you’ll wish to disable it.

Did you discover this text helpful? Do you disable IPv6 connectivity? Tell us within the remark part!

Source link

Related Articles

Back to top button