OK thanks.
So the LXD images by default are configured to have eth0
use DHCP (you can see that by looking at /etc/netplan/10-lxc.yaml
:
lxc exec c1 -- cat /etc/netplan/10-lxc.yaml
network:
version: 2
ethernets:
eth0:
dhcp4: true
dhcp-identifier: mac
So when your eth0 NIC device is connected to the LXD managed lxdbr0, it will get a private address from that bridge via DHCP.
When you attach another NIC, in this case eth1 as a macvlan connected to your wlx28ee52172bcc
interface, the container doesn’t have any automatic configuration, so nothing happens (apart from the IPv6 link local addressing).
So you need to modify your container’s network config inside the container (in this case modifying /etc/netplan/10-lxc.yaml
) to do what you want to do, be it a statically assigned IP or to use DHCP, the same way you would with a real computer. You can also do this configuration automatically using cloud-init (which LXD supports passing config to).
See https://netplan.io/examples/ for more info on using netplan.
Also, you will likely have problems getting macvlan to work with a wifi parent as the different MAC addresses will cause issues with wifi authentication.