Linux: lxc guest does not get an DHCP address using bridge
Title could also be; lxc networking does not work, using a bridge.
I use a bridge for all my lxc guests (also for docker). This is so that I do not need to setup iptables forwarding to my guests (easy).
But setting up a new Ubuntu 20.04 LTE host gave me some headacke. I could not get my gust to get an ipaddress, and using tcpdump I could see that it did not get an dhcp reply - and looking in the dhcpserver log I could see that nohing arrived there either.
Lots of digging aournd for a good two hours (compaing to another Ubuntu 20.04 LTE), and finally I found the differnce.
On the box where it was workning I had /etc/sysctl.d/99-sysctl-bridge.conf containg:
net.bridge.bridge-nf-call-ip6tables=0
net.bridge.bridge-nf-call-iptables=0
net.bridge.bridge-nf-call-arptables=0
net.bridge.bridge-nf-call-iptables=0
net.bridge.bridge-nf-call-arptables=0
Adding the same file to my problem box, and issuing "sysctl -p /etc/sysctl.d/99-sysctl-bridge.conf", then restaring my lxc guest, and it got an ip address.
What it does is that it disables the firewall on the bridge ... go figure.
Now the major problem is; where did that file come from in the first place?
I'll probably never know ... but without this, lxc will not work via a bridge.
Comments