[Lxc-users] Static IP from coinfig file?

Matthijs Kooijman matthijs at stdin.nl
Thu May 17 09:40:30 UTC 2012


Hi Johannes,

> > lxc.network.link                        = br0.tun0
Is there an actual interface called like that? Or did you somehow try to
specify two bridge interfaces?

You might also want to configure a gateway as well in the lxc config,
btw.

> How does a debian guest's /etc/network/interfaces have to look like such 
> that the IP is assigned from the config file - or is that even possible 
> without running a dhcp server on the host?
Just don't configure anything for eth0: The network interface will be
configured by lxc even before the container's init is started, so
Debian's networking scripts don't need to do anything.

My interfaces file looks like this right now:

    auto lo
    iface lo inet loopback

    auto eth0

But I think the last line is not even needed, perhaps the loopback stuff
isn't either.

For comparison, my lxc.conf for the container looks like:

    lxc.network.type = veth
    lxc.network.flags = up
    lxc.network.veth.pair = lxc-container1
    lxc.network.name = eth0
    lxc.network.link = br-lxc
    lxc.network.ipv4 = 10.42.0.10/24
    lxc.network.ipv4.gateway = auto


Gr.

Matthijs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20120517/4d4e2486/attachment.pgp>


More information about the lxc-users mailing list