As requested by @pQd here's a working example for port isolation with VMs (here: based on Proxmox VE) when the host is the uplink and all VMs should be isolated from each other. I use this for an internal service network (DNS, Updates, etc). The bridge is vmbr1, the virtual Ethernet devices are vethNNN.1 (where NNN is the VID). If you only want isolation, this should be enough:
ebtables --append FORWARD --logical-in vmbr1 --jump DROP
If multiple bridges are to be configured and other VMs should be Uplinks as well (here: veth100.1 and veth102.1), something like this is more appropriate (untested):
for br in $(seq 0 1); do
br=vmbr$br
ebtables --new-chain $br
ebtables --policy $br DROP
ebtables --append FORWARD --logical-in $br --jump $br
done
for if in 100.1 102.1; do
br=vmbr$(echo $if | cut -d. -f2)
if=veth$if
ebtables --append $br --in-if $if
ebtables --append $br --out-if $if
done
If the host shouldn't be an uplink, this should work (I didn't try it as well though):
ebtables --append INPUT --logical-in vmbr1 --jump vmbr1
ebtables --append OUTPUT --logical-out vmbr1 --jump vmbr1