Updated: December 18, 2024
I don't like IPv6, for many reasons. In the home environment, it brings zero value. But I can tolerate it, and usually don't go too much out of my way to disable it (but I still do). My dislike has gone to eleven recently, though. Why? Well, a kernel update (specifically the ipv6 module) botched my productivity on two laptops, one Slimbook Titan and one Slimbook Executive. In both cases, the culprit was, it seems, the IPv6 code.
Well, this prompted me to completely disable the protocol and functionality on my two Kubuntu 22.04 systems. On its own, this was an annoying ordeal, because it's not very easy. I had to add a GRUB parameter AND blacklist a kernel module to stop IPv6 issues. This is Windows-level hack0ring to stop something that used to take a single sysctl directive in a not-so-distant past. But there's more. Since, even though IPv6 is disabled in the boxen, Network Manager still tries to set IPv6 addresses, nonstop, spamming the system log. This article will show you, with focus on Plasma, how to stop the noise. Follow me.
Problem in more detail
So, IPv6 is disabled, but the system log shows these messages:
NetworkManager[1203]: <warn> [] platform-linux: do-add-ip6-address[]: failure 95 (Operation not supported)
Now, this does not happen once when you obtain a new DHCP lease from an access point. Nope. Network Manager tries to obtain IPv6 addresses all the time, in a permanent and pointless loop, despite the fact the relevant connectivity is disabled on the system. So there isn't a basic of sanity checks or any sort of reasonable logic for obtaining the address or for timing out in case of a failure.
Furthermore, there is no global switch in the Plasma Network Manager settings to disable IPv6. You can only do this per network, as I will shortly show you in the solutions section below. To wit, let me show you all the different methods to stop Network Manager from spamming your logs.
Workaround 1: Temporary fix
On the command line, you can use the Network Manager utility (nmcli) to stop the noise. This will only work while you're connected to the network. Switch to a different access point, or disconnect/reconnect, you will need to repeat the operation.
nmcli d modify [device] ipv6.method "disabled"
For example:
nmcli d modify wlp114s0 ipv6.method "disabled"
Workaround 2: Per-network disablement
Open the (Plasma) Network Management popup in the system area, and click on the Settings icon, or go there through Settings directly. Here, you will have a list of all your networks. Choose any one, then click on the IPv6 tab, and under Method, select Disabled. This will stop Network Manager from trying to obtain IPv6 addresses for the particular access point (network). If you have multiple networks, even different 2.4GHz and 5GHz names for the same router, you will need to do this for each one separately. Very tedious. Also, if you're already connected, you will need to reconnect to stop the log noise.
Workaround 3: Per-network disablement (command line)
I also want to show you what happens under the hood. In a terminal window, with the right permissions, navigate to the following folder:
/etc/NetworkManager/system-connections
Here, you will see a list of all of your different networks (that you ever connected to). It should correspond to the saved list of networks you see in the sidebar in (Plasma) Settings. Open any one of these files in a text editor, and check its contents. There will be a bunch of directives in there. Add, to the bottom of each file, the following text:
[ipv6]
addr-gen-mode=stable-privacy
method=disabled
Save, exit, connect or reconnect to the network. This is equivalent to what we did above via GUI.
Solution: Disable IPv6 in Network Manager
We're still on the command line. The global configuration for Network Manager lives under:
/etc/NetworkManager/NetworkManager.conf
Open this file. Paste the [ipv6] block from above here, save, reconnect to your desired network. Now, you won't need to set any per-network workaround, and there will be no IPv6 address assignments to your Linux hosts, which can't work anyway, as the protocol is completely disabled and blacklist. No more log noise.
Conclusion
I find it rather sad that modern Linux systems have become the opposite of the UNIX KISS principle. Today, you need to fiddle with so much stuff to do simple, basic things. This is not that different from Windows, which exposes only basic things to the end user, but then forces you to make registry changes or such. What's the point of making IPv6 management so convoluted? So people wouldn't disable it? Or is this simply bad design throughout?
A logical design would be a simple toggle - just one, and once it's activated, that's it, the user does not need to become a Linux expert to solve a pointless problem in their system. You might say, you need to be an expert to understand this domain to begin with, sure, but then, if so, I would expect my systems to always be perfectly stable and not have random freezes, crashes or similar due to randomly introduced kernel changes or any which zero-QA system update. But that's modern software. Break things ... and that's it. No other goal. Noise. Well, hopefully, I helped you solve another pointless issue. Take care, and see you around.
Cheers.