LXC container and DHCP on br-lan

Hi all,
I’m struggling to get LXC containers working with DHCP. I got them working with static IP address. To avoid impact of any of my changes I reset Omnia to factory default (I didn’t modify anything) then I created a new Debian LXC container with default network settings:

lxc.network.type = veth
lxc.network.link = br-lan
lxc.network.flags = up
lxc.network.name = eth0

In System log (see below) I can see DHCPDISCOVER followed by DHCPOFFER to the lxc container. However there is no DHCPREQUEST. If it was on different subnet there could be firewall rules but I intentionally tried it in br-lan to avoid going across subnets.

Does it work for others?

2016-10-29T21:30:12+02:00 info kernel[]: [ 802.145166] device vethOO2G1B entered promiscuous mode
2016-10-29T21:30:12+02:00 info kernel[]: [ 802.145348] IPv6: ADDRCONF(NETDEV_UP): vethOO2G1B: link is not ready
2016-10-29T21:30:12+02:00 info kernel[]: [ 802.145355] br-lan: port 3(vethOO2G1B) entered forwarding state
2016-10-29T21:30:12+02:00 info kernel[]: [ 802.145371] br-lan: port 3(vethOO2G1B) entered forwarding state
2016-10-29T21:30:12+02:00 info kernel[]: [ 802.149911] br-lan: port 3(vethOO2G1B) entered disabled state
2016-10-29T21:30:12+02:00 info kernel[]: [ 802.214107] eth0: renamed from vethJ7N7L9
2016-10-29T21:30:12+02:00 info kernel[]: [ 802.242572] IPv6: ADDRCONF(NETDEV_CHANGE): vethOO2G1B: link becomes ready
2016-10-29T21:30:12+02:00 info kernel[]: [ 802.242636] br-lan: port 3(vethOO2G1B) entered forwarding state
2016-10-29T21:30:12+02:00 info kernel[]: [ 802.242665] br-lan: port 3(vethOO2G1B) entered forwarding state
2016-10-29T21:30:14+02:00 info kernel[]: [ 804.241144] br-lan: port 3(vethOO2G1B) entered forwarding state
2016-10-29T21:30:16+02:00 info dnsmasq-dhcp[3696]: DHCPDISCOVER(br-lan) 62:92:e9:9a:c1:bd
2016-10-29T21:30:16+02:00 info dnsmasq-dhcp[3696]: DHCPOFFER(br-lan) 192.168.1.165 62:92:e9:9a:c1:bd
2016-10-29T21:30:17+02:00 info dnsmasq-dhcp[3696]: DHCPDISCOVER(br-lan) 62:92:e9:9a:c1:bd
2016-10-29T21:30:17+02:00 info dnsmasq-dhcp[3696]: DHCPOFFER(br-lan) 192.168.1.165 62:92:e9:9a:c1:bd
2016-10-29T21:30:25+02:00 info dnsmasq-dhcp[3696]: DHCPDISCOVER(br-lan) 62:92:e9:9a:c1:bd
2016-10-29T21:30:25+02:00 info dnsmasq-dhcp[3696]: DHCPOFFER(br-lan) 192.168.1.165 62:92:e9:9a:c1:bd
2016-10-29T21:30:34+02:00 info dnsmasq-dhcp[3696]: DHCPDISCOVER(br-lan) 62:92:e9:9a:c1:bd
2016-10-29T21:30:34+02:00 info dnsmasq-dhcp[3696]: DHCPOFFER(br-lan) 192.168.1.165 62:92:e9:9a:c1:bd
2016-10-29T21:30:49+02:00 info dnsmasq-dhcp[3696]: DHCPDISCOVER(br-lan) 62:92:e9:9a:c1:bd
2016-10-29T21:30:49+02:00 info dnsmasq-dhcp[3696]: DHCPOFFER(br-lan) 192.168.1.165 62:92:e9:9a:c1:bd
2016-10-29T21:31:00+02:00 info dnsmasq-dhcp[3696]: DHCPDISCOVER(br-lan) 62:92:e9:9a:c1:bd
2016-10-29T21:31:00+02:00 info dnsmasq-dhcp[3696]: DHCPOFFER(br-lan) 192.168.1.165 62:92:e9:9a:c1:bd

interesting - it will probably be related to the LXC container. It doesn’t work for Debian and TurrisOS (after configuring the interface as dhcp manually) but it works properly with Ubuntu Xenial image … I’m not sure what to investigate next.

Use the search …

https://discourse.labs.nic.cz/t/debian8-jessie-on-turris-omnia/859/13
https://discourse.labs.nic.cz/t/debian8-jessie-on-turris-omnia/859/4

DIfference is probably Ubuntu using systemd-networkd or something else but at least not isc-dhcp-client for DHCP.

3 Likes