pfSense and OPNsense can load address lists straight from a URL into the firewall's table. The box at the edge then drops known attack infrastructure without a rule per address — one feed URL does it. This guide covers wiring the IP-DB.com feed into both products, putting the rule in the right place, verifying with pfctl that it actually loaded, and keeping false positives under control.
1. Build the feed URL
Both products can only authenticate through the URL, so the key rides in the query string. Create an API key in the panel and assemble an address of this shape:
What the parameters do: format=cidr appends /32 to every line (/128 for IPv6), min_score returns only addresses above the given value, category narrows to a single abuse type, and limit trims the line count. Left alone, the list carries as many lines as your account's feed quota allows. Open the URL in a browser once and confirm you see the list you expect — a device fetching an empty list is the most common mistake.
The threshold is a decision. A low min_score means more coverage and more false positives. For inbound blocking the 60–70 band is a sensible start; outbound, prefer 85 and above.
2. pfSense: with pfBlockerNG
With pfBlockerNG installed (System → Package Manager), the steps are:
- Firewall → pfBlockerNG → IPv4 → Add.
- Name:
IPDB_Blocklist. The name becomes the table name; avoid spaces and hyphens. - Format: Auto. Source: the feed URL above. State: ON.
- Action: start with
Deny Inbound. Add the outbound direction later. - Update Frequency: Every hour.
- Logging: Enabled — the first week's data is the only thing that tells you whether the threshold is right.
Save, then run a Force Update from the Update tab. The log should show the downloaded line count and a "Saved" line.
3. OPNsense: with a URL table alias
OPNsense needs no extra plugin — an alias does the same job:
- Firewall → Aliases → +.
- Type:
URL Table (IPs). Name:ipdb_blocklist. - Content: the feed URL. Refresh Frequency: 0 days, 1 hour.
- Save, then Apply.
Then add a rule under Firewall → Rules → Floating: Action Block, Interface WAN, Direction in, Source set to the alias, and leave Quick ticked. The rule has to be among the first blocking rules; further down it is shadowed by an "allow" above it.
The saved list is on disk too: /var/db/aliastables/ipdb_blocklist.txt. An empty file means the problem is not the feed but the box's internet access or DNS.
4. Verify that it loaded
The interface saying "saved" does not mean the table reached the packet filter. Check from the shell:
If the count is lower than you expect you may have hit the table capacity; that limit lives under System → Advanced → Firewall & NAT on pfSense and Firewall → Settings → Advanced on OPNsense.
5. Keep false positives in hand
The cost of a blocklist at the edge is the one customer it blocks by mistake. Three measures remove that in practice:
- Exempt your own networks. Build a separate "allow" alias for the management network, monitoring servers, VPN egress and partner addresses, and place it above the blocking rule.
- Log before you block. pfBlockerNG offers
Alertas an action; on OPNsense, leave the rule as a logged match rather than a Block for a week and watch. - Set the threshold from data. If a familiar address shows up in the log, look it up — the source breakdown shows why it is listed. If it is wrong, tell us and the record is deleted.
6. Feed your own data back
The traffic your firewall drops is a data source that can improve the pool. Two ways: report brute-force and scan events with POST /api/v1/report, or run a honeypot sensor on a separate machine and leave the judgement to us. Either moves your account to the contributor tier. Ready-made scripts are on the integrations page.
Frequently asked questions
How many addresses can one alias hold?
The limit is not in the alias but in the packet filter's table capacity. On pfSense the "Firewall Maximum Table Entries" field under System → Advanced → Firewall & NAT governs it, and the default sits in the hundreds of thousands; OPNsense has the equivalent under Firewall → Settings → Advanced. As long as you pull the feed with ?limit= within your account's quota you will not come close. If the table overflows the rule quietly works on a partial list, which is why verifying the entry count with pfctl matters.
How often should the feed refresh?
The snapshot is rebuilt on a fixed interval, so an hourly refresh is more than enough. The endpoint returns ETag and Last-Modified: when nothing has changed your device gets a 304 and does not re-download the list. Refreshing every minute brings no new data and only spends quota.
Should I pick Deny Inbound or Deny Both?
Blocking inbound is the low-risk start: it cuts scans and brute-force attempts from outside and leaves your internal users alone. Both directions additionally stop a compromised internal client from reaching its command-and-control server, but then a false positive hits a user directly. A practical order: inbound only first, watch the logs for a week, then add the outbound direction with a higher min_score threshold.
Should I fetch the list as bare addresses or as CIDR?
Either format works. URL table aliases and pfBlockerNG read a plain address list without trouble; ?format=cidr appends /32 to every line (/128 for IPv6) and produces fewer surprises with some parsers. For mixed IPv4/IPv6 lists, prefer CIDR.
For other devices see our FortiGate and Palo Alto EDL guides, for the server side the fail2ban and nftables post, and for picking a threshold the scoring post.
Comments 0
Share a question, your experience or a correction. You can comment as a registered user or anonymously.
No comments yet. Be the first.