pfSense & OPNsense on Proxmox: Building Your Router as a VM
Bridges vs. NIC passthrough, the single-NIC VLAN path, and a well-known disconnect bug worth knowing about before you start.
Replacing a consumer router with pfSense or OPNsense running as a Proxmox VM is one of the most common reasons people get into Proxmox in the first place, and it's a different kind of guest than everything else on this site. Home Assistant and TrueNAS Scale are services your network reaches. This VM is the network: get the WAN/LAN interface assignment backwards and you can lock yourself out of both the internet and the Proxmox host in the same click. None of it is hard, it's just worth reading the networking section below before creating the VM, not after.
pfSense or OPNsense: Pick Either
This guide covers both projects together because the install steps are nearly identical: same FreeBSD-derived base, same VM shell, same interface-assignment flow at first boot. OPNsense forked from pfSense in 2014 over disagreements about the direction of the project and has since built its own plugin ecosystem and a faster release cadence. pfSense Community Edition is backed by Netgate, who also sell pre-built appliances and a paid Plus tier, and has the larger base of existing forum answers if something goes sideways.
For a home network, it's a coin flip. Pick whichever project's web UI and terminology you find more comfortable, since you'll be living in it for firewall rules and DHCP reservations from here on.
Getting It Running
Unlike most of the other guides on this site, there isn't a one-command community script to lean on here. Proxmox VE Helper Scripts lists an OPNsense VM script, but it's currently flagged as unavailable while the maintainers check it, and pfSense has no equivalent at all. Both are manual VM builds, which is a smaller job than it sounds.
- pfSense CE: download the current installer image from the official pfSense downloads page and upload it to Proxmox as an ISO. Create the VM with at least 1 core (4 recommended, CPU type
host), 1GB RAM minimum (4GB comfortable), a 32GB VirtIO Block disk, VirtIO network adapters for both interfaces, and machine typei440fxunless you're planning PCI passthrough, in which case useq35. - OPNsense: same VM settings, different source image: grab the DVD image from the official OPNsense downloads page and attach it as the VM's CD-ROM the same way.
Both installers walk you through disk partitioning (ZFS with a stripe layout is the default and fine for a router's boot disk) and finish with a reboot into an interface-assignment prompt, which is where the networking decision below actually matters.
The Networking Decision That Actually Matters
Every other guide on this site has a passthrough section about disks or USB devices. This one is about the network path itself, since a router VM's whole job is standing between your Proxmox host and the internet.
- Linux bridges (recommended to start): create one bridge per physical role, typically
vmbr0for Proxmox's own management access,vmbr1bridged to the physical port running to your modem for WAN, andvmbr2bridged to the port(s) running to your LAN switch. Assign the VM's virtual NICs to the matching bridges. Bridges let you add more VMs or containers onto any of those networks later without touching cabling, at a modest performance cost, typically single-digit gigabits on a 10G link rather than full line rate. - PCI passthrough (better performance, less flexible): pass a physical NIC directly through to the VM (requires IOMMU enabled in the Proxmox host's BIOS and boot config, plus machine type
q35). The router VM gets near-native throughput, but it can no longer be live-migrated to another node, and the NIC is unavailable to the host or any other guest while it's passed through.
On a single physical NIC, both interfaces can still run through one VLAN-aware bridge: enable VLAN awareness on the bridge, tag the VM's WAN and LAN virtual interfaces with different VLAN IDs, and set the switch port feeding Proxmox to trunk mode so it carries both tags. Every other device on the network plugs into a switch port assigned to the LAN VLAN.
One practical safety note: do the interface assignment and any WAN/LAN swap from the Proxmox console (the VM's own screen, opened from the Proxmox web UI), not over a network connection that depends on the change you're about to make. It's a two-minute job if something's misassigned and you're watching the console. It's a much longer one if you've locked yourself out of the box you need to fix it from.
First Boot: Assigning Interfaces
After the installer reboots, both pfSense and OPNsense drop into the same console-based interface assignment prompt. With VirtIO network adapters, the interfaces show up as vtnet0 and vtnet1. Assign the one connected to your WAN bridge as WAN and the other as LAN, let it apply a default LAN address (typically 192.168.1.1), and the console will print the URL for the web GUI.
From there, log into the web GUI from a machine on the LAN side, run through the setup wizard (admin password, DNS, time zone), and you have a working router. Everything past this point, firewall rules, DHCP scopes, VLANs for other devices, is standard pfSense/OPNsense administration and not specific to running it on Proxmox.
The VirtIO Disconnect Issue
Worth knowing about ahead of time rather than discovering it during a video call: older FreeBSD releases have shipped VirtIO network driver bugs that show up as the connection randomly dropping every few minutes, with "no buffer space available" errors in the system log. It's been reported often enough on both the Proxmox and Netgate forums to be a known issue rather than a misconfiguration on your end.
Two fixes, either works: run a current pfSense or OPNsense release, since this has been resolved in recent FreeBSD versions, or change the affected interface's model from VirtIO to Intel E1000 in the VM's Hardware tab, which trades some throughput ceiling for a driver with a longer track record. If you're already on a current release and still seeing it, also check System → Advanced → Networking for the hardware checksum offload setting. Disabling it has fixed traffic that looks fine in a packet capture but silently never arrives, a classic symptom of the VM and hypervisor disagreeing about who's responsible for the checksum.
A Few Things I'd Get Right From the Start
1. Start with bridges, not passthrough
Passthrough is easy to add later once you know you actually need the throughput. Undoing it, and getting migration and snapshots back, is more work than starting flexible.
2. Assign interfaces from the console, not over the network
Covered above, but it's the single easiest way to lock yourself out during setup. Use the Proxmox web UI's console view for the whole install and first configuration pass.
3. Set the VM to start on boot, and start it early
If this VM is your only router, nothing else on the network works until it's up. Give it VM ID priority in the boot order so it comes up before other guests that depend on it for DHCP or DNS.
4. Keep a known-good config backup off the VM itself
Both projects can export their full configuration as XML from the web GUI. Save a copy somewhere that isn't dependent on the router being reachable, since that's exactly the scenario where you'd need it.
5. Take a Proxmox snapshot before every firmware update
Same convention as every other guide on this site. A bad update to your only router is a worse night than a bad update to a media server.
Related Resources
Official pfSense Download
The installer image this guide's pfSense path uses.
Official OPNsense Download
The installer image this guide's OPNsense path uses.
Network Switch Tracker
Live pricing on managed switches, useful if you're setting up VLAN trunking for a single-NIC build.
Proxmox Updates
What's new in Proxmox VE, kept current with a live feed.
TrueNAS Scale on Proxmox
Another guide where the passthrough decision has real consequences.
Home Assistant on Proxmox
A good next VM once your network's stable.
Frequently Asked Questions
Should I use pfSense or OPNsense?
Either one runs your home network fine, and the install steps below are nearly identical for both. OPNsense forked from pfSense in 2014 over disagreements about the direction of the project, and has since built out its own plugin ecosystem and a faster release cadence. pfSense Community Edition is backed by Netgate, who also sell pre-built hardware and a paid Plus edition, and has the larger base of existing guides and forum answers if you get stuck. For a home network, pick whichever project's screenshots and terminology feel more comfortable. Neither choice is a mistake.
Is there a one-line community script for this, like the other guides on this site?
Not a reliable one right now. Proxmox VE Helper Scripts lists an OPNsense VM script, but as of this writing it's flagged on the project's own site as unavailable while the maintainers check it, and pfSense doesn't have an equivalent script at all since Netgate's installer isn't built to be piped through a one-liner the way TrueNAS's or Home Assistant's images are. This guide is a manual install for both, which is a smaller ask than it sounds: it's mostly VM creation settings plus clicking through an installer wizard once.
Do I need physical NIC passthrough, or can I use Proxmox bridges?
Bridges are the more common and more flexible choice, and what this guide sets up by default: they let other VMs and containers share the same physical NICs and get tagged onto any VLAN without touching hardware again. The tradeoff is a real but usually small performance ceiling; homelabbers report roughly 5-6 Gbps through a bridged 10G interface versus closer to line rate with full PCI passthrough. Passthrough also makes live-migrating the VM to another node much harder. Unless you're pushing multi-gigabit WAN, start with bridges.
I only have one NIC in my Proxmox box. Can I still do this?
Yes, with a VLAN-aware bridge and a managed switch. Set the bridge's VLAN awareness on in Proxmox, tag the router VM's WAN and LAN virtual interfaces with different VLAN IDs, and configure the switch port running to Proxmox as a trunk port carrying both tags. Every other device on the network then plugs into a switch port assigned to the LAN VLAN. It's more setup up front than a second NIC, but it works well and is how a lot of single-NIC mini PC homelabs actually run this.
My connection keeps dropping every few minutes after setup. What's wrong?
This is a known issue, not something you broke. Older FreeBSD releases (the base both pfSense and OPNsense build on) have had bugs in their VirtIO network driver that show up as random disconnects and "no buffer space available" errors in the logs. Two fixes both work: upgrade to a current pfSense/OPNsense release, since this has been fixed in recent FreeBSD versions, or change the affected interface's model from VirtIO to Intel E1000 in the VM's hardware settings, which trades some throughput for stability.
Do I need to disable hardware checksum offloading?
It's worth checking if you're seeing odd connectivity issues that aren't the VirtIO disconnect bug above. The setting lives under System, Advanced, Networking in both pfSense and OPNsense, and disabling hardware checksum offload has historically resolved traffic that looks fine in a packet capture but never actually arrives, a classic symptom of a VM's virtual NIC and the hypervisor disagreeing about who calculates the checksum. It's not needed on every setup, but it's a five-second checkbox worth trying if something's misbehaving.