You enable IDS/IPS in OPNsense at Services > Intrusion Detection > Administration, where the built in Suricata engine lives. Turn it on in detection mode first so it only raises alerts, download a ruleset, confirm that alerts actually appear, and only then switch on IPS mode so matching traffic is dropped instead of merely logged. That order matters: prevention switched on blind can block legitimate traffic you never saw alerting, while detection first shows you exactly what the rules would have done.
What IDS and IPS actually mean here
An intrusion detection system (IDS) watches traffic and records an alert when a packet or flow matches a known pattern, such as a connection to a known malicious host or a request that looks like an exploit attempt. It does not interfere with the traffic itself. An intrusion prevention system (IPS) uses the same detection engine, but sits in a position where it can drop the matching traffic before it reaches its destination. In OPNsense both jobs are done by one engine, Suricata, and the difference between IDS and IPS is a mode setting, not a different product. The current OPNsense series ships Suricata 8.0.6, and the engine is part of the system: there is no separate package to install before you can use it.
Suricata decides what to flag by comparing traffic against rules. Rules are grouped into rulesets published by security research teams, and each rule has a default action, usually alert. When you enable a ruleset, you are telling the engine which patterns to look for. A policy can then change the default action of a whole ruleset, for example from alert to drop, which is how you fine tune prevention without editing individual rules by hand.
Before you switch anything on
Two preparation steps are easy to skip and expensive to debug later, because both can make IPS mode silently fail to work as expected.
- Update OPNsense to the latest release in its series first, using System > Firmware > Status. The official IPS guidance treats a current system as a prerequisite, and rule behaviour is written against current releases.
- Disable all hardware offloading under Interfaces > Settings, then reboot. With offloading enabled, parts of the traffic bypass the inspection path, and the official documentation is explicit that IPS mode will not function correctly until offloading is off.
- Check your headroom. Suricata keeps alerts in a local database and inspects traffic in memory, so very small systems feel it first. The official sizing tiers note that the minimum hardware tier excludes the IDS/IPS alert database, which is a hint that detection belongs on the reasonable tier or above for anything beyond a quick look.
- Take a configuration backup (System > Configuration > Backups) so you can return to a known state if a ruleset misbehaves. Our guide to backing up and restoring an OPNsense configuration covers the download and restore path.
If your firewall runs in a virtual machine, the offloading step matters twice, because hypervisor network settings can reintroduce the same bypass. The general advice in our VM sizing guide about disabling offloading for virtual installs applies here as well.
Step 1: Enable Suricata in detection mode
Open Services > Intrusion Detection > Administration and work through the general settings:
- Tick Enable to start the intrusion detection service.
- Leave IPS mode unticked for now. Unticked means detection only: alerts are recorded and nothing is dropped.
- Choose the interfaces Suricata should listen on. Start with your WAN interface, because that is where unsolicited inbound traffic and the replies to your outbound requests arrive. Adding LAN later is reasonable once you know the alert volume.
- Apply the settings and confirm the service is running.
Choosing interfaces deserves a moment of thought. Every interface you add multiplies the traffic the engine must inspect, and on a busy LAN that can be far more traffic than the WAN side ever sees. Starting with WAN only keeps the first days of alerts readable: you see what the internet is sending at you, plus anything suspicious your own devices request, without drowning in ordinary local chatter.
Step 2: Download and enable rulesets
An enabled engine with no rules detects nothing, so the next step is choosing rulesets. Still on the Administration page, use the ruleset download area:
- Click Download & Update Rules to fetch the available rulesets.
- Enable the rulesets that match your network. A sensible starting point for a home or small office network is a small number of well maintained sets covering malware command and control, known hostile scanners, and current exploit attempts, rather than every set on the list.
- Apply, and let the engine reload with the new rules.
- Set up a schedule for regular rule updates on the scheduling settings, so the rulesets refresh automatically instead of ageing quietly. Threat feeds change daily; a ruleset from installation day protects you against last season's problems.
Resist the urge to enable everything. Each additional ruleset adds alerts, and alert fatigue is the main reason home IDS setups get abandoned: when the alert view shows hundreds of low value entries a day, the one entry that matters becomes invisible. A short list you actually read beats a long list you ignore. You can always add a set later when you understand what it contributes.
| Choice | What it gives you | What it costs |
|---|---|---|
| One or two core rulesets | Readable alerts, low overhead | Narrower coverage of exotic threats |
| Many rulesets at once | Broad pattern coverage | Alert noise, more memory and CPU use, more false positives |
| Rulesets plus a drop policy immediately | Prevention from day one | Risk of blocking legitimate traffic you never reviewed |
Step 3: Confirm detection works with a test alert
Do not move to prevention until you have proof that detection fires. An empty alert view after an hour can mean a quiet network, but it can also mean the engine is not inspecting the interface you think it is. You need a deliberate, harmless trigger.
A practical check is to generate traffic that a common ruleset is designed to flag, such as a request to a known test or blocklist style resource that your enabled rulesets cover, or simply waiting for the background noise of the public internet, which on a WAN interface usually produces scanner alerts within a day. The deliberate option is better, because it gives you a timestamp to look for.
- Note the time, then generate the test traffic from a device behind the firewall.
- Open the alert view under Services > Intrusion Detection and look for an entry at that time.
- Confirm the alert names the expected rule and shows the source and destination you expect.
- If nothing appears, recheck the basics in order: service enabled, correct interface selected, rulesets downloaded and enabled, and offloading disabled with a reboot afterwards.
Seeing that alert is your confirmation that the whole chain works: traffic reaches the engine, rules are loaded, and alerts are being written where you can read them. Only with that proof does switching modes mean anything.
Step 4: Move from IDS to IPS mode
After a few days of detection, read your alerts with one question in mind: if this traffic had been dropped, would anything I care about have broken? Alerts fall into three rough groups:
- Clearly hostile: scans, exploit probes, and connections to known malicious infrastructure aimed at your network. Dropping these is the point of IPS.
- Informational noise: odd but harmless traffic that a rule happens to match. These are candidates for leaving as alert only.
- Your own legitimate traffic: anything you recognise as a real service you use. These rules must never drop, or you will block yourself.
When you are satisfied, return to Services > Intrusion Detection > Administration, tick IPS mode, and apply. From that moment, rules whose action is drop will block matching traffic inline. To control which rules drop, use policies: a policy takes a ruleset and changes its default action, for example from alert to drop. Apply drop policies ruleset by ruleset rather than globally, starting with the set whose alerts were unambiguously hostile during your detection period. Leave noisier sets alerting until you trust them.
After enabling IPS mode, repeat your test traffic from Step 3. This time the expected result is different: the attempt should fail to complete, and the alert view should show the event with a drop action. That pair, a blocked attempt plus a recorded drop, is how you confirm prevention works rather than merely being switched on.
Everyday running: alerts, tuning and updates
An IPS is a garden, not a monument. Expect a short weekly routine:
- Skim new alerts for anything sourced from inside your network. An alert about an external scanner is routine; an alert about your own device reaching out to malicious infrastructure is a problem on that device, and no firewall setting fixes it for you.
- When a rule repeatedly fires on traffic you know is legitimate, adjust that rule or its policy instead of ignoring the alert view. Every ignored false positive trains you to ignore the real ones.
- Keep the scheduled ruleset updates running, and keep OPNsense itself updated; the update routine in our guide to updating OPNsense safely pairs naturally with IPS work because both touch the same firmware pages.
- Watch resource use after adding rulesets or interfaces. Slower internet after enabling IPS usually means the hardware is inspecting more than it can comfortably handle, and the honest fixes are fewer interfaces, fewer rulesets, or better hardware, in that order.
Common problems and their fixes
IPS mode is on but nothing is ever dropped
The classic cause is hardware offloading still enabled. Check Interfaces > Settings, disable all offloading options, and reboot; changing the setting without the reboot leaves the old behaviour in place. Also confirm that the rules firing have a drop action, either by default or through a policy, because IPS mode alone does not convert every alert into a drop.
The alert view stays empty
Work backwards through the chain: is the service enabled, is the interface you are testing through actually selected, were rulesets downloaded and enabled, and did you generate traffic that a rule should match? An empty view on a LAN only setup can simply mean a quiet network; test through the WAN side before assuming breakage.
A legitimate service broke after enabling IPS
Find the alert that matches the time and the service, note its rule, and change that rule's action back to alert, or disable just that rule. Resist turning the whole engine off: one overmatching rule is a tuning problem, not a reason to lose protection everywhere else.
Performance dropped noticeably
Reduce scope before reducing protection: remove the LAN interface if you added it speculatively, trim rulesets you never read, and check whether your hardware sits in the minimum sizing tier, which the official sizing guide does not intend for the IDS/IPS alert database at all.
Where IDS/IPS fits in the bigger picture
Suricata watches for known bad patterns; it does not replace the other layers of a sensible setup. Segmentation limits what a compromised device can reach, which is the subject of our VLAN setup guide, and a VPN keeps remote access off the public internet entirely, as covered in our WireGuard setup guide. Detection and prevention complete that picture by telling you what the other layers are seeing, and by quietly dropping the traffic that should never have arrived.
How the engine matches traffic, in plain terms
Suricata is not guessing. Each rule describes a pattern: a destination known to host malware command and control, a request shape associated with a specific exploit, a protocol oddity that legitimate software rarely produces. When traffic matches, the engine records the rule's name, the addresses involved, and the action taken. That is why reading alerts is a skill worth building: the rule name usually tells you what the pattern was, and the addresses tell you whether the traffic was aimed at you from outside or started by one of your own devices reaching out. Those two directions mean opposite things. Inbound matches are the internet being the internet, and mostly they are background radiation. Outbound matches mean something on your network asked for a bad destination, and that is the alert that deserves your evening.
It also explains the limits honestly. A pattern based engine cannot flag a threat nobody has written a rule for yet, and encrypted traffic hides its contents from inspection unless you add decryption, which is a much bigger project with real privacy and breakage costs. Treat IDS/IPS as a strong layer with known edges, not as a guarantee, and size your other defences accordingly.
Start in detection, prove it with a test alert, promote carefully to prevention with per ruleset policies, and keep tuning. That sequence gives you an IPS you understand, instead of a switch you flipped and hope for the best.