Proxmox Opnsense Bridged Setup

Table of Contents

Overview

I chose this because I didn’t want to mess with my home network and I wanted to test out opnSense filtering.

Hardware

Topton pfSense Firewall Soft Router N5105 N150 N100 4x i226-V 2.5G LAN NVMe Barebone Fanless Mini PC HDMI2.0 DP AES-NI OPNsense !Image Description

Software

Downloading and Setting up Proxmox

https://forum.proxmox.com/threads/proxmox-beginner-tutorial-how-to-set-up-your-first-virtual-machine-on-a-secondary-hard-disk.59559/

Creating VM

  • Make sure you’re not on VPN when trying to connect to Proxmox. Made that mistake before.
  • Configs - Default
    • General !Image Description
    • OS - Choose OPNsense!Image Description
    • Disks - SSD emulation!Image Description
    • CPU - 4 cores, type - host, gets all features of host CPU!Image Description
    • Memory - 4GB!Image Description
    • Network - We will config more later!Image Description
    • Confirm
  • NIC setup
    • Go to Datacenter > your node > System > network!Image Description
    • Create > Linux Bridge
      • Create 1:1 relationship of Linux bridges for each physical NIC you have
      • vmro0 was already created so vmbr1 needs to be created.
      • I mapped it to enp2s0 and commented the label it has on the physical port!Image Description
      • Repeat!Image Description
      • Click Apply Configuration to save your changes! If you don’t you will get a vmbr doesn’t exist error when trying to start VM![[Pasted image 20250623211526.png]]
    • Go back to our OpnSense VM
      • Hardware > Add > Network Device
      • Add your WAN port!Image Description
        • Make sure that your VM is stopped or else you will get this error 😅!Image Description
      • Add your LAN port
      • Remove vmbr0 because this will be used to communicate to your client / proxmox for config.!Image Description

OpnSense Installation

Configuration

  • It will boot back up shortly!Image Description
  • We will now config the LAN and WAN!Image Description
    • Plug in your machine into the OpnSense LAN port that you configured and go to 192.168.1.1!Image Description!Image Description
  • Login to the firewall
    • User: root
    • Pass: opnsense (or whatever your changed it to)
  • Set your DNS Servers. If you have a local one use that. Enable DNSSEC support if you would like.!Image Description
  • Choose your timezone!Image Description
  • We can exit the wizard after this.

Configuring the Transparent Bridge

These steps are taken from zenarmor transparent bridge setup. https://www.zenarmor.com/docs/network-security-tutorials/how-to-configure-transparent-filtering-bridge-on-opnsense

1. NAT: Outbound

  • On the left, go to Firewall > NAT > Outbound > select Disable outbound NAT rule generation > click save > apply changes!Image Description

2. Tunables

  • Go to System > Settings > Tunables!Image Description We can use the search bar to filter and pencil to edit.
    • We need to edit the following:
      • net.link.bridge.pfil_bridge: 1!Image Description
      • net.link.bridge.pfil_member: 0
    • Click Apply to save our changes

3. Creating the Bridge

  • Go to Interfaces > Devices > Bridge!Image Description
  • Click the +
  • For Member inferaces select Lan, WAN!Image Description
  • Click Save

4. Interface Assignment

  • Go to Interfaces > Assignments
  • Add a description > click Add!Image Description!Image Description

[!note] If you get kicked out of Opnsense, unplug the WAN port for now.

  • Click on [Bridge]
    • ✅ Enable Interface!Image Description
    • IPv4 Configuration Type: Static IPv4 (or DHCP if you prefer that)
    • IPv4 address : set the address!Image Description

5. Disable DHCP on LAN

  • Go to Services > ISC DHCPv4 > [LAN] > Uncheck Enable DHCP server on LAN interface!Image Description
  • Click Save

6. Firewall Rule to Allow All Traffic

  • Go to Firewall > Rules > Bridge
  • Click on + to add (Most of these should be default)
    • Action: Pass
    • Direction: In
    • Protocol: any
    • Source: any
    • Destination: any!Image Description
    • Log: ✅Check Log packets that are handled by this rule
    • Description: Allow All!Image Description
    • Click Save
    • Click Apply changes!Image Description
    • Do the same for LAN and WAN!Image Description!Image Description

7. Disable Default Anti Lockout Rule

  • Firewall > Settings > Advanced > Uncheck Disable anti-lockout!Image Description
  • Click Save

8. Set LAN and WAN Interface IPv4 Configs to None

  • Go to Interfaces > [LAN]
  • IPv4 Configuration Type: None
  • Click Save!Image Description
  • Do the same for WAN

Conclusion

We should be good now. Don’t forget to plug your WAN / LAN ports into your firewall!