Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I have been experimenting with LXC virtualisation in order to run virtual machines on a dedicated server, but am having trouble setting up the networking properly.

I am using veth bridged networking, as instructed here: (the guide I used to setup the LXC container)

When I start the container, it functions fine, can access the Internet and accepts incoming connections to it's own IP. However, as soon as I start it, the networking on my host box (dedicated server) goes down completely, and will not come back until the server is rebooted.

The only thing I can think of that would be causing this is incorrectly configured bridging settings, however I'm not sure entirely what the proper ones should be. Any advice on how I could reconfigure this? Thanks.

Both the host node and the container itself are running Debian Squeeze, with packages upgraded to the latest versions.

Host node (dedicated server) network configuration (/etc/network/interfaces):

allow-hotplug eth0
auto br0
iface br0 inet static
    bridge_ports eth0
    bridge_fd 0
    bridge_stp off
    bridge_maxwait 0 

LXC container network configuration (/etc/network/interfaces):

auto eth0
iface eth0 inet static
    post-up route add dev eth0
    post-up route add default gw
    post-down route del dev eth0

Container network configuration (from LXC config file):

lxc.utsname = paradox = veth = up = br0 = 02:00:00:ba:47:a0 =
share|improve this question

1 Answer 1

Caveat: I'm not all that familiar with LXC. Regardless, I have a few observations that may be helpful, as I have quite a lot of experience with Debian networking, bridges, and VMs (specifically, qemu-kvm).

First of all, the guide explicitly states that you need to comment-out the eth0 configuration on the host's interfaces file, yet you have allow-hotplug eth0 in there. Comment that line out.

Secondly, when creating bridging setups involving physical interfaces like this, I like to add line(s) to the interfaces file to explicitly keep the physical interface(s) uninitialized. In this case, eth0 is to be added to the bridge, so I would have this:

iface eth0 inet manual

And finally, it is a little weird to have different subnets on the same bridge. Although it should work, LXC is still under heavy development, so it's possible that even slightly unconventional network setups could expose bugs. Try putting your VM on the same subnet as the host (, so that you don't need to explicitly muck with routes in your VM.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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