[lxc-users] Converting network from LXC to LXD

Andrey Repin anrdaemon at yandex.ru
Sat Dec 21 17:54:30 UTC 2019


Greetings, John Lane!

> Looking at nictype=bridged, I can set up DHCP addresses, thanks, but am
> having difficulty with static configuration.

> Looking at that document there seems to be no equivalent of the
> following lxc configuration:

> lxc.net.0.ipv4.address = 192.168.21.2/24
> lxc.net.0.ipv4.gateway = 192.168.21.1

> The "ipv4.address" entry documented as "An IPv4 address to assign to the
> container through DHCP" and not as a CIDR address as per lxc.

Because netmask is taken from bridge configuration. (Presumable.)

> I can't do this:

You don't need to.

> Also there appears to be no setting for gateway:

Gateway is served via DHCP from the bridge.

> $ lxc config device set mycontainer eth0 ipv4.gateway 192.168.21.1
> Error: Invalid devices: Invalid device option: ipv4.gateway

> I can manually add them afterwards, i.e.

> $ lxc exec mycontainer ip address add 192.168.21.2/24 dev eth0
> $ lxc exec mycontainer ip route add default via 192.168.21.1 dev eth0

> What am I missing? Can I assign static addresses with LXD configuration?

You're missing the purpose.
LXD is not supposed to be so tightly controlled on per container basis.
LXD containers supposed to be deployed en masse, with minimal individual
configuration.


-- 
With best regards,
Andrey Repin
Saturday, December 21, 2019 20:52:32

Sorry for my terrible english...



More information about the lxc-users mailing list