Is it possible to restrict NICs of a bridge to (different) VLANs?

watzr

New Member
Mar 3, 2022
13
0
1
54
Hey guys,

my server is running proxmox and has 4 NICs. Proxmox can do "dumb" switching when all NICs are on the same bridge. Can it do "managed/smart" switching too?
In my home network i have 3 different subnets:

- the service network 192.168.6.0/24 without a VLAN ID
- the DMZ 192.168.77.0/24 on VLAN 20
- the client network 192.168.14.0/24 on VLAN 30

In proxmox i want a single bridge for all 4 NICs. One NIC working as a trunk port to my managed switch and the other ports i would like to use to switch to other devices near my proxmox server. I would want those NICs to only belong to a specific VLAN though.

See section "physical NICs to devices" in this masterpiece
proxmox_smart_switch.png
Is there a way to restrict a physical NIC of a bridge to a single VLAN like you can do on virtual NICs to VMs?

Thanks a lot :)
 
This should works with vlan-aware bridge

Code:
#trunk interface
auto eth0
iface eth0 inet manual

#only vlan20
auto eth1
iface eth1 inet manual
      bridge-access 20

#only vlan30
auto eth2
iface eth2 inet manual
      bridge-access 30

#no vlan
auto eth3
iface eth3 inet manual
      bridge-access 1

auto vmbr0
iface vmbr0
        bridge_ports eth0 eth1 eth2 eth3
        bridge_stp off
        bridge_fd 0
        bridge-vlan-aware yes
        bridge-vids 20 30

then for vm vlan, simply use the vlan tag option on the vm nic gui.
 
Last edited:
  • Like
Reactions: brg3466
This should works with vlan-aware bridge

Code:
#trunk interface
auto eth0
iface eth0 inet manual

#only vlan20
auto eth1
iface eth1 inet manual
      bridge-access 20

#only vlan30
auto eth2
iface eth2 inet manual
      bridge-access 30

#no vlan
auto eth3
iface eth3 inet manual
      bridge-access 1

auto vmbr0
iface vmbr0
        bridge_ports eth0 eth1 eth2 eth3
        bridge_stp off
        bridge_fd 0
        bridge-vlan-aware yes
        bridge-vids 20 30

then for vm vlan, simply use the vlan tag option on the vm nic gui.
Thank you so much ! I tried many ways but yours works !
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!