[lxc-users] Static container IP with unmanaged bridge network
Andrey Repin
anrdaemon at yandex.ru
Mon Feb 11 06:01:35 UTC 2019
Greetings, Daniele Riccucci!
> Hello Andrey,
> thank you for the clarifications.
> I tried with a few of the available images (ubuntu, alpine, centOS) but
> they all seemed to have some way to default to DHCP and cloud-init
> user-data (where available) doesn't seem to allow user-data to disable
> networking config; the setting in the profile:
> devices:
> eth0:
> ipv4.address: 10.0.0.30/24
> name: eth0
> nictype: bridged
> parent: br0
> type: nic
> didn't seem to matter at all, hence the feasibility question.
I'm not using LXD, only plain LXC, so can't say for certain if your
configuration is sufficient.
> Intuitively the easiest option would be to edit the network config file
> *inside* the container or hardcode the mac address of the interface and
> put a static mapping on it from the router side.
That's not the easiest option, and yes, many images default to DHCP.
You'll have to turn that off, or set up DHCP to roll IP addresses.
I'm using both approaches, depending on situation and intended container
usage.
--
With best regards,
Andrey Repin
Monday, February 11, 2019 8:59:12
Sorry for my terrible english...
More information about the lxc-users
mailing list