Hello. I posted this in matermost channel but no one anwered, so I’m posting here.
I’m trying to configure a second interface in a Rocky Linux 9 LXC container (LXD/Incus). I’ve defined the second interface as macvlan in the container profile, and I want it to get an ip address from my router. I did this before in an Ubuntu container just configuring my second interface in netplan conf file, but I don’t know how to do it with NetworkManager.
[root@r1 ~]# nmcli dev
DEVICE TYPE STATE CONNECTION
eth1 ethernet connected Wired connection 1
lo loopback connected (externally) lo
eth0 macvlan unmanaged --
[root@r1 ~]# nmcli con
NAME UUID TYPE DEVICE
Wired connection 1 c659e992-2e24-3a83-94c0-b5ac07fb0185 ethernet eth1
lo 328f7a75-52de-4883-a35e-50eef576e153 loopback lo
System eth0 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 ethernet --
tried
[root@r1 ~]# nmcli con modify "System eth0" connection.interface-name eth0
[root@r1 ~]# nmcli con up "System eth0"
Error: Connection activation failed: No suitable device found for this connection (device eth1 not available because profile is not compatible with device (mismatching interface name)).
Thank you for your find. The last comment is 11 months old so I suppose it is affecting to el9 too.
So I workarounded it. Good bye NetworkManager, hello networkd and netplan. Posting this just for someone having same problem until they fix NetworkManager. In my container I did:
configure netplan nano /etc/netplan/10-lxc.yaml
I’ve used this for my two interfaces, so both get ip from dhcp servers, the bridged from Incus internal bridge and the macvlan from my router
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: true
dhcp-identifier: mac
eth1:
dhcp4: true
dhcp-identifier: mac