Spamhaus IP Block List on OPNsense
Steps:
- Log in to your OPNsense GUI.
- Before you make changes to your Firewall, always make sure you download a copy of your settings first:
- Log in to your OPNsense machine
- Select System
- Select Configuration
- Select Backups
- Select Download Configuration
- Navigate to Firewall > Aliases > (Select the + Icon bottom right).
- Click the + Add button to create a new alias.
- Give the alias a descriptive name, e.g.,
SpamhausBlocklist. - Set Type to URL Table (IPs).
- In the Content field, enter the URL(s) of the Spamhaus or other IP blocklists. For example:
- Spamhaus DROP list:
https://www.spamhaus.org/drop/drop.lasso - Blocklist.de:
https://lists.blocklist.de/lists/all.txt
- Spamhaus DROP list:
- Enable Update frequency as desired (daily, weekly, etc.) to keep the list fresh.
- Click Save and then Apply Changes.
- Now, create firewall rules to block traffic matching this alias.
- Go to Firewall > Rules, select the interface, and add a rule blocking traffic from these IPs.
- Action: Block
- Interface: WAN
- Direction: in
- Source: SpamhausBlocklist
- Description SpamhausBlocklist
- Go to Firewall > Rules, select the interface, and add a rule blocking traffic from these IPs.
- Apply the firewall rule changes.
The firewall will block incoming connections from IPs known for spam or malicious activity.