Lxc start/stop disconnecting ssh clients from host?

I’m currently trying out LXD in an ubuntu VM as a POC for moving away from proxmox on my home server. I’ve enabled a network bridge in netplan that LXD is using.

Here’s my netplan config:
network:
ethernets:
ens18:
dhcp4: true
version: 2

  bridges:
    br0:
      dhcp4: yes
      interfaces:
        - ens18

Whenever I start or stop a container my ssh client disconnects from the VM host, which makes setting up and configuring the containers a serious pain in the rear. Is there something going on with the bridge that I’m not aware of? Any help would be greatly appreciated.

Hmmm… it looks like the bridge is generating a new mac address every time the lxc start/stop commands are run, which is probably why the SSH clients are getting kicked off. I’ll have to try and figure out why that’s happening.

Yeah, that’s normal behavior for bridges. They effectively take the lowest MAC address from all its members. If that member goes away, the bridge changes MAC.

The way you avoid that is by pinning the MAC of your bridge.
In this case, set macaddress: XX:XX:XX:XX:XX:XX in your config, apply it and the bridge should get that MAC and then never change it again.

1 Like