I have a networking-related question.
On Fedora I’m trying to configure network settings so that:
- Nameservers are always 1.1.1.1 and 1.0.0.1
- IPv6 is always disabled.
To achieve #1, I added the following to /etc/NetworkManager/NetworkManager.conf
:
[main]
dns=none
Then I create /etc/resolv.conf
with the following contents:
nameserver 1.1.1.1
nameserver 1.0.0.1
options edns0
So far so good, everything is working as expected.
To achieve #2, I added the following to /etc/sysctl.conf
:
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1
net.ipv6.conf.enp0s31f6.disable_ipv6=1
net.ipv6.conf.wlp0s20f3.disable_ipv6=1
Then I add the ipv6.method=disabled
to /etc/NetworkManager/NetworkManager.conf
so it looks like this:
[main]
dns=none
[ipv6]
method=disabled
Then check that IPv6 is disabled:
❯ ip addr | grep inet6
Which returns nothing as expected.
But now when I connect to a wifi network, IPv6 is being enabled automatically by NetworkManager:
❯ ip addr | grep inet6
inet6 <redacted>/128 scope global dynamic noprefixroute
inet6 <redacted>/64 scope global dynamic noprefixroute
inet6 <redacted>/64 scope link noprefixroute
I want to prevent NetworkManager from enabling IPv6 so that IPv6 always remains disabled. Any suggestions?
Edit to add: I know it is possible to use the Gnome GUI to disable IPv6 on existing connections, but what I’m looking for is a way to disable IPv6 for all existing connections and future connections so that NetworkManager does not re-enable it for new connections.