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.

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 a similar requirement to the OP of this thread.

I want the following configuration:

-Physical host (PhyHost) reachable from the network at IP
-LXC container (LxcHost) reachable from the network at IP
Each contactable from the other.

OS = Ubuntu Server 12.04LTS

PhyHost /etc/network/interfaces

auto br0
iface br0 inet static
    pre-up ifconfig eth0 down
    pre-up ifconfig eth0 promisc up
    pre-up brctl addbr br0
    pre-up brctl addif br0 eth0
    bridge_fd 9
    bridge_hello 2
    bridge_maxpage 12
    bridge_stp off

auto br0:1

iface eth0 inet manual
    pre-up ifconfig eth0 promisc up
    pre-up brctl addif br0 eth0
    pre-down brctl delif br0 eth0
    pre-down ifconfig eth0 down

LxcHost /etc/network/interfaces

auto eth0
iface eth0 inet static
*I added some pre-up route add command here, being away from the system, I have forgotten what I used here*

As it is here the LxcHost was completely isolated and couldn't contact any other host. I added some pre-up route add and post-down commands (hence the note above) that completely escape me right now, but these brought connectivity from LxcHost out to the network. Normally I'd wait till I had all the information correct before posting, but I'm pretty keen to get some suggestions and tips on best practice.

lxc.conf used to create container


The behaviour I get from this set up is that PhyHost is contactable from the network (ping, ssh etc) on When I ssh to, I find myself logging into PhyHost also.

LxcHost can reach the internet, and the network including PhyHost, all hosts (including PhyHost) communicate only with PhyHost at the address

Other issues that I've had to address:

  • No response to the second IP addess - solved by setting eth0 to promiscuous
  • No network connectivity from LxcHost to any - solved with pre-up route commands on LxcHost eth0.
share|improve this question
It came down to my misunderstanding of how bridging works... I was adding a subinterface (br0:1) and assigning it an IP address on the physical host, then assigning the same IP to the container. When I simply gave the container a unique IP it worked. so I've been able to do away with the subinterface and it all works. – Raymund Mar 2 '13 at 1:07

Your Answer


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

Browse other questions tagged or ask your own question.