MikroTik + OPNsense + Zenarmor · NGFW Guide

Adding a Next-Gen Firewall to Your MikroTik Network

Run OPNsense with Zenarmor on a dedicated device on your LAN — adding deep packet inspection, application control, and threat intelligence without replacing your MikroTik router.

What This Guide Sets Up

MikroTik handles your routing and internet connection as normal. OPNsense sits on your LAN as an inline firewall — all traffic passes through it before reaching your devices, giving you application-layer visibility and control that RouterOS alone can’t provide.

NETWORK TOPOLOGY

Internet

MikroTik (router/WAN — does what it’s always done)
│ LAN traffic

OPNsense + Zenarmor (inline NGFW — inspects all traffic)
│ clean traffic only

CRS326 switch → your LAN devices

MikroTik LAN IP: 192.168.88.1 (your existing gateway)
OPNsense WAN IP: 192.168.88.2 (gets internet from MikroTik)
OPNsense LAN IP: 10.0.0.1 (new gateway for your devices)
Your devices: 10.0.0.x (DHCP from OPNsense)
MikroTik roleStays as your internet router and WAN gateway. No changes to its core config.
OPNsense roleInline NGFW — sits between MikroTik and your LAN. Runs DHCP, DNS, and Zenarmor.
Zenarmor roleNGFW plugin — app control, web filtering, TLS inspection, threat dashboard.
CRS326 rolePure Layer 2 switch — connects to OPNsense LAN port, distributes to devices.

Hardware — Pi 5 vs Mini PC

OPNsense’s officially supported platform is x86-64. ARM64/Pi support exists via community-built experimental images that are not official releases. For a production home setup, a cheap x86 mini PC is a much more reliable foundation — and frankly better value for money.

  • Official OPNsense support
  • All plugins including Zenarmor work fully
  • Intel N100 / N150 chips: ~$100–150 AUD
  • Usually has 2–4 built-in Ethernet ports
  • Runs cool and quiet, ~10W idle
  • Examples: Trigkey N100, Beelink EQ12, Topton N6005
⚠ Experimental — Raspberry Pi 5
  • No official OPNsense ARM64 image
  • Community images only — use at your own risk
  • Only one built-in Ethernet port (need USB NIC for WAN+LAN)
  • Zenarmor performance will be limited
  • May work fine — just less supported
  • Pi 5 steps covered separately below

This guide primarily covers the x86 mini PC path, which is the recommended setup. Pi 5 specific notes are called out where the steps differ.

⚠ You need two network interfaces on your OPNsense machine — one for WAN (connects to MikroTik) and one for LAN (connects to your switch/devices). Most mini PCs designed for firewall use have dual or quad ports built in. If using a Pi 5, you’ll need a USB 3.0 Gigabit Ethernet adapter for the second interface.

Prerequisites

OPNsense machinex86 mini PC with 2+ Ethernet ports, 4GB+ RAM, 32GB+ storage (SSD preferred)
OPNsense imageDownload from opnsense.org — AMD64 DVD or memstick image
USB drive8GB+ to write the installer image onto
Balena EtcherFree tool to write the image to USB (balena.io/etcher)
Monitor + keyboardNeeded for initial OPNsense setup
MikroTik accessYou’ll make a small change to its config at the end

Part 1 — Install OPNsense

1
Download and Write the OPNsense Image

Go to opnsense.org/download and download the latest release. Select:

  • Architecture: amd64
  • Image type: dvd (for USB installer) or memstick-serial if the machine has no video out
  • Mirror: pick one geographically close to you

The file will be a .iso.bz2 or .img.bz2. Extract it, then write it to your USB drive using Balena Etcher — just select the file, select your USB drive, and click Flash.

ℹ Pi 5 path: There is no official OPNsense image for the Pi 5. The community project by yrzr builds ARM64 images compatible with Pi 3b/4b — Pi 5 compatibility is not guaranteed and requires manual config.txt tweaks. If you want to proceed with a Pi 5, search for “yrzr opnsense aarch64” for the latest images and forum guidance. The rest of this guide assumes x86.
2
Boot and Install OPNsense

Plug the USB drive into your mini PC, connect a monitor and keyboard, and power it on. Enter the BIOS (usually F2, F12, or Del) and set USB as the first boot device.

OPNsense will boot to a login prompt. Log in with:

OPNsense console
Username: installer
Password: opnsense

Follow the installer wizard:

  • Accept the default keymap (or select yours)
  • Choose Install (ZFS) — ZFS is more resilient than UFS for an always-on appliance
  • Select your storage disk when prompted
  • Set a root password when asked
  • Let it install and reboot — remove the USB when prompted
3
Assign Interfaces at First Boot

After reboot, OPNsense will ask you to assign network interfaces. It will list the interfaces it detected (e.g. igc0, igc1).

When asked “Do you want to configure VLANs now?” — type n and press Enter.

Assign interfaces:

  • WAN: the port connected (or that will connect) to your MikroTik LAN
  • LAN: the port connected to your CRS326 switch
ℹ Tip: If you’re unsure which interface is which, unplug all cables, then plug a cable into just one port and type ifconfig to see which one shows a link — that’s the port you just plugged into.
4
Set the LAN IP Address

From the OPNsense console menu, select option 2) Set interface IP address, then choose LAN. Configure it as:

  • IPv4 address: 10.0.0.1
  • Subnet mask: 24
  • No IPv6 for now
  • Enable DHCP server on LAN: Yes
  • DHCP start: 10.0.0.10
  • DHCP end: 10.0.0.200

OPNsense will now hand out IPs to any device connected to your LAN port or CRS326 switch.


Part 2 — Configure OPNsense via Web Interface

Connect a laptop to the CRS326 switch (or directly to the OPNsense LAN port). You should get an IP in the 10.0.0.x range. Open a browser and go to https://10.0.0.1 — accept the self-signed certificate warning.

Log in with root and the password you set during install.

5
Run the Setup Wizard

OPNsense launches a setup wizard on first login. Work through it:

  • Hostname: e.g. opnsense
  • Domain: e.g. home.lan
  • Primary DNS: 1.1.1.1 (or your Pi-hole IP if you have one)
  • WAN type: DHCP — OPNsense will get its WAN IP from MikroTik
  • LAN IP: 10.0.0.1 (already set)
  • Set a new admin password

Complete the wizard. OPNsense will reload.

6
Configure the WAN Interface

Go to Interfaces → WAN. Since OPNsense is sitting behind MikroTik (not directly on the internet), disable the options that assume WAN is exposed directly:

  • Uncheck Block private networks
  • Uncheck Block bogon networks

Save and apply. OPNsense’s WAN will get an IP from MikroTik’s DHCP (e.g. 192.168.88.x).

ℹ Why? MikroTik is already handling the internet edge. OPNsense’s WAN is technically a private LAN IP from MikroTik’s perspective — so blocking “private networks” on WAN would block MikroTik itself.
7
Update OPNsense Firmware

Before adding anything else, update to the latest release. Go to System → Firmware → Updates and click Check for Updates. Install all available updates and reboot if required.

OPNsense console (alternative method via SSH)
opnsense-update -u && opnsense-update -p

Part 3 — Install Zenarmor

8
Install the Zenarmor Plugins

Zenarmor requires two plugins to be installed. Go to System → Firmware → Plugins and search for zenarmor. Install both:

  • os-sunnyvalley — the vendor repository (install this first)
  • os-zenarmor — the main Zenarmor engine

Click the + button next to each. After both are installed, go to System → Firmware → Updates and run an update to pull the latest Zenarmor packages.

ℹ Note: After installing os-sunnyvalley, you may need to refresh the plugin list before os-zenarmor appears.
9
Run the Zenarmor Setup Wizard

A new Zenarmor menu will appear in the sidebar. Click it to launch the setup wizard. Work through each screen:

Packet engine: Choose Netmap if available (faster, recommended for x86). If unavailable, choose NFQ.

Database backend: Choose SQLite — MongoDB is being deprecated as of September 2025 and SQLite is the recommended option for home use.

Interface selection: Select your LAN interface. This is the interface Zenarmor will inspect traffic on. Leave WAN unchecked unless you have a specific reason.

Subscription: Select Get Me the Free Edition. You can optionally enter your email to stay updated. The Free Edition is permanently free with no expiry.

Click Complete to finish setup. Zenarmor will start its engine — this may take a minute.

10
Configure Zenarmor Policies

Go to Zenarmor → Policies → Default. The free tier uses a single catch-all policy that applies to all traffic. Configure the two main tabs:

Web Controls tab — block categories of websites. Recommended starting blocks:

  • Malware / Phishing / Command & Control
  • Ads & Trackers (optional — may break some sites)
  • Adult Content (if applicable)

App Controls tab — block or monitor applications regardless of port or domain. Zenarmor can identify apps by their traffic patterns. Useful blocks:

  • Anonymizers / Proxies / Tor
  • Peer-to-peer (if you want to restrict it)
  • Cryptomining

Click Save Changes after each tab.

⚠ Go carefully with App Controls — blocking broad categories can catch legitimate traffic. If family members start complaining something doesn’t work, check the Zenarmor dashboard first before assuming it’s unrelated.

Part 4 — Route Your LAN Traffic Through OPNsense

At this point OPNsense is running but your LAN devices are still getting their gateway from MikroTik. You need to physically wire the network correctly and optionally adjust MikroTik’s DHCP so devices use OPNsense as their gateway.

11
Wire the Network Correctly

The physical layout should be:

Physical connections
MikroTik LAN port  ──►  OPNsense WAN port  (cable 1)
OPNsense LAN port  ──►  CRS326 port 1      (cable 2)
CRS326             ──►  all your LAN devices

Your MikroTik hAP ax³ Wi-Fi clients won’t go through OPNsense unless you also connect the hAP ax³ to the CRS326 as a downstream AP. To get all traffic through OPNsense:

  • Connect the hAP ax³ LAN port to the CRS326 (not to its own WAN/internet port)
  • Disable DHCP on the hAP ax³ LAN (so OPNsense handles DHCP for Wi-Fi clients too)
ℹ Tip: If you want to do this gradually — wired devices through OPNsense first, Wi-Fi later — that’s fine. Start with the wired side.
12
Make MikroTik Aware of the OPNsense Subnet

MikroTik needs a static route so it knows that the 10.0.0.0/24 subnet (your devices) is reachable via OPNsense’s WAN IP. Without this, MikroTik can’t reach your devices if you ever need to manage them, and the return path for some traffic may break.

First, give OPNsense a static WAN IP on MikroTik’s DHCP so it doesn’t change:

RouterOS terminal
# Find OPNsense's MAC address first
/ip/arp/print

# Add a static DHCP lease for OPNsense's WAN interface
/ip/dhcp-server/lease/add \
  mac-address=XX:XX:XX:XX:XX:XX \
  address=192.168.88.2 \
  comment="OPNsense WAN"

Then add a static route so MikroTik knows about the OPNsense LAN subnet:

RouterOS terminal
/ip/route/add \
  dst-address=10.0.0.0/24 \
  gateway=192.168.88.2 \
  comment="OPNsense LAN subnet"

Verifying Everything Works

✓ Checklist — your setup is working when:
  • Devices connected to the CRS326 get a 10.0.0.x IP address
  • You can browse the internet normally from those devices
  • The Zenarmor dashboard at Zenarmor → Dashboard shows traffic flowing
  • The Query Log shows DNS lookups being processed
  • Blocked categories show hits after normal browsing

To confirm OPNsense is in the traffic path, run a traceroute from a LAN device — you should see 10.0.0.1 as the first hop:

Windows
tracert 1.1.1.1
macOS / Linux
traceroute 1.1.1.1

The first hop should be 10.0.0.1 (OPNsense), then 192.168.88.1 (MikroTik), then your ISP.


Zenarmor Free Edition — What You Get

Feature Free Home (paid)
App identification & control ✅ Yes ✅ Yes
Web category filtering ✅ Pre-set categories ✅ Custom categories
Threat intelligence blocking ✅ Yes ✅ Yes
Dashboard & reporting ✅ Yes ✅ Advanced
Multiple policies ❌ One catch-all policy only ✅ Per-device / per-user policies
TLS inspection
Number of devices Up to ~100 (SQLite) Unlimited
Cost Free forever Paid subscription

For a home network the Free Edition covers the most important bases — app control, category filtering, and threat blocking. The paid Home tier is worth it if you want per-device policies (e.g. different rules for kids’ devices vs adults).


Troubleshooting

Devices aren’t getting a 10.0.0.x IP

Check the physical cabling — devices need to be connected to the CRS326, which connects to OPNsense’s LAN port. Verify OPNsense’s DHCP server is running under Services → DHCPv4 → LAN. Check that the lease range is configured and the service is enabled.

Internet isn’t working from LAN devices

Confirm OPNsense’s WAN interface has an IP from MikroTik (Interfaces → WAN should show a 192.168.88.x address). Check that NAT is enabled — go to Firewall → NAT → Outbound and ensure automatic outbound NAT is selected. Also check the firewall rules under Firewall → Rules → LAN allow traffic out.

Zenarmor dashboard shows no traffic

Make sure Zenarmor is set to inspect the correct interface. Go to Zenarmor → Settings → Interfaces and confirm your LAN interface is selected. If you changed interfaces after setup, restart the Zenarmor engine from Zenarmor → Settings → Updates & Support → Restart Engine.

Some sites or apps stop working after enabling Zenarmor

Check Zenarmor → Dashboard → Blocked Connections to see what was blocked. You can add exceptions in the policy settings. Start with more permissive category settings and tighten over time once you know what’s normal on your network.

Can’t reach OPNsense web interface after wiring changes

If you’ve changed cables and lost access, connect a laptop directly to OPNsense’s LAN port. You should get a 10.0.0.x address and reach https://10.0.0.1. From the console you can also reset the interface config using option 2 from the menu.


Quick Reference

ItemValue
OPNsense web interfacehttps://10.0.0.1
OPNsense WAN IP (from MikroTik)192.168.88.2 (static lease)
OPNsense LAN / gateway10.0.0.1
DHCP range for devices10.0.0.10 – 10.0.0.200
Zenarmor dashboardOPNsense sidebar → Zenarmor → Dashboard
Install Zenarmor pluginsSystem → Firmware → Plugins → search “zenarmor”
Default OPNsense loginroot / password set during install
Check OPNsense updatesSystem → Firmware → Updates
MikroTik static route/ip/route/add dst-address=10.0.0.0/24 gateway=192.168.88.2

Uses OPNsense (BSD licence) and Zenarmor Free Edition · Guide last updated June 2026

Leave a Comment

Your email address will not be published. Required fields are marked *