initrd: interpretation of `nameserver=x.x.x.x` dracut kernel cmdline arg
I'm on Fedora CoreOS with NetworkManager-1.20.10-1.fc31.x86_64
. I'm working on switching Fedora CoreOS to using NetworkManager by default. If I have a system with two NICs and I provide a kcmdline like:
nameserver=8.8.8.8 ip=192.168.122.111::192.168.122.1:255.255.255.0:fcos:bond0:none rd.neednet=1 bond=bond0:eth0,eth1:mode=active-backup,miimon=100
I end up in a weird configuration. I'd expect there to be bond0
with eth0
and eth1
as slave devices and then 8.8.8.8
set globally in resolv.conf. However, that doesn't seem to be what happens. I end up with an extra Wired Connection. It seems there are 4 files that are created by nm-initrd-generator
in this scenario (bond0.nmconnection
, default_connection.nmconnection
, eth0.nmconnection
, eth1.nmconnection
).
[core@localhost ~]$ /usr/libexec/nm-initrd-generator -c /tmp/foo/ -- nameserver=8.8.8.8 ip=192.168.122.111::192.168.122.1:255.255.255.0:fcos:bond0:none rd.neednet=1 bond=bond0:eth0,eth1:mode=active-backup,miimon=100
[core@localhost ~]$
[core@localhost ~]$ tail -n 30 /tmp/foo/*
==> /tmp/foo/bond0.nmconnection <==
[connection]
id=bond0
uuid=b9976ddc-59d5-469a-bf63-e60ee0c473ae
type=bond
interface-name=bond0
multi-connect=1
permissions=
[ethernet]
mac-address-blacklist=
[bond]
miimon=100
mode=active-backup
[ipv4]
address1=192.168.122.111/24,192.168.122.1
dhcp-hostname=fcos
dns-search=
may-fail=false
method=manual
[ipv6]
addr-gen-mode=stable-privacy
dhcp-hostname=fcos
dns-search=
method=disabled
[proxy]
==> /tmp/foo/default_connection.nmconnection <==
[connection]
id=Wired Connection
uuid=4797e17e-af3a-4dbb-b6f9-cdbf013aca16
type=ethernet
multi-connect=3
permissions=
[ethernet]
mac-address-blacklist=
[ipv4]
dns=8.8.8.8;
dns-search=
method=auto
[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto
[proxy]
==> /tmp/foo/eth0.nmconnection <==
[connection]
id=eth0
uuid=c11dbca1-c2f5-45b3-9ae3-2b612c0e3a92
type=ethernet
interface-name=eth0
master=b9976ddc-59d5-469a-bf63-e60ee0c473ae
multi-connect=1
permissions=
slave-type=bond
[ethernet]
mac-address-blacklist=
==> /tmp/foo/eth1.nmconnection <==
[connection]
id=eth1
uuid=744d4710-859e-4743-926b-29ba812d859b
type=ethernet
interface-name=eth1
master=b9976ddc-59d5-469a-bf63-e60ee0c473ae
multi-connect=1
permissions=
slave-type=bond
[ethernet]
mac-address-blacklist=
The default_connection.nmconnection
seems to be where the nameserver information is going. I did some man page diving and I did find out that you can specify the dns settings for the interface on the ip=
line as well, so something like this does work:
ip=192.168.122.111::192.168.122.1:255.255.255.0:fcos:bond0:none:8.8.8.8 rd.neednet=1 bond=bond0:eth0,eth1:mode=active-backup,miimon=100
But it seems like nameserver=
is giving unexpected behavior (at least I could not find any documentation about it).
I'm here to ask what we think the users would expect if they did what I did above? Is there any room for improvement here?