I know this is a rather old thread, but I’ve managed to isolate my container in its own VLAN using the following:
networks:
mailcow-vlan:
enable_ipv6: true
driver: macvlan
driver_opts:
parent: eno1
ipam:
config:
- subnet: 192.168.1.0/20
gateway: 192.168.1.1
ip_range: 192.168.11.0/24 # or/25 # this must not overlap with your DHCP range
- subnet: 2001:db8:3333::/64
gateway: 2001:db8:3333::1
Hope this helps someone