Hey all,
My system is set up the following way:
- I’m running KVM on my bare metal host (Ubuntu 16.04). The primary interface is eno1.
- I’ve created a VM running Ubuntu 18.04. LXD is installed via the snap package. The network interface is set for macvlan on eno1 and the device is virtio. The interface is named ens3 on the VM.
- I’ve created a container and in LXC, I’ve configured the nic device as a macvlan, with the parent being ens3. This creates an eth0 device in the container.
When I’m in the container and run dhclient -v eth0, I’m able to see packets go out to the rest of the network, hit my DHCP server, which then tries to give out an address. The problem is the return traffic isn’t getting back to the VM or the container. Running tcpdump on the host shows the DHCP reply from my DHCP server, but I cannot see the reply it when running tcpdump in the VM or in the container. I imagine there’s something to do with mac filtering on the host side, but I’m not sure what setting to change. I checked to make sure there wasn’t anything weird happening with the mac address being sent to the DHCP server, and in fact it appears to be the mac of the container’s interface (eth0). The host just doesn’t seem to want to pass on the packet to the VM.
Here’s a terrible “drawing” of the layout, I’m not sure if this will be helpful or confusing.
connection type: macvlan macvlan
Network <-----------> Host (KVM) <----------------> VM (LXD) <-----------------> Container
device names: eno1 ens3 eth0
EDIT:
I’ve come across the following two posts:
- Cannot get macvlan working, no DHCP reply, network not working
- Multiple LXD containers on single macvlan interface
It seems others are trying to do something similar to what I am, so I’m going to try what’s talked about in here and see where I get.