Running OPNsense in a vm with VLANS

  • Thread starter Thread starter Deleted member 286489
  • Start date Start date
D

Deleted member 286489

Guest
Hello,

I am new to Proxmox and networking, and I am trying to run OPNsense in a vm for my router. Under the Proxmox network config, I want to use one NIC for wan, and one NIC for dividing into two VLANS and then combining into a bridge that I can pass into the OPNsense vm. I also want to be able to plug this NIC being used for the VLANS into my network switch's trunk port, which is currently configured to accept traffic from both vlans. From there, I then should be able to plug devices into access ports and get on the network that way. Proxmox also needs to get internet from one of the VLANS on the OPNsense network. I have tried multiple configurations (with the help of ChatGPT), but the furthest I got was being able to get other vms on the VLANS. I never was able to get on the vlan networks from my network switch. My current config is below.


Code:
auto enp5s0
iface enp5s0 inet manual
        ovs_type OVSPort
        ovs_bridge lan
        ovs_mtu 9000
        ovs_options vlan_mode=trunk

iface enp5s0 inet manual

auto enp5s1
iface enp5s1 inet manual

auto vlan904
iface vlan904 inet static
        address 10.4.5.1/24
        ovs_type OVSIntPort
        ovs_bridge lan
        ovs_mtu 1500
        ovs_options vlan_mode=trunk tag=904

# This is the VLAN I want proxmox to be on.
auto vlan352
iface vlan352 inet static
        address 10.4.6.1/24
        ovs_type OVSIntPort
        ovs_bridge lan
        ovs_mtu 1500
        ovs_options tag=352 vlan_mode=trunk

# Current WAN bridge, may no longer exist as I want to pass through a network card directly to the OPNsense VM.
auto vmbr0
iface vmbr0 inet static
        bridge-ports eno0
        bridge-stp off
        bridge-fd 0

# Temporary bridge to my current network for access to Proxmox webgui.
auto pveconnect
iface pveconnect inet static
        address 192.168.1.233/24
        gateway 192.168.1.1
        bridge-ports enp5s1
        bridge-stp off
        bridge-fd 0

# Bridge with the two VLANS
auto lan
iface lan inet manual
        ovs_type OVSBridge
        ovs_ports enp5s0 vlan904 vlan352   
        ovs_mtu 9000

source /etc/network/interfaces.d/*
 

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!