My containers don’t get IPv4, only IPv6. They used to get IPs, but has recently stopped getting them and I have no idea why.
I’ve ensured my Debian Buster system is using /usr/sbin/iptables-legacy
(by running update-alternatives --set iptables /usr/sbin/iptables-legacy
):
root@quanah ~ # ls /etc/alternatives/iptableslrwxrwxrwx 1 root root 25 Mar 26 06:47 /etc/alternatives/iptables -> /usr/sbin/iptables-legacy
I have nothing listening on 53
on the host, so LXD’s dnsmasq
should have no problems.
root@quanah ~ # netstat -nlp --tcp | grep -w 53
tcp 0 0 10.107.206.1:53 0.0.0.0:* LISTEN 351/dnsmasq tcp6 0 0 fd42:71d3:6e74:8047::53 :::* LISTEN 351/dnsmasq
tcp6 0 0 fe80::216:3eff:fed0::53 :::* LISTEN 351/dnsmasq
The one you see in the netstat
listing is LXD’s:
~ $ ps auxww | grep -w 351
lxd 351 0.0 0.0 43640 3476 ? Ss 07:15 0:00 dnsmasq --keep-in-foreground --strict-order --bind-interfaces --except-interface=lo --pid-file= --no-ping --interface=lxdbr0 --quiet-dhcp --quiet-dhcp6 --quiet-ra --listen-address=10.107.206.1 --dhcp-no-override --dhcp-authoritative --dhcp-leasefile=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.leases --dhcp-hostsfile=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.hosts --dhcp-range 10.107.206.2,10.107.206.254,1h --listen-address=fd42:71d3:6e74:8047::1 --enable-ra --dhcp-range ::,constructor:lxdbr0,ra-stateless,ra-names -s lxd -S /lxd/ --conf-file=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.raw -u lxd -g lxd
I have tried restarting the network, then snap and then, for good measure, lxd:
# ifdown wlp4s0
# ifup wlp4s0
# systemctl restart snapd
# snap restart lxd
The most interesting bit in /var/log/syslog
to my eyes is:
Mar 26 07:15:08 quanah systemd-udevd[377]: Could not generate persistent MAC address for vethb5794188: No such file or directory
Mar 26 07:15:08 quanah systemd-udevd[32691]: Could not generate persistent MAC address for veth3012792f: No such file or directory
One error per container.
To rule out the firewall, I’ve turned off my own rules and can only see the ones set up by LXD:
root@quanah ~ # iptables -LChain 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 */
Versions
~ $ grep PRETTY /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
~ $ snap --version
snap 2.49.1
snapd 2.49.1
series 16
debian 10
kernel 4.19.0-14-amd64
~ $ lxd --version
4.12
~ $
Any help would be much appreciated.