Hi there,
sorry to say, but my containers are again without an IP. What I have done, is to switch from iptables-legacy
to iptables-nft
and I’ve restarted the computer (several times).
My system should AFAICT use the newer nft
commands:
root@quanah ~ # ls /etc/alternatives/ip*
lrwxrwxrwx 1 root root 23 Apr 20 13:49 /etc/alternatives/ip6tables -> /usr/sbin/ip6tables-nft
lrwxrwxrwx 1 root root 31 Apr 20 13:49 /etc/alternatives/ip6tables-restore -> /usr/sbin/ip6tables-nft-restore
lrwxrwxrwx 1 root root 28 Apr 20 13:49 /etc/alternatives/ip6tables-save -> /usr/sbin/ip6tables-nft-save
lrwxrwxrwx 1 root root 22 Apr 8 10:11 /etc/alternatives/iptables -> /usr/sbin/iptables-nft
lrwxrwxrwx 1 root root 30 Apr 8 10:11 /etc/alternatives/iptables-restore -> /usr/sbin/iptables-nft-restore
lrwxrwxrwx 1 root root 27 Apr 8 10:11 /etc/alternatives/iptables-save -> /usr/sbin/iptables-nft-save
However, I see that the lxd rules have been set up using iptables-legacy
(after restarting snap and lxd, have also tried rebooting the computer):
root@quanah ~ # iptables-legacy -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:domain /* generated for LXD network lxdbr0 */
ACCEPT udp -- anywhere anywhere udp dpt:domain /* generated for LXD network lxdbr0 */
ACCEPT udp -- anywhere anywhere udp dpt:bootps /* generated for LXD network lxdbr0 */
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere /* generated for LXD network lxdbr0 */
ACCEPT all -- anywhere anywhere /* generated for LXD network lxdbr0 */
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp spt:domain /* generated for LXD network lxdbr0 */
ACCEPT udp -- anywhere anywhere udp spt:domain /* generated for LXD network lxdbr0 */
ACCEPT udp -- anywhere anywhere udp spt:bootps /* generated for LXD network lxdbr0 */
My other firewall rules are shown when using iptables -L
and iptables-nft -L
.
What am I missing here?
I don’t know if this is what’s causing my containers to not get an IP, but it seems odd to me.
tcpdump
Running dhcp -v eth0
inside the container shows this on the host machine:
root@quanah ~ # tcpdump -i lxdbr0
listening on lxdbr0, link-type EN10MB (Ethernet), capture size 262144 bytes
16:29:35.964184 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:16:3e:c8:ad:28 (oui Unknown), length 300
16:29:38.627124 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:16:3e:c8:ad:28 (oui Unknown), length 300
16:29:44.043561 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:16:3e:c8:ad:28 (oui Unknown), length 300
16:29:55.192863 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:16:3e:c8:ad:28 (oui Unknown), length 300
16:30:08.202171 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:16:3e:c8:ad:28 (oui Unknown), length 300
16:30:08.805536 IP 10.107.206.1.47592 > 239.255.255.250.1900: UDP, length 171
16:30:09.085949 IP 10.107.206.1.52273 > 239.255.255.250.1900: UDP, length 167
16:30:09.806259 IP 10.107.206.1.47592 > 239.255.255.250.1900: UDP, length 171
16:30:10.087470 IP 10.107.206.1.52273 > 239.255.255.250.1900: UDP, length 167
16:30:10.807063 IP 10.107.206.1.47592 > 239.255.255.250.1900: UDP, length 171
16:30:11.089015 IP 10.107.206.1.52273 > 239.255.255.250.1900: UDP, length 167
16:30:11.807837 IP 10.107.206.1.47592 > 239.255.255.250.1900: UDP, length 171
16:30:12.090665 IP 10.107.206.1.52273 > 239.255.255.250.1900: UDP, length 167
16:30:15.476240 IP6 fd42:71d3:6e74:8047:216:3eff:fec8:ad28.43748 > fd42:71d3:6e74:8047::1.domain: 49838+ [1au] A? api.snapcraft.io. (45)
16:30:15.477106 IP6 fd42:71d3:6e74:8047:216:3eff:fec8:ad28.59171 > fd42:71d3:6e74:8047::1.domain: 44200+ [1au] AAAA? api.snapcraft.io. (45)
16:30:15.486629 IP6 fd42:71d3:6e74:8047::1.domain > fd42:71d3:6e74:8047:216:3eff:fec8:ad28.43748: 49838 6/0/1 A 91.189.92.40, A 91.189.92.41, A 91.189.92.19, A 91.189.92.20, A 91.189.92.38, A 91.189.92.39 (141)
16:30:15.564224 IP6 fd42:71d3:6e74:8047::1.domain > fd42:71d3:6e74:8047:216:3eff:fec8:ad28.59171: 44200 0/1/1 (109)
16:30:15.976591 IP6 fd42:71d3:6e74:8047:216:3eff:fec8:ad28.52543 > fd42:71d3:6e74:8047::1.domain: 40676+ [1au] AAAA? api.snapcraft.io. (45)
16:30:15.976810 IP6 fd42:71d3:6e74:8047::1.domain > fd42:71d3:6e74:8047:216:3eff:fec8:ad28.52543: 40676 0/0/1 (45)
16:30:17.226804 IP6 fd42:71d3:6e74:8047:216:3eff:fec8:ad28.36730 > fd42:71d3:6e74:8047::1.domain: 41852+ [1au] AAAA? api.snapcraft.io. (45)
16:30:17.227169 IP6 fd42:71d3:6e74:8047::1.domain > fd42:71d3:6e74:8047:216:3eff:fec8:ad28.36730: 41852 0/0/1 (45)
16:30:19.697933 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:16:3e:c8:ad:28 (oui Unknown), length 300
16:30:20.351641 IP6 fd42:71d3:6e74:8047:216:3eff:fec8:ad28.37869 > fd42:71d3:6e74:8047::1.domain: 36766+ [1au] AAAA? api.snapcraft.io. (45)
16:30:20.351880 IP6 fd42:71d3:6e74:8047::1.domain > fd42:71d3:6e74:8047:216:3eff:fec8:ad28.37869: 36766 0/0/1 (45)
16:30:20.683421 IP6 fe80::216:3eff:fed0:93 > fd42:71d3:6e74:8047:216:3eff:fec8:ad28: ICMP6, neighbor solicitation, who has fd42:71d3:6e74:8047:216:3eff:fec8:ad28, length 32
16:30:20.683489 IP6 fe80::216:3eff:fec8:ad28 > fd42:71d3:6e74:8047::1: ICMP6, neighbor solicitation, who has fd42:71d3:6e74:8047::1, length 32
16:30:20.683620 IP6 fd42:71d3:6e74:8047::1 > fe80::216:3eff:fec8:ad28: ICMP6, neighbor advertisement, tgt is fd42:71d3:6e74:8047::1, length 24
16:30:20.683578 IP6 fd42:71d3:6e74:8047:216:3eff:fec8:ad28 > fe80::216:3eff:fed0:93: ICMP6, neighbor advertisement, tgt is fd42:71d3:6e74:8047:216:3eff:fec8:ad28, length 24
16:30:24.806317 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:16:3e:c8:ad:28 (oui Unknown), length 287
16:30:25.803391 IP6 fe80::216:3eff:fed0:93 > fe80::216:3eff:fec8:ad28: ICMP6, neighbor solicitation, who has fe80::216:3eff:fec8:ad28, length 32
16:30:25.803480 IP6 fe80::216:3eff:fec8:ad28 > fe80::216:3eff:fed0:93: ICMP6, neighbor solicitation, who has fe80::216:3eff:fed0:93, length 32
16:30:25.803991 IP6 fe80::216:3eff:fed0:93 > fe80::216:3eff:fec8:ad28: ICMP6, neighbor advertisement, tgt is fe80::216:3eff:fed0:93, length 24
16:30:25.803935 IP6 fe80::216:3eff:fec8:ad28 > fe80::216:3eff:fed0:93: ICMP6, neighbor advertisement, tgt is fe80::216:3eff:fec8:ad28, length 24
16:30:28.164320 IP6 fd42:71d3:6e74:8047:216:3eff:fec8:ad28.49645 > fd42:71d3:6e74:8047::1.domain: 15173+ [1au] AAAA? api.snapcraft.io. (45)
16:30:28.164554 IP6 fd42:71d3:6e74:8047::1.domain > fd42:71d3:6e74:8047:216:3eff:fec8:ad28.49645: 15173 0/0/1 (45)
16:30:31.021328 IP 10.107.206.1.mdns > 224.0.0.251.mdns: 0 PTR (QM)? _spotify-connect._tcp.local. (45)
16:30:32.869782 IP 10.107.206.1.55286 > 239.255.255.250.1900: UDP, length 125
16:30:37.636731 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:16:3e:c8:ad:28 (oui Unknown), length 300
DNS server
There’s only one DNS server process and I’ve verified this is the one running as lxd
:
root@quanah ~ # netstat -nlp | grep -w 53
tcp 0 0 10.107.206.1:53 0.0.0.0:* LISTEN 19585/dnsmasq
tcp6 0 0 fd42:71d3:6e74:8047::53 :::* LISTEN 19585/dnsmasq
udp 0 0 10.107.206.1:53 0.0.0.0:* 19585/dnsmasq
udp6 0 0 fd42:71d3:6e74:8047::53 :::* 19585/dnsmasq
Versions
~ $ snap --version
snap 2.49.2
snapd 2.49.2
series 16
debian 10
kernel 4.19.0-16-amd64
~ $ lxd --version
4.13
Any help would be much appreciated.