IPv64 Logo IPv64 Blocklists - Integration Guide

The IPv64.net blocklists can be easily integrated into many different systems and actively used. Simply use these instructions to integrate them into your systems or infrastructure.

pfSense - How to add Blocklists to pfSense?
pfSense Logo

A "pf solution" is very often used as a firewall. pfSense provides the market with an outstanding product in the form of its firewall solution and, if desired, even offers a community version free of charge.

  1. Choose Blocklist
    1. Select one or more IPv64.net blocklists. Copy the URL of IPv64 to your clipboard.
  2. Add Blocklist as alias
    1. Navigate to Firewall > Aliases in pfSense.
    2. Click on the plus icon , to create a new alias table.
    3. Select the type URL Table and enter a name for the alias table.
    4. Save your entries for the alias
  3. Add Blocklist to Firewall Rules
    1. Go to Firewall > Rules.
    2. Select the appropriate interface (usually WAN) and create a new rule.
    3. Set the source to any and the target to the alias table (you have chosen the name yourself).
    4. Set the action to Block and save the rule.
  4. You are safe
OPNsense - How to add Blocklists to OPNsense?
OPNsense Logo

A "pf solution" is very often used as a firewall. OPNsense provides the market with an outstanding product in the form of its firewall solution and, if desired, even offers a community version free of charge.

  1. Choose Blocklist
    1. Select one or more IPv64.net blocklists. Copy the URL of IPv64 to your clipboard.
  2. Add Blocklist as alias
    1. Navigate to Firewall > Aliases in pfSense.
    2. Click on the plus icon , to create a new alias table.
    3. Select the type URL Table and enter a name for the alias table.
    4. Save your entries for the alias
  3. Add Blocklist to Firewall Rules
    1. Go to Firewall > Rules.
    2. Select the appropriate interface (usually WAN) and create a new rule.
    3. Set the source to any and the target to the alias table (you have chosen the name yourself).
    4. Set the action to Block and save the rule.
  4. You are safe
IPsets - How to add Blocklists to Debian/Ubuntu with IPsets?
Tux Linux Logo

IPTables are a common method for effectively blocking IP addresses and subnets. We use the "ipset" command to create IP lists. You may need to install the ipsets package later with "apt install ipset".

What is this script doing?
This script is a bash script that downloads a list of IP addresses and subnets from a given URL, stores them in an ipset list, and then creates an iptables rule to block traffic from those IP addresses and subnets.

#!/bin/bash

# URL from which to download the IP addresses and subnets
URL="https://ipv64.net/blocklists/ipv64_blocklist_blocklistde_all.txt"

# Name of the ipset list
IPSET_LIST="blocked_ips"

# File to store the downloaded IP addresses and subnets
IP_LIST_FILE="/tmp/ip_list.txt"

# Check if the ipset list already exists
if ! ipset list $IPSET_LIST &>/dev/null; then
    # Create the ipset list if it doesn't exist
    ipset create $IPSET_LIST hash:net
else
    # Delete and recreate the ipset list to update it if it exists
    ipset destroy $IPSET_LIST
    ipset create $IPSET_LIST hash:net
fi

# Download the IP addresses and subnets from the URL and save them to the file
curl -s $URL > $IP_LIST_FILE

# Read IP addresses and subnets from the file and add them to the ipset list
while IFS= read -r line; do
    ipset add $IPSET_LIST $line
done < $IP_LIST_FILE

# Create or update the iptables rule to block traffic from the IP addresses and subnets in the ipset list
iptables -A INPUT -m set --match-set $IPSET_LIST src -j DROP

# Save the iptables rules
iptables-save > /etc/iptables/rules.v4
			
Mikrotik - How to add Blocklists to Mikrotik?
Mikrotik Logo

You can use this list just as easily with a Mikrotik Router/Firewall. In this case we simply use a Mikrotik script and add this IPv64 Blocklist to a firewall IP list. The script does this fully automatically for you.

Click on System -> Scripts -> Button

:local url "https://ipv64.net/blocklists/ipv64_blocklist_blocklistde_all.txt"
:local listName "IPv64-Blocklist"

# Inhalte von der URL herunterladen
/tool fetch url=$url mode=http

:local fileContents [/file get [/file find name="ipv64_blocklist_blocklistde_all.txt"] contents]
:local ipAddressList [:toarray $fileContents]

# IP-Adressen extrahieren und der Firewall-Adressliste hinzufügen
:foreach ip in=$ipAddressList do={
    /ip firewall address-list add address=$ip list=$listName
}

The filter rule must be added once and the entire IP list is on the block list.
ip firewall filter add action=drop src-address-list=IPv64-Blocklist chain=input

IPv64 Logo Minimal

First Level Protection with IPv64.net

With IPv64.net you can effectively protect your systems and infrastructures against various attacks from the Internet.