[lxc-users] LXD static IP confusion

Matt Green mephi at mephi.co.uk
Mon Aug 29 06:43:07 UTC 2016


Ahh, OK. Thanks for clarifying :-)
I guess I need to work out the Pros/Cons of static vs dhcp and go from
there.

Cheers,

Matt

On 29 Aug 2016 03:28, "Serge E. Hallyn" <serge at hallyn.com> wrote:

> On Sun, Aug 28, 2016 at 09:59:42AM +0100, Matt Green wrote:
> > Hi Guys,
> >
> > I've currently got a 14.04 server running LXC, and I'm planning to use
> the
> > upgrade to 16.04 as an excuse to switch to LXD.
> >
> > In the interim I thought I'd upgrade my proxy server and move it's
> services
> > to LXD so I'm not messing with my pre-existing services.
> >
> > Anyway...
> >
> > I have a 16.04 server with LXD installed, I've set it up to bridge to my
> > network interface (so the server isn't doing NAT, DHCP, etc.) and I've
> > installed my first container with "lxc launch ubuntu:16.04 proxy".
> >
> > Now I want to give that container a static IP address.
> > In LXC on 14.04 I've just edited /etc/network/interfaces manually.
> > In LXD on 16.04 I see that there's a file
> > called /etc/network/interfaces.d/50-cloud-init.cfg which is controlling
> the
> > interface config and apparently I shouldn't edit it manually.
> >
> > According to https://github.com/lxc/lxd/issues/1168 LXD doesn't have
> > anything to do with the host address config, but then what's this
> > cloud-init thing?
> >
> > I'm not sure what to do now. Should I bypass cloud-init and configure my
> > interface manually? Or is there a better way I should be doing this?
>
> If you use the linuxcontainers.org images instead of the ubuntu: images,
> you shouldn't have cloud-init (iirc).  You can remove it by hand.  It's
> purpose is to support automated post-install customizations in a cloud
> environment.
>
> Now, in general the recommended way to get a 'static' ip address would be
> to configure the dhcp server to hand the desired address to the container,
> but of course /etc/network/interfaces should still work (if you drop
> cloud-init)
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20160829/dafff0f0/attachment.html>


More information about the lxc-users mailing list