OPNsense includes a configuration Importer, but it’s built for migrating OPNsense’s own config.xml to new hardware, not for converting a pfSense export. Restoring a pfSense config.xml into OPNsense isn’t a documented supported path, and the two projects’ XML schemas have diverged enough since the fork that compatibility isn’t guaranteed.
The safer approach is to treat the pfSense export as a reference document rather than a restorable backup. Rebuild interfaces, VLANs, aliases, NAT, rules, DHCP, DNS, and VPNs by hand on a parallel OPNsense box, and cut over only after every segment tests clean.
This runbook targets pfSense CE as the source and OPNsense Community Edition as the target. Menu paths follow current OPNsense behavior, including the 26.7 change to the default firewall rules screen (OPNsense 26.7 release notes). It covers cutover and rollback. It doesn’t compare the two platforms or cover pfSense Plus, and it handles third-party packages such as pfBlockerNG by recreating their function, not by a feature-by-feature comparison.
What Transfers and What You Rebuild
Some community guides describe restoring individual sections, such as aliases or DHCP static maps, from a pfSense export (opn-sense.eu, bigiron.cc). Results vary. OPNsense’s official docs don’t list any section of a pfSense export as a supported, repeatable import, and the OPNsense backup docs warn that even partial restores of OPNsense’s own configuration can lead to unexpected behavior. Plan as if nothing imports. Anything that does import is a bonus you still verify line by line.
| pfSense data | Migration treatment | Why |
|---|---|---|
Whole config.xml | Reference only | Not a documented pfSense-to-OPNsense import path |
| Interface assignments | Rebuild | NIC device names can differ, even on identical hardware |
| VLANs | Rebuild | No bulk VLAN import |
| Aliases | Rebuild (partial import not guaranteed) | Rules reference them by name |
| Firewall rules | Rebuild and review each rule | Partial imports can land disabled or misordered |
| NAT port forwards / outbound NAT | Rebuild | Tied to interfaces and aliases |
| DHCP static mappings | Rebuild (partial import not guaranteed) | Options, boot files, and TFTP settings don’t reliably carry over |
| DNS Resolver (Unbound) | Rebuild | Host overrides and access lists are re-entered |
| WireGuard / OpenVPN / IPsec | Rebuild and reissue client configs | Package implementations differ |
| Packages | Find OPNsense equivalent or drop | No 1:1 package map |
Prerequisites
- Source: a running pfSense CE firewall with admin GUI access.
- Target: OPNsense Community Edition, current release, on spare hardware or a VM. A small mini PC with Intel NICs works well, since it lets you match the pfSense port count.
- Console access to the OPNsense box: a monitor and keyboard, a USB-to-serial console cable, or hypervisor console. You’ll want it the first time a rule change locks you out.
- An isolated test network: a spare managed switch that supports 802.1Q tagging, so you can test VLANs without touching production.
- A USB flash drive for the OPNsense installer, if installing on bare metal.
- A maintenance window. Plan for 30-60 minutes of cutover on a simple network. Plan longer if you run VPNs with many clients.
- A workstation with a browser and a text editor for reading
config.xml.
How to Migrate from pfSense to OPNsense, Step by Step
Step 1: Build the Pre-Migration Inventory
Every rule in a firewall hangs off an interface, and most rules reference an alias. Miss one alias and three rules break silently. The inventory gives you something to check against during testing. You catch that kind of gap before cutover.
Walk through the pfSense GUI and fill in this table. Copy it into your change ticket or a notes file.
| Category | pfSense location | What to record |
|---|---|---|
| Interfaces | Interfaces > Assignments | Physical NIC, MAC address, role (WAN/LAN/OPTx), IP/subnet, MTU |
| WAN and gateways | Interfaces > WAN, System > Routing > Gateways | WAN type (DHCP, static, PPPoE), ISP VLAN tag, gateway monitoring, gateway groups, IPv6 mode |
| VLANs | Interfaces > Assignments > VLANs | Parent NIC, tag, description, assigned name |
| Aliases | Firewall > Aliases | Name, type (host/network/port/URL table), contents |
| NAT | Firewall > NAT (Port Forward, Outbound, 1:1) | Interface, protocol, ports, target, mode |
| Rules | Firewall > Rules (each tab, plus Floating) | Order, action, source, destination, ports, log flag |
| DHCP static maps | Services > DHCP Server (per interface) | MAC, IP, hostname, custom options |
| DNS Resolver | Services > DNS Resolver | Host/domain overrides, access lists, forwarding mode |
| VPNs | VPN > WireGuard / OpenVPN / IPsec | Peers, keys, tunnel subnets, allowed IPs, certs |
| Certificates | System > Certificates (Cert. Manager on older releases) | CAs and certificates used by the GUI, OpenVPN, and IPsec |
| System settings | System > General Setup, System > User Manager, System > Advanced | Hostname, domain, time zone, NTP servers, admin users, GUI and SSH access restrictions |
| Packages | System > Package Manager, plus each package’s own pages | Package name, purpose, settings, feed or list URLs, update schedules, OPNsense equivalent |
Screenshots of every rules tab are worth the five minutes. Rule order is the hardest detail to reconstruct from XML.
Step 2: Export the pfSense config.xml as a Reference
In pfSense, go to Diagnostics > Backup & Restore. Under Backup Configuration, leave the backup area set to all and decide whether to encrypt. Then click Download configuration as XML (Netgate docs).
Store the file somewhere you can still reach if the network is down. It can include sensitive data such as credentials, keys, and certificates, so treat it like a secret. Encrypt it if it’s leaving the admin workstation.
The XML is easier to mine from a shell than from the GUI. On a Linux workstation:
# Count VLAN definitions in the export
grep -c "<vlan>" ~/migration/pfsense-config.xml
4
# List every VLAN tag with line numbers so you can read the surrounding block
grep -n "<tag>" ~/migration/pfsense-config.xml
212: <tag>10</tag>
219: <tag>20</tag>
226: <tag>30</tag>
233: <tag>99</tag>
The same approach works for <alias>, <staticmap>, and <rule> blocks. Cross-check the counts against your inventory table.
Step 3: Install OPNsense and Match Interface Assignments
Install OPNsense on the spare box or VM, and keep it off the production WAN. Connect its LAN port to your test switch only.
After the installer finishes, the console offers interface assignment. Assign WAN and LAN there. Then open the web GUI on the LAN address and go to Interfaces > Assignments. Add every remaining NIC as an OPT interface.
Don’t assume the physical device names will match pfSense, even on identical hardware. Drivers, OS releases, VM settings, and enumeration order can all change them. Map by role, confirm each NIC by MAC address, and record the pairs in a mapping table:
| pfSense role | pfSense NIC | OPNsense NIC | OPNsense name |
|---|---|---|---|
| WAN | igc0 | igb0 | WAN |
| LAN | igc1 | igb1 | LAN |
| OPT1 (DMZ) | igc2 | igb2 | OPT1 / renamed DMZ |
Rename OPT interfaces to the same descriptions you used in pfSense. You’ll be matching rule tabs by name for the next hour, and “IOT” beats “OPT3”.
Expected result: each assigned interface shows the correct NIC, is enabled, and has the IP/subnet from your inventory. Do this before anything else. VLANs and rules attach to assigned interfaces.
Step 4: Rebuild VLANs Under Interfaces > Other Types > VLAN
In OPNsense, VLAN creation and interface assignment are generally handled as separate steps, similar to pfSense, though exact menu names and layout can vary by version.
- Go to Interfaces > Other Types > VLAN.
- Click + to add a VLAN.
- Set Parent to the trunk NIC from your mapping table (the OPNsense name, not the pfSense one).
- Set VLAN tag to the exact tag from
config.xml. - Enter the same Description you used in pfSense, then save and apply.
- Go to Interfaces > Assignments, select the new VLAN device in the dropdown, and click +.
- Open the new interface, enable it, rename it (for example
IOT), and set the static IPv4 address and subnet.
Repeat for every VLAN. A wrong parent is the classic mistake. The VLAN comes up with the correct tag, but nothing on the switch answers because it’s on the wrong trunk.
Verify: plug a laptop into a test switch port tagged for that VLAN. Give it a static IP in the subnet and ping the OPNsense VLAN gateway. If you’re tempted to redesign segmentation while you’re here, keep it out of the migration. Rebuild exactly what you had, and change the design afterward.
Step 5: Recreate Aliases First, Then NAT, Then Rules
Order matters here because of dependencies. Rules reference aliases. Port forwards can create linked rules. Build bottom-up.
Aliases: go to Firewall > Aliases and recreate each one with the same name and type. Identical names let you read pfSense rules straight across.
NAT port forwards: go to Firewall > NAT > Port Forward and rebuild each forward from your inventory. Review every WAN-facing forward twice. A typo here exposes a service to the internet the minute you connect the real WAN.
Outbound NAT: in 26.7, source NAT replaces outbound NAT, and automatic source NAT rules are generated per WAN-type interface (CE 26.7 notes). The 26.7 migration assistant, surfaced as a banner on the outbound NAT page, converts rules that already exist in OPNsense. It doesn’t read a pfSense export, so manual or hybrid outbound rules from pfSense still get re-entered by hand.
If pfSense used automatic outbound NAT on a single WAN, the OPNsense automatic rules usually cover LAN-to-WAN traffic once every internal interface is assigned. Review them by hand if you run multiple WANs or gateway groups, IPv6, policy routing, VPN traffic that needs translation, or NAT exclusions. Those are the cases where automatic rules stop matching what you had.
Firewall rules: go to Firewall > Rules and rebuild per interface in this order:
- LAN and management rules, so you never lose GUI access.
- Internal VLAN rules.
- Guest and IoT restrictions.
- VPN interface rules.
- WAN rules.
- Floating rules, last.
Why rule order can change after migration
Rule order matters on both platforms: a broad rule placed above a specific one can override it silently.
Floating rules can override per-interface rules, but only under specific conditions. A floating rule with quick enabled stops rule evaluation the moment it matches, regardless of what the per-interface tabs would otherwise do. A floating rule scoped to the wrong direction, or to “any” interface instead of a specific one, can also catch traffic you intended to filter elsewhere.
Don’t rely on a general precedence rule to predict the outcome. After rebuilding, review the rules on each tab, including Floating, and note which ones have quick checked and which direction and interfaces they apply to. Then test both an allowed path and a path you expect to be blocked on every segment.
Say you entered a broad floating pass rule with quick checked early “just to get things working.” It can override the careful block rules on your IoT tab, and the only way you’ll catch it is by testing the block, not the pass.
The other source of drift is manual re-entry. Rules on a tab land in whatever order you type them. A broad allow rule above a restrictive block neutralizes it with no error. Compare each tab against your pfSense screenshot, row by row, before you move on.
What changed in OPNsense 26.7
OPNsense 26.7 made the newer MVC/API-based rules interface the default. The older static rule pages moved into a separate plugin, os-firewall-legacy, which you install manually, and the 26.7.5 update moved the outbound NAT page there too (CE 26.7 notes). Existing rules keep working whether or not the plugin is installed, and the migration assistant can move them into the new interface without it.
That assistant works on rules already in OPNsense. It isn’t a pfSense import tool. If you’re following a tutorial with pre-26.7 screenshots, the buttons and layout won’t match. Use the default Firewall > Rules screen. Install the legacy plugin only if you need the old pages.
Warning: Editing LAN rules over the LAN GUI can lock you out. Download a backup from System > Configuration > Backups before each major step, and keep the console session open while you work. Confirm the LAN anti-lockout or management rule exists before you touch anything else on that tab.
Step 6: Recreate DHCP Static Mappings and the Unbound DNS Resolver
Open the DHCP server settings for each interface under Services in OPNsense. Set the range, then add every static mapping: MAC, IP, hostname. Then add any custom options. DHCP options, boot filenames, and TFTP settings are the fields that don’t reliably survive any import (bigiron.cc). PXE boot clients and VoIP phones are the usual casualties.
For DNS, go to Services > Unbound DNS. Recreate host overrides, domain overrides, and access lists, and match the forwarding mode you used in pfSense. If you used DHCP registration so hostnames resolve, enable the equivalent option. Otherwise local names stop resolving after cutover.
Verify: release and renew a client with a static mapping on each VLAN. Then confirm it gets the reserved IP and resolves an internal hostname:
# On a Linux test client; replace the hostname with one of your host overrides
dig +short nas.home.arpa @192.168.1.1
192.168.1.20
Step 7: Rebuild WireGuard, OpenVPN, and IPsec
pfSense’s VPN packages and OPNsense’s VPN implementations aren’t identical, so configurations don’t carry over directly. Rebuilding each tunnel from scratch is the safest approach to avoid compatibility issues (Zenarmor).
- WireGuard: recreate the local instance and each peer under VPN > WireGuard. Reusing the server’s private key from
config.xmlmay let existing client configs keep working, but test each connection after migration to confirm. A new key pair is cleaner, but every client then needs an updated config. Re-enter tunnel addresses and allowed IPs per peer, and check them carefully. A wrong allowed-IP range routes traffic into nowhere without logging anything obvious. - OpenVPN: import or reissue the CA and server certificates under System > Trust, then rebuild the server instance. Plan to re-export client profiles. Old
.ovpnfiles often embed settings that won’t match the new server. - IPsec: rebuild phase 1 and phase 2 entries with matching proposals, and coordinate with the remote side. A site-to-site peer whose admin isn’t expecting a change is a common reason tunnels stay down after cutover.
Each VPN creates its own interface or rule tab. Add those rules now, as covered in Step 5.
Packages: pfSense packages don’t migrate, and neither do the rules they generate, such as pfBlockerNG’s automatic rules. Rebuild each package’s function from the settings, feed URLs, schedules, and allow lists you recorded in Step 1. For pfBlockerNG, DNS blocklists map to OPNsense’s built-in Unbound DNS blocklists, and IP feeds can be rebuilt as URL Table aliases referenced by ordinary firewall rules. Add those rules in the Step 5 order and test the blocks like any other rule.
Step 8: Test Every Segment Before Cutover
Simulate the real WAN by uplinking the OPNsense WAN port to a spare router or a test port. Then run this checklist per segment:
| Segment | Test | Pass condition |
|---|---|---|
| LAN | GUI access, internet, DNS | All three work from a client |
| Each VLAN | DHCP lease, gateway ping, internet | Correct subnet, reserved IPs honored |
| Guest / IoT | Blocked from LAN | Ping and HTTP to LAN hosts fail |
| DMZ / servers | Port forwards from an external network (the test WAN subnet now, a phone hotspot after cutover) | Only intended ports answer |
| VPN | One client per tunnel type | Connects and reaches allowed subnets only |
Test NAT reflection, where internal clients reach a service through the public IP, as a separate check. A port-forward test from inside the LAN doesn’t show what the internet sees.
Test the blocks as hard as the allows. A migration that “works” because everything is permitted is the failure you won’t notice for a month.
Step 9: Cut Over and Keep the Rollback Ready
Rollback stays cheap as long as pfSense is untouched. Don’t wipe, reinstall, or repurpose the pfSense box until OPNsense has run cleanly for a week or so.
Cutover:
- Label every cable on the pfSense box with its port and role.
- Power down pfSense. Don’t factory-reset it.
- Move the cables to the matching OPNsense ports from your mapping table.
- If OPNsense doesn’t get a WAN lease within a few minutes, power-cycle the ISP modem or ONT. Some cable modems only hand a lease to the first MAC address they see. Static and PPPoE WANs usually don’t need this, and if the ISP device is a router rather than a bridge, check its DHCP or bridge settings instead.
- Confirm the WAN IP on the OPNsense dashboard, then run the Step 8 checklist again on live traffic.
Rollback (if any critical segment fails):
Never connect both firewalls to the production LAN or WAN at the same time during rollback. Two DHCP servers on one segment hand out conflicting leases, and two gateways answering on the same network confuse routing and client traffic in ways that are hard to diagnose.
Power down one box completely before you move any cable toward the other, and keep OPNsense’s DHCP service disabled and its interfaces off production until it’s back on the isolated test switch.
- Power down OPNsense completely before touching any cables.
- Move the cables back to the labeled pfSense ports.
- Boot pfSense. Power-cycle the modem again only if pfSense doesn’t get its WAN lease back.
- Confirm WAN, LAN, and VPN. Then reconnect OPNsense to the test switch only, with DHCP disabled, before you debug it further.
If the pfSense hardware is also the OPNsense target, your rollback is the saved config.xml plus a pfSense CE installer on a USB flash drive. That works, but it means a full reinstall. Expect a much longer outage. Put both boxes on a UPS during the window. A power blip mid-cutover tends to corrupt the box you’re relying on.
Common Migration Problems
Rules or VLANs attached to the wrong network
Why it happens: Interface assignments weren’t verified before VLANs and rules were built on top.
Fix: Go back to Interfaces > Assignments and confirm every NIC against your mapping table. Check each VLAN’s parent under Interfaces > Other Types > VLAN. Rebuild any rules that sit on the wrong tab.
Locked out of the GUI mid-migration
Why it happens: A LAN management rule was edited or removed before a replacement was tested.
Fix: Use the console. The OPNsense console menu includes options to assign interfaces, set an interface IP address, and restore a recent configuration backup, though option wording and numbering can change between releases. Restoring the backup saved just before the change that locked you out is the cleanest way back (see the OPNsense backup docs). Then re-add a LAN pass rule to the GUI port before you continue.
Imported rules show up disabled or in the wrong order
Why it happens: A partial section import or copy-paste didn’t preserve rule state or sequence.
Fix: Delete them and rebuild from the pfSense screenshots in the order from Step 5. Check floating rules for broad passes, especially any with quick checked, that override interface tabs.
Services exposed right after connecting the live WAN
Why it happens: WAN rules and port forwards weren’t reviewed in isolation before cutover.
Fix: Disconnect the WAN. Audit Firewall > NAT > Port Forward and the WAN rules tab against the inventory, and remove anything not on the list.
Firewall rules page doesn’t match an older tutorial
Why it happens: OPNsense 26.7 changed the default rules interface and moved the legacy pages to os-firewall-legacy.
Fix: Work in the default Firewall > Rules screen. Install the legacy plugin only if you need those pages, and check menu wording against docs.opnsense.org.
Wrapping Up
Treat the config.xml export as a checklist, and it’s the most useful file in this migration. Build OPNsense in parallel, rebuild in dependency order, and leave pfSense powered off but ready to recable. A bad cutover then costs you ten minutes instead of an evening.
The tedious part is the rule rebuild. I’d budget most of your effort there, because that’s where a migration that looks fine hides a broken block rule.
| Step | Action | Applies To |
|---|---|---|
| 1 | Inventory every setting | pfSense CE |
| 2 | Export config.xml as reference | pfSense CE |
| 3 | Install and assign interfaces | OPNsense |
| 4 | Rebuild VLANs | OPNsense |
| 5 | Aliases, NAT, rules in order | OPNsense 26.7 |
| 6 | DHCP maps and Unbound DNS | OPNsense |
| 7 | Rebuild VPNs, reissue clients | OPNsense + clients |
| 8 | Test each segment | Test network |
| 9 | Cut over, keep rollback | Both |