Several IPs on ohe host. Several containers per IP

Hello, I’m searching the way to make this:

[GLOBAL_IP_1]-|---[  H O S T  ]
              |---[CONTAINER_1]
              |---[CONTAINER_2]
              |---[CONTAINER_3]

[GLOBAL_IP_2]-|---[CONTAINER_4]
              |---[CONTAINER_5]
              |---[CONTAINER_6]

[GLOBAL_IP_3]-|---[CONTAINER_7]
              |---[CONTAINER_8]
              |---[CONTAINER_9]

and so on.
All traffic must go only via coresponding IP shared between container groups.
I’ve been goougled a lot of time and tried a lot of solutions, but hasn’t find anything that worked.
What would you advise?

I would suggest using 3 different private LXD managed bridge networks:

e.g.

lxc network create netgroup1 --type=bridge

Then specifying the ipv4.nat.address (and if needed the ipv6.nat.address) settings for that network:

lxc network set netgroup1 ipv4.nat.address=n.n.n.n

Then connecting each container to the required network:

lxc config device override <instance> eth0 network=netgroup1

Thank you.
I’ve tried, but got:

lxc config device override ng2-ct1-test eth0 nic network=netgroup1
Error: No value found in "nic"

UPD_1: This worked (type=nic):

lxc config device override ng2-ct1-test eth0 type=nic network=netgroup1
Error: No value found in "nic"

UPD_2:
As I think, I need to unset separate MAC for this IP and add it to the host’s enpXsY device, am I right?
In both, “with MAC” and “without MAC” I have no net inside container ng2-ct1-test [Wait a little bit and it will work --> UPD_3].
What am I doing wrong?

UPD_3: Seems I need to wait a little bit. So, it works now! Finally, I’ve got what I needed. Using nesting containers was not a good idea. It was like train of binded bicycles. No more matioskas. :slight_smile: