Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

migrated from Sep 21 '12 at 15:57

This question came from our site for professional and enthusiast programmers.

This is not exactly an answer, but have you checked out docker? It dramatically simplifies the process of working with Linux containers. I have also had more success using libvirt to manage containers (virsh -c lxc:/// ...) than using the native lxc-* toolset. – larsks Aug 4 '13 at 0:21

I created many squeeze/wheezy containers by the same instruction (

The only thing I do different way is that I use a virtual network bridge. (And I think the problem is that you have a bridge to your network card, not to a virtual device)

Add something like this to your /etc/network/interfaces (using your own numbers):

auto eth0.5
iface eth0.5 inet manual
  vlan_raw_device eth0

auto vzbr5
iface vzbr5 inet static
  bridge_maxwait 0
  bridge_ports none
  post-up /usr/sbin/brctl addif vzbr5 eth0.5
  post-up /sbin/ifconfig eth0.5 up


sudo ifup vzbr5

After that use vzbr5 as a network device.

Please see the complete instruction.

share|improve this answer
Adding the instructions would improve this answer. Links can and do break. – Dave M Oct 1 '13 at 14:32
@DaveM Thanks for your advice. – Sergei Lodyagin Oct 1 '13 at 18:50

You want to put the static address in the containers /etc/network/interfaces or config file but not both. Personally I prefer to set it up in /etc/network/interfaces.

You can also remove as the config file takes care of the gateway:

post-up route add dev eth0
post-up route add default gw
post-down route del dev eth0

Why did you choose allow-hotplug eth0 on your host? This is usually not needed. Also double check the gateway address and any firewall settings on the gateway.

share|improve this answer

Seems you re-plug your adapter. ..

Do you have an apater on the dedicated server that is connected to the bridge? I would be curious, what happens if you start a second container?

Instead of routing with words involved like dev and eth0, I might would like to take a look at someting to manage the virtual networks, especially if you would be also OK with a NAT solution. Did you took at livbvirt?

share|improve this answer

Your Answer


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