LXC Focal Fossa container (nsa2) no DHCP Request. Only seeing this on CentOS 7 and RedHat 7 (on CentOS 8 this problem is not occurring).
[ubuntu@c7sv1 ~]$ sudo lxc-ls -f
[sudo] password for ubuntu:
NAME STATE AUTOSTART GROUPS IPV4 IPV6 UNPRIVILEGED
afns1 RUNNING 0 - 10.209.53.2, 172.29.108.2 - false
afns1-base STOPPED 0 - - - false
nsa2 STOPPED 0 - - - false
[ubuntu@c7sv1 ~]$ sudo lxc-start -n nsa2
[ubuntu@c7sv1 ~]$ sudo lxc-ls -f
NAME STATE AUTOSTART GROUPS IPV4 IPV6 UNPRIVILEGED
afns1 RUNNING 0 - 10.209.53.2, 172.29.108.2 - false
afns1-base STOPPED 0 - - - false
nsa2 RUNNING 0 - - - false
[ubuntu@c7sv1 ~]$ sudo lxc-stop -n nsa2
[ubuntu@c7sv1 ~]$ sudo lxc-start -n nsa2
[ubuntu@c7sv1 ~]$ sudo lxc-ls -f
NAME STATE AUTOSTART GROUPS IPV4 IPV6 UNPRIVILEGED
afns1 RUNNING 0 - 10.209.53.2, 172.29.108.2 - false
afns1-base STOPPED 0 - - - false
nsa2 RUNNING 0 - - - false
[ubuntu@c7sv1 ~]$ sudo lxc-attach -n nsa2 – dhclient
[ubuntu@c7sv1 ~]$ sudo lxc-ls -f
NAME STATE AUTOSTART GROUPS IPV4 IPV6 UNPRIVILEGED
afns1 RUNNING 0 - 10.209.53.2, 172.29.108.2 - false
afns1-base STOPPED 0 - - - false
nsa2 RUNNING 0 - 192.168.122.118 - false
[ubuntu@c7sv1 ~]$
Monitoring with tcpdump there is NO activity until the manual “dhclient” is fed to container:
[ubuntu@c7sv1 ~]$ sudo tcpdump -i any port 67 and port 68
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
li> stening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
08:32:19.042709 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:16:3e:16:f7:5e (oui Unknown), length 300
08:32:19.042709 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:16:3e:16:f7:5e (oui Unknown), length 300
08:32:19.044613 IP c7sv1.bootps > 192.168.122.118.bootpc: BOOTP/DHCP, Reply, length 300
08:32:19.044619 IP c7sv1.bootps > 192.168.122.118.bootpc: BOOTP/DHCP, Reply, length 300
After the manual dhclient is fed from lxc-attach, now the container has an IP from virbr0:
NAME STATE AUTOSTART GROUPS IPV4 IPV6 UNPRIVILEGED
afns1 RUNNING 0 - 10.209.53.2, 172.29.108.2 - false
afns1-base STOPPED 0 - - - false
nsa2 RUNNING 0 - 192.168.122.118 - false
[ubuntu@c7sv1 ~]$
Thanks,
Gilbert