lxc-net fails to start when configuring IPV6
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Running on Ubuntu 22.04.3 LTS jammy
lxc-utils:
Installed: 1:5.0.0~
When configuring IPV6 on the default lxcbr0 LXC bridge in /etc/default/
LXC_IPV6_
LXC_IPV6_MASK="64"
LXC_IPV6_
LXC_IPV6_NAT="true"
The lxc-net service fails to start: systemctl restart lxc-net
Starting LXC network bridge setup...
Error: conflicting protocols specified: ip6 vs. ip
Failed to setup lxc-net.
lxc-net.service: Main process exited, code=exited, status=1/FAILURE
lxc-net.service: Failed with result 'exit-code'.
Failed to start LXC network bridge setup.
Turns out this is due to a syntax error in /usr/lib/
add rule ip6 lxc postrouting ip saddr ${LXC_IPV6_NETWORK} ip daddr != ${LXC_IPV6_NETWORK} counter masquerade;
Should mention "ip6 saddr" and "ip6 daddr" in the line, like so:
add rule ip6 lxc postrouting ip6 saddr ${LXC_IPV6_NETWORK} ip6 daddr != ${LXC_IPV6_NETWORK} counter masquerade;
After manually editing the /usr/lib/
This fix seems to already live in the upstream lxc project on github: https:/
Unfortunately Ubuntu jammy ships with lxc-utils 5.0.0
not really bug related, but in case somebody else is playing around with this and ends up here: I also needed to add a firewall rule to UFW before DHCP from my unprivileged containers started working:
ufw allow in on lxcbr0
(this can probably be restricted a bit further to only allow DHCP requests)