Yeah, I had already seen that link, but it looks the same as what I was testing in my previous post and it didn't work.
I will need to try more, but this seems to work:
/etc/config/network
config device
option name 'br0'
option type 'bridge'
list ports 'lan0'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
config bridge-vlan
option device 'br0'
option vlan '1'
list ports 'lan0'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4:t'
list ports 'veth1'
config bridge-vlan
option device 'br0'
option vlan '2'
list ports 'lan4:t'
list ports 'veth2'
You can do it in a different way too which may be more future proof, in terms if you want to run more or dynamically create/start/stop/delete containers .
As said above you need a bridge to add veth device. So if you create two new bridges from the devices br0.1 and br0.2 respectively, assign your lan, dmz interface to them, then simply you can specify the two new bridges in the lxc.config.
config device
option name 'br0'
option type 'bridge'
list ports 'lan0'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
config bridge-vlan
option device 'br0'
option vlan '1'
list ports 'lan0'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4:t'
config bridge-vlan
option device 'br0'
option vlan '2'
list ports 'lan4:t'
### new bridge for lan
config device
option name 'br-lan'
option type 'bridge'
list ports 'br0.1'
### new bridge for dmz
config device
option name 'br-dmz'
option type 'bridge'
list ports 'br0.2'
config interface 'lan'
option device 'br-lan' # <--- link to the new bridge
option proto 'static'
config interface 'dmz'
option device 'br-dmz' # <--- link to the new bridge
option proto 'static'
then in your respective lxc.config:
lxc.net.0.type = veth
lxc.net.0.link = # br-lan or br-dmz
# and you dont even need to specify veth device name here
# lxc will create a new veth device, name dynamically
# and automatically add to the respective bridge
# lxc.net.0.veth.pair = veth1
the trick is to add the veth interface as a port to the device switch in
luci/admin/network/network
and then activate the vlan on the veth device
like:
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan0'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
list ports 'vethvm1'
and
config bridge-vlan
option device 'br-lan'
option vlan '10'
list ports 'lan2:u*'
list ports 'lan3:u*'
list ports 'lan4:u*'
list ports 'vethvm1:u*'
bit off topic but i've been using systemd containers (systemd-nspawn/machinectl) without issue for a while now, even passing in wireless phy works
I took an old amlogic s905 tv box, plugged in a comfast mt7921au wireless adapter into one of the usb2 ports, downloaded ophub armbian, gutted it out to be running Arch Linux with rc-local service instead and then compiled the latest kernel. Then I compiled Openwrt armsr target, unpakced the rootfs to /var/lib/machines directory, and it worked. I had to be careful with some things like making sure openssl had no cryptodev support.