So as you’ve noticed, your configuration instructs LXD to setup a local bridge on each node and provide DHCP/DNS on it. This works as far as outgoing traffic is concerned but doesn’t get you cross-node networking or any kind of inbound networking.
LXD clustering right now very much assumes that you have an existing layer-2 infrastructure and that you’ll effectively just plug your containers into an existing physical network (VLAN) with a router provided DHCP/DNS for you. That’s the case which works best and if integrated with MAAS, LXD can even do IP management for you in this case.
If this is something you have, then create a new VLAN on your network, have your router provide DNS and DHCP on it, setup all your nodes to be attached to that VLAN and you can then connect your containers to that using something like:
Which assumes that all your nodes have a bond0 device for the physical network and that you have a VLAN ID 1010 setup on it for your containers to use.
The go to alternative for this for setups without a dedicated network infrastructure would be to use a FAN bridge with LXD but we’re still working out some small problems with that, once we have those fixed, it will make it pretty simple to get a bunch of containers talking to each other without needing more complex network infrastructure.
I’ve tried what you suggested
As expected, macvlan works but I’m not sure what to do with VLAN part
For switch side, (3Com baseline 2952 SFP switch) I’ve configured all ports to trunk mode.
But still vlan does not function. How should I setup my switch for container overlay network
with macvlan + VLAN setup?
Should I get inside and edit container’s network config
to recognize it’s network interface as VLAN tagged one?