Centos7 guest: set ipv4


I have setup a centos guest. When I set ipv4 from lxc it desn’t set it in the container, but it shows it in lxc config:

    ipv4.address: [redacted]
    name: eth1
    nictype: bridged
    parent: br0
    type: nic


You are using bridged networking (not private bridge). Thus, the network interface is not managed by LXD and the static IP cannot be applied by LXD.

Ok thank you. Isn’t it possible to do it with cloudinit ?

Yes, you can do it with cloud-init.
For LXD, the whole cloud-init configuration is copied verbatim into the container. If there is any typo or error, you will find it in the container log files after you start the container.

1 Like