[lxc-users] Static container IP with unmanaged bridge network

Daniele Riccucci devster at posteo.net
Sun Feb 10 23:05:36 UTC 2019


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.

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.

Am I missing something?

On 10/02/19 21:34, Andrey Repin wrote:
> Greetings, Daniele Riccucci!
> 
>> I'm having a bit of a hard time figuring out from the documentation if
>> adding ipv4.address to devices > eth0 in the profile would work
> 
> TIAS ?
> It would only take a few moments to find out.
> 
>> and if this requires a simple IP or a CIDR.
> 
> CIDR, as it sets both IP and netmask.
> 
>> Is this setup possible since the bridge device isn't managed by LXD?
> 
> Not related. container configuration sets container parameters, not bridge's
> or what not.
> 
> P.S.
> Remove internal container configuration of network interface, if you don't
> want surprises.
> 
> 


More information about the lxc-users mailing list