Addig multiple interface to container(s)

Hello,

I’ve 4 container and 4 interface in my server

  IPv4 address for ens4:   172.16.1.3
  IPv4 address for ens5:   172.16.2.3
  IPv4 address for ens6:   172.16.3.2
  IPv4 address for ens7:   172.16.4.2
  IPv4 address for lxdbr0: 10.50.34.1
  IPv6 address for lxdbr0: fd42:764a:a702:12::1

How I can assign IP to my following container

WEB1
WEB2
WEB3

For example , IP 172.16.1.3 to WEB1 (container) and then port forward 80 and 443.

Thank You

You can either use:

  1. lxc config device set $CONTAINER $NIC ipv4.address=$TARGET, (dhcp from the parent network)
  2. use netplan to specify it within the container (static ip requested by your guest os)