OPNsense and pfSense are free, open-source software you can install on a spare computer to run your own firewall.
This guide is for anyone who wants more control over a home or small office network than an internet provider's router gives. Platforms are listed alphabetically in the text; the order is not a ranking.
This is an independent guide from NHI Mgmt Group, based on the public documentation of OPNsense and pfSense as of December 2026. It is not sponsored or reviewed by either project. Features change, so confirm settings against the current documentation.
In short
- Both turn a computer into a firewall and router, managed through a web page.
- They let you split one network into separate ones, called VLANs, so smart gadgets do not sit next to your laptops.
- Rules are checked in order, and traffic that matches no allow rule is blocked.
- Keeping them safe means a strong admin password, regular updates and a backup before each upgrade.
What you will learn
- Explain what an open-source firewall does in plain words.
- Describe how firewall rules and VLANs work together.
- Check the basic security steps after installing one.
- Ask whether building your own firewall suits your needs.
- Traffic guard (firewall)
- a device or program that decides which network traffic may pass.
- Separate network on the same cables (VLAN)
- a way to split one physical network into several networks that are kept apart.
- Allow or block instruction (firewall rule)
- one line that says what kind of traffic may pass, or must be stopped.
What are OPNsense and pfSense?
Think of a bouncer at the door of a club. The bouncer has a list. Anyone on it gets in, and anyone else is turned away. A firewall is that bouncer for your network.
OPNsense calls itself an open-source firewall and routing platform. It is based on FreeBSD, a free operating system[1]. The pfSense docs describe the software as a free, open-source version of FreeBSD built for use as a firewall and router[5]. Both are run from a web page, so you do not need to type commands for everyday tasks[4][5].
"Open source" means the code is public, and anyone can read it. You install the software on a computer that sits between your internet line and your own devices.
Where the comparison stops working: a bouncer can judge a face. A firewall only reads simple facts about traffic, such as where it comes from and where it is going. It follows its list exactly, mistakes included.
New to firewalls in general? Start with Firewalls for Beginners.
Why does it matter?
Many people never look at the router their provider gave them. Your own firewall gives you more say over what can talk to what. It also gives you a new job: keeping the firewall itself safe.
If you have lots of smart gadgets at home
What could happen: a cheap camera with a security flaw sits on the same network as your laptop.
Check this: put gadgets on their own VLAN that can reach the internet but not your laptops.
If you run a small office
What could happen: visitors on the guest Wi-Fi can see the office printer and shared files.
Check this: give guests a separate network with an internet-only rule.
If you are learning IT
What could happen: you leave the admin page open to the internet "for now" and forget about it.
Check this: reach the admin page only from your own trusted network.
What does it look like?
Here is a made-up, simplified list of rules for a network set aside for smart devices. Real screens show more columns.
Example only. All values are made up.
Interface: SMART_DEVICES (VLAN 0000) (1) # Action From To Note 1 Block SMART_DEVICES TRUSTED network no laptops (2) 2 Block SMART_DEVICES firewall admin no admin page (3) 3 Pass SMART_DEVICES internet updates, apps (4) (anything else: blocked) (5)
- The separate network for gadgets. In a real file, this line would show the network's name and number.
- Gadgets may not reach the trusted network with your laptops.
- Gadgets may not open the firewall's own admin page.
- Gadgets may reach the internet, so their apps and updates work.
- Traffic that matches no rule is blocked.
Why this is risky: if rule 3 sat at the top, it might also let gadgets reach your laptops, depending on how "internet" is defined. Order matters.
The safer way: put block rules for your own networks first, then the allow rule for the internet.
How does it work?
Both firewalls follow the same basic ideas. Here they are in the order you meet them.
- Traffic arrives on a port. Rules are set on the network where traffic comes in. OPNsense filters incoming traffic by default[2]. The pfSense docs say traffic only needs to be allowed on the side where it enters[6].
- Rules are checked in order. On OPNsense, for rules set to "quick", the first match wins[2]. The pfSense firewall checks rules from top to bottom and stops at the first match[6].
- Anything else is blocked. OPNsense blocks incoming traffic that matches no rule[2]. The pfSense firewall has a default deny rule that silently drops it[6].
- Replies are remembered. Both keep a "state table", a list of allowed connections, so reply traffic is let back in without a second rule[2][6].
- VLANs keep groups apart. OPNsense uses VLANs to split one physical network into several virtual ones[3]. The pfSense docs note that VLANs need a managed switch that supports the 802.1Q tagging standard[7].

Keeping the firewall itself up to date
A firewall is only as safe as its software. OPNsense publishes two major releases a year and smaller updates about every two weeks. You find them under System, then Firmware[4]. On pfSense, updates are found under System, then Update, and its upgrade guide says to make a backup and a backup plan first[8].
Both also start with a default admin account. The OPNsense installer includes a step to set a new root password[9]. The pfSense docs say to change the default password to a secure value as soon as possible[10].
A worked example
Hana Vance runs a two-person design studio from a converted garage. The studio has two laptops, a printer, a smart speaker, a doorbell camera and a guest Wi-Fi for clients.
Everything sits on one network. Hana reads about cheap cameras with security flaws and starts to worry. If the camera were attacked, nothing would stop it reaching the laptops with her client files.
She installs open-source firewall software on a small computer with four network ports, and buys a managed switch that supports VLANs. During setup she sets a long, unique admin password and stores it in her password manager.
She creates three VLANs: one for the laptops and printer, one for guests and one for smart devices. On the guest and smart device networks, she adds block rules for her trusted network and the firewall's admin page. Then she adds an allow rule for the internet below them.
To test it, she joins the guest Wi-Fi with her phone and tries to open the printer page. It does not load. The internet still works.
Hana sets a monthly reminder to check for updates. Before each larger upgrade, she downloads a backup of the settings. She keeps the admin page reachable only from the trusted network.
Myths and mistakes
| What people think | What is true |
|---|---|
| Once it is set up, I can forget about it. | Firewall software gets regular updates. Plan time to apply them, with a backup first. |
| VLANs work with any switch. | The pfSense docs say VLANs need a managed switch with 802.1Q support.[7] |
| Rule order does not matter. | The first matching rule usually wins, so a broad allow rule near the top can let through more than you meant.[6] |
| Making a VLAN keeps it apart automatically. | The rules decide what may cross. Check them, then test from each network. |
| Opening the admin page to the internet is handy and harmless. | It gives attackers a door to try. Reach it from your own network or a VPN instead. |
What can I do this week?
- List every device on your network, and group them as trusted, guest or smart device.
- Check whether your switch is a managed switch that supports VLANs.
- If you already run one of these firewalls, check for updates and save a backup.
- Make sure the admin password is long, unique and stored in a password manager.
- Test from the guest network that you cannot reach your own devices.
Checklist
- The default admin password has been changed.
- The admin page is only reachable from a trusted network.
- Smart devices and guests sit on their own VLANs.
- Block rules for my own networks sit above any broad allow rule.
- I have tested each network to see what it can reach.
- I check for updates regularly and back up settings before upgrades.
- I know how to restore the backup if an upgrade goes wrong.
Common questions
Do I need special hardware?
You need a computer that can connect both to the internet line and to your own devices, and that stays on all the time. For VLANs, pfSense says you also need a managed switch with 802.1Q support. Check each project's hardware advice before you buy.[7]
Is it better than the router from my provider?
It is different. It gives you more control, such as separate networks and detailed rules. It also needs more care, because you are responsible for updates, settings and backups yourself.
Can these firewalls run a VPN?
Yes. OPNsense lists VPN support, including IPsec and OpenVPN. The pfSense software supports IPsec, OpenVPN and WireGuard. A VPN, or virtual private network, lets you reach your home network safely while away. That is usually safer than opening the admin page to the internet.[1][11]
Where next?
Ready for the detail? Read the practitioner guide: pfSense and OPNsense Hardening Guide. It goes further into admin accounts and roles, API keys and other machine credentials on the firewall, and sending logs off the device.
Also useful:
- VLANs for Beginners
- Firewalls for Beginners
- Network Segmentation for Beginners
- Firewall Rule Review Checklist
Related NHI Mgmt Group resources: SOHO and SMB Router Hardening Guide, Edge Device Security Guide and Home Router Security for Beginners.
Key terms
- OPNsense
- Open-source firewall and routing software for filtering traffic, running VPNs and splitting networks.
- pfSense
- Open-source firewall and routing software used to control network traffic and VPN access.
- Firewall rule
- An instruction that allows or blocks traffic based on where it comes from, where it goes and what kind it is.
- Default deny
- Blocking everything unless a rule allows it.
- Stateful firewall
- A firewall that remembers allowed connections so replies can come back in.
- VLAN
- A separate virtual network that shares the same cables and switches as others.
- Network segmentation
- Splitting a network into zones so trouble in one zone is less likely to spread.
Sources and further reading
- OPNsense, "Introduction", OPNsense documentation. https://docs.opnsense.org/intro.html (accessed 1 Dec 2026).
- OPNsense, "Rules" (Firewall), OPNsense documentation. https://docs.opnsense.org/manual/firewall.html (accessed 1 Dec 2026).
- OPNsense, "Other Types" (VLAN and other interfaces), OPNsense documentation. https://docs.opnsense.org/manual/other-interfaces.html (accessed 1 Dec 2026).
- OPNsense, "Updates", OPNsense documentation. https://docs.opnsense.org/manual/updates.html (accessed 1 Dec 2026).
- Netgate, "pfSense Software" (general information), pfSense documentation. https://docs.netgate.com/pfsense/en/latest/general/index.html (accessed 1 Dec 2026).
- Netgate, "Firewall Rule Fundamentals", pfSense documentation. https://docs.netgate.com/pfsense/en/latest/firewall/fundamentals.html (accessed 1 Dec 2026).
- Netgate, "Virtual LANs (VLANs)", pfSense documentation. https://docs.netgate.com/pfsense/en/latest/vlan/index.html (accessed 1 Dec 2026).
- Netgate, "Upgrade Guide", pfSense documentation. https://docs.netgate.com/pfsense/en/latest/install/upgrade-guide.html (accessed 1 Dec 2026).
- OPNsense, "Installation and setup", OPNsense documentation. https://docs.opnsense.org/manual/install.html (accessed 1 Dec 2026).
- Netgate, "Default Username and Password", pfSense documentation. https://docs.netgate.com/pfsense/en/latest/usermanager/defaults.html (accessed 1 Dec 2026).
- Netgate, "Virtual Private Networks", pfSense documentation. https://docs.netgate.com/pfsense/en/latest/vpn/index.html (accessed 1 Dec 2026).