[lxc-users] Converting network from LXC to LXD

John Lane lxc at jelmail.com
Sat Dec 21 18:09:20 UTC 2019


On 21/12/2019 16:51, John Lane wrote:

> 
> I can't do this:
> 
> $ lxc config device set mycontainer eth0 ipv4.address 192.168.21.2/24
>                                                Error: Invalid devices:
> Invalid value for device option ipv4.address: Not an IPv4 address:
> 192.168.21.2/24
> 
> Also there appears to be no setting for gateway:
> 
> $ lxc config device set mycontainer eth0 ipv4.gateway 192.168.21.1
> Error: Invalid devices: Invalid device option: ipv4.gateway
> 

Reading this
(https://github.com/lxc/lxd/issues/1259#issuecomment-166416979):

> lxc.network.ipv4 => Not supported by LXD, IP configuration must be
done from inside the container. Most distros flush any pre-existing
kernel network configuration when they boot, so this pretty much never
works anyway.

> lxc.network.ipv4.gateway => Not supported by LXD, IP configuration
must be done from inside the container. Most distros flush any
pre-existing kernel network configuration when they boot, so this pretty
much never works anyway.

I guess that it doesn't work.

I also tried using "lxc.raw" to work around it but could not get that to
work. I kept getting "Config parsing error: Initialize LXC: Failed to
load raw.lxc". Does raw.lxc not work any more? it is documented but
there aren't really any explanations of how to use it. Anecdotal posts
exist elsewhere but I suspect they contain stale information becuase the
suggsted methods didn't work for me.

Anyway, I can work around this issue (as suggested) by configuring the
static network details inside the container. That works.

I don't know if there is a page accessible on the main LXD site
documentation that explains this kind of thing which would be useful to
help transitioning from plain-old lxc.


More information about the lxc-users mailing list