How to set public ip for container when I creating it with lxd rest api

lxd
networking

(Ignas Račkus) #1

Hello. If I have ip block pointed to server on which linux containers is, how to point specific public ip adress to container that I creating by lxd rest api?


#2

You need a bridge on your network interface.
If you have, LXD cannot set “public” IP address if not using it’s own bridges. You can with cloudinit or with your local network DHCP.


#3

You can create either a bridge or a macvlan and have the containers get the IP address from that IP block as Lox described.

Here is a tutorial on this,