How to connect VM with vlan to OPNsense vlan (with cable attached)

Overman29

New Member
Apr 27, 2023
1
1
3
I have an existing configuration with a virtualized OPNsense, a smart switch, and a physical Unraid server. (Photo attached) I am currently using the following vlans:
Vlan1 - default LAN for devices, management
Vlan10 - docker
Vlan20 - VMs
Vlan30 - LXC containers

IMG-7339b080fd0e85fb1b00475ec1b092e0-V.jpg

All the VLANs are currently used with my Unraid server. Now I also want my Proxmox server to host some VMs and LXC containers which need to be in the respective VLANs. I want to have the most simple configuration on Proxmox and OPNsense as much as possible (I need to understand how to configure the Proxmox-vlan30 boxed in red in the photo). Can anyone guide me if the below steps would work?

1. Create two Linux vlans, one for 20, and one for 30, without attaching any physical interface. (I am expecting packets will be tagged respectively due to this configuration)
2. Create separate Linux virtual bridge for vlan10, vlan20, vlan30)
3. Add these three bridges to the OPNsense VM.

In OPNsense:
1. Assign the new interfaces and enable them.
2. Create three new bridges, one for existing vlan10 and new vlan10, for existing vlan20 and new vlan20, for existing vlan30 and new vlan30. (Will not enable vlan aware flag and keep disabled by default)
3. Assign new bridges as interface and enable them.
4. Add firewall rules on both newly created bridge, and newly created vlan interfaces to allow access to existing vlan interfaces and the internet.

Connectivity test using VM
In Proxmox:
1. Create new VM and assign vlan20 bridge. (Don't assign vlan tag in Networks section during VM creation)
2. Boot new VM and ping DHCP server on existing vlan20.

So far I've tried multiple configurations and recently when I restarted Proxmox, I lost access to the management IP after a Proxmox reboot and found out that all bridges were down. I'm not sure if my experiments caused this but I still need to recover access (different issue I need to fix). But I want to be prepared later on so I don't make the same mistakes again. Any help is appreciated! Cheers!
 
Last edited:
  • Like
Reactions: bombonato

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!