[lxc-users] Configuring LXC containers to use a host bridge under CentOS 7

Peter Steele pwsteele at gmail.com
Sat Aug 29 13:54:56 UTC 2015


On 08/29/2015 01:09 AM, Neil Greenwood wrote:
> Hi Peter,
>
> On 28 August 2015 23:11:51 BST, Peter Steele <pwsteele at gmail.com> wrote:
> Do you have a ifcfg-br0 in your LXC configuration? If the VMs can see each other, I think most of the settings are correct apart from the bridge not being connected to the host's eth0. I'm not that familiar with Centos networking though, so I don't know which bit you need to change.
>
>
> Neil
>

Yes, I have a ifcfg-br0 file in my LXC configuration. It's identical to 
what I use with my libvirt-LXC setup. In my particular case, I have the 
bridge connected to a bonded interface, but it works the same as if I 
was to connect it to a hosts eth0. This lets me bond say four nics 
eth0-3 into one bond0 interface. The is connected to the bond0 interface 
but from its perspective it acts the same as an eth0 interface. I need 
to of course maintain this configuration in moving from libvirt-LXC to LXC.

Ultimately, in the long term, I will want to remove the entire set of 
libvirt packages from my setup and only install the LXC rpms. I know 
that LXC was developed by Canonical but my impression was that it would 
work under CentOS/Fedora as well. Unfortunately I'm not that familiar 
with Ubuntu networking and a lot of the examples appear to be specific 
to Ubuntu.

For example, I see references to the file /etc/network/interfaces. Is 
this an LXC thing or is this a standard file in Ubuntu networking?

Mark Constable asked a related question stemming from my original post 
and commented on the file /etc/default/lxc-net. I assume this file is 
*not* specific to Ubuntu. Do I need to create this file in my CentOS setup?

It might be useful to configure a CentOS system without libvirt 
installed and do some LXC tests without libvirt-LXC getting in the way. 
I was hoping making the move to LXC wouldn't be too painful but it looks 
like I'm going to have to work for it a bit.



More information about the lxc-users mailing list