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

Mark Constable markc at renta.net
Sat Aug 29 14:29:03 UTC 2015


On 29/08/15 23:54, Peter Steele wrote:
> 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?

It's a standard pre-systemd debian/ubuntu network config file.
  
> 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.

Aside from some ubuntu specific apparmor etc files these are what the ubuntu lxc
package installs (confusingly the lxd-client package install the "lxc" command)...

/etc/bash_completion.d/lxc
/etc/default/lxc
/etc/dnsmasq.d-available/lxc
/etc/init/lxc.conf
/etc/init/lxc-instance.conf
/etc/init/lxc-net.conf
/etc/lxc/default.conf
/lib/systemd/system/lxc-net.service
/lib/systemd/system/lxc.service

~ cat /etc/lxc/default.conf
lxc.network.type = veth
lxc.network.link = lxcbr0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e:xx:xx:xx

Eek, lxc-net does not seem to be part of a package so I'm not sure how I got that
file!

~ dpkg -S /etc/default/lxc-net
dpkg-query: no path found matching pattern /etc/default/lxc-net

However this config file refers to it so maybe I copied it from some howto/tutorial...

~ egrep -v "^(#|$)" /etc/default/lxc
LXC_AUTO="true"
USE_LXC_BRIDGE="false"  # overridden in lxc-net
[ -f /etc/default/lxc-net ] && . /etc/default/lxc-net
LXC_SHUTDOWN_TIMEOUT=120

FWIW I only use the lxc command for unpriv containers via the lxd daemon as of the
last 4 or 5 months and, like you I think, have no interest in the default NAT'd
10.0.3.* lxcbr0 network. My main test honeypot container on my laptop is at
https://goldcoast.org. It and markc at goldcoast.org seem to work most of the time.



More information about the lxc-users mailing list