My question is how to setup a public IP address for each container, and preferable how to set it all up from the host machine using the LXD commands (like lxc network set, lxc network attach, etc).
I have my host machine directly on a public IP x.x.x.40. There is no LAN network for my host.
I would like to have each of 5 container have it’s own public IP address x.x.x.41-46. I would like each container to act as it if is a distinct physical server with it’s own public IP.
It looks like the way I need to do this is using macvlan, but most of the tutorials/guides I have read are for setting it up using LAN, DHCP, and manually editing /etc/networking/interfaces file on the container to configure. In addition, many references using older version of LXD referring to /var/lib/lxc/[container]/config files and such.
The closest I got was using this guide, but got stuck when they started editing the container conf file, which does not exist in LXD 3, and I would prefer to use LXC commands to add an IP/netmask/DNS if possible: http://www.bonsaiframework.com/wiki/display/bonsai/5.1+LXC+Advanced+Networking+-+Exposing+Containers+to+the+Network#id-5.1LXCAdvancedNetworking-ExposingContainerstotheNetwork-macvlanwithAdditionalIPAddress
From basically a fresh setup of Ubuntu 18.04 and LXD 3.0.0, and running this container: ubuntu:18.04, can someone please help direct me in the right direction.
If I have to setup a separate macvlan or virtual interface for each container that is fine too.