How to disable IPv6 address on Ubuntu 18.04 Bionic Beaver Linux - LinuxConfig.org

Whether you are running Ubuntu 18.04 desktop or server the IPv6 network addresses are enabled by default. In most of the cases this default setting can be simply ignored. However, in case that you need to disable the IP version 6 network protocol on your Ubuntu 18.04 Desktop or Server this tutorial we help you to do just that.
This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-disable-ipv6-address-on-ubuntu-18-04-bionic-beaver-linux

It’s a bit older topic, but still some people choose to use Ubuntu 18.04.
For a friend I installed a 18.04 server today, but decided to go back to 16.04 because it was not possible to disable IPV6 the way described in the article.

I tried 2 times. First time I got errors when using update-grub, which was logical because the raid build was still running. After the reboot, the server never came back online.

So I installed totally fresh, waited until raid building (raid 5) was ready, then entered the ipv6.disable=1 in Grub as mentioned.
This time the update-grub gave no errors at all.
So I rebooted. But again the server never came back online.

Via a rescue system from the datacenter I was able to have a look, and the lines where present correctly in Grub, no typo present, the lines read as should be.

To prevent this maybe in the future. Do you or anyone else have any clue why the server would not get back online after making this change?

Do mind I can’t check things anymore, as said my friend decided to use 16.04 with which we had no issues disabling ipv6. But it might be nice to know what could be causing this out of technical curiosity or maybe in case we would like to do this later again with another 18.04 of 20.x version.

Hi BlackTiger,

Welcome to our forums.

It is hard to say what the problem was with the system in question without details about it. What do you mean by not coming back online? Not booting at all, or just not bringing up networking?

Thank you for the welcome.
I’m not 100% sure but as far as I could see it wouldn’t boot anymore. But at least network wasn’t up anymore.
I’ve read all over the internet and on some site I found something about a conflict with netplan being enabled. Because netplan was the new system.
They advised to either use netplan to disable ipv6 or install the old if-up system and uninstall netplan and then use the Grub.

Since I had this issue and had to disable ipv6, I used the netplan option to disable ipv6 which worked very good.

Well, if you disable ipv6 from kernel command line, but netplan expects it to be available on boot, it makes sense that netplan would not bring up the network altogether, which I would say is a bugged behavior.

That is correct. As from the site I’ve found where this was mentioned, there also somebody said that this would point out another netplan bug.

But it’s good to know.
So if people read this howto and want to do this, they can read that this is a possibility and the solution is to either use netplan to disable ipv6, or remove netplan and use the if-up system, before booting.
So they can prevent running into the same issue.