Is there a way to disable ipv6 in NetworkManager by default?

Hi all,
is there a way to make NetworkManager fire up with ivp6 disabled. Currently whenever I am connecting to a new WIFI-Network ipv6 is set to automatic. I´d rather have it disabled when connecting.
I tried to tinker with the NetworkManager.conf and included the following:

[connection]
ipv6.method=disable

Unfortunately it did not do the trick. I am using debian12-template for my qube holding the wifi adapter.

1 Like

hi,

you could use this command to completely disable IPv6 in the qube.

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
2 Likes

For good measure, run also:

sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1

(this stops IPv6 from being enabled on further interfaces that may appear, e.g. a USB dongle ).

2 Likes

Thanks! I think it’s that sysctl I was looking for initially, there are so many of them about IPv6 :sweat:

2 Likes

An easier way would be to use kernelopts to disable ipv6 completely. No change to the original template is required:

qvm-prefs sys-net kernelopts ipv6.disable=1
3 Likes

DVM´s solution seems the way to go - works very smoothly. Networkmanager does not show ipv6 in the interface anymore although it is still set to “automatic” in the ipv6 section. Unfortunately solene´s and barto´s solution do not achieve the desired effect. The Networkmanager still shows an ipv6 for the interface.

4 Likes