1

I use ubuntu 16.04 in a kvm virtual machine. For lxd containers I try to make a network bridge, so the containers are available in our local network.

The interface file looks like this:

auto eth0
iface eth0 inet manual

auto br0
iface br0 inet dhcp
   bridge-ifaces eth0
   bridge-ports eth0
   up ifconfig eth0 up
   netmask 255.255.255.0
   gateway 192.168.0.1
   bridge_stp off
   bridge_waitport 0
   bridge_fd 0

In the lxd init config I select the br0 interface. My lxd default profile has also the bridge selected.

When I setup now a new container, I don't get an IP for it.

brctl show gives this:

bridge name    bridge id            STP enabled      interfaces
br0            8000.5254008fde71    no               eth0
                                                     vethCH64WJ

How can I get this to work?

0

One way is to route the traffic, without using the network bridge:

ip route add 10.0.6.0/24 via 192.168.0.16 dev eth1

A solution with network bridge is still welcome!

Another way is, to use a bridge interface on host (br0), not the kvm bridge. The containers get there IPs from the host.

0

This could be an emulation issue. You could try running:

dhclient eth0 -v

in the container and then checking out a related question for arm/qemu if you get an error message à la Error getting interfaces.

  • Thank you! When I remember correctly the problem was, that the firewall on the kvm host got confuse, because the route back from a package goes different then it comes. This was happen because I used not the bridge from bridge-utils on the host. I had the kvm bridge. Changes to a real bridge on the host has fix that issue. – jb_alvarado Dec 15 '16 at 21:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.