I have LXD container running the official fedora 33 image, and I am trying to add a routed nictype to it. I have LXD installed on Debian 10 machine via snap.
I have successfully setup routed nics on Debian, Devuan and CentoS however the behavior on fedora container is different.
After executing:
lxc config device add c1 eth0 nic nictype=routed parent=eth0 ipv4.address=$ip
lxc list command shows that the container does not have any IPv4 at all
lxc list
+------+---------+------+------+-----------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+---------+------+------+-----------+-----------+
| c1 | RUNNING | | | CONTAINER | 2 |
+------+---------+------+------+-----------+-----------+
eth0 interface appears disconnected inside the container:
nmcli device
DEVICE TYPE STATE CONNECTION
eth0 ethernet disconnected --
lo loopback unmanaged --
and when I try to change the IP address of that interface it says:
nmcli connection modify eth0 ipv4.addresses $ip
Error: unknown connection 'eth0'.
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0@if8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether ca:1b:e8:5f:34:0b brd ff:ff:ff:ff:ff:ff link-netnsid 0
Any ideas what am I doing wrong ?
Thanks.