# The installer creates /etc/nftables.d/99-badips.nft automatically
# This provides a dedicated 'inet badips' table with IPv4 and IPv6 support
# View the Bad IPs nftables configuration:
sudo cat /etc/nftables.d/99-badips.nft
# The configuration includes:
# - IPv4 sets: badipv4, never_block, always_block
# - IPv6 sets: badipv6, never_block_v6, always_block_v6
# - Prerouting hook at priority -150 (processes all traffic)
# Verify nftables configuration is loaded:
sudo nft list table inet badips
Firewall Compatibility: Bad IPs is fully compatible with UFW, firewalld, and custom nftables configurations. It uses an isolated table inet badips that operates independently from your main firewall rules at prerouting priority -150.
Note: The automated installer handles all these steps, including interactive prompts for database credentials and network configuration.
🗑️ Uninstalling Bad IPs
To completely remove Bad IPs and clean up all configuration:
sudo apt remove --purge bad-ips
This will:
Stop and disable the bad_ips service
Remove the Bad IPs package
Delete the local database (/var/lib/bad_ips/)
Clean up all nftables rules and sets
Expected Warnings
You may see these warnings during removal - they are normal and expected:
dpkg: warning: while removing bad-ips, directory '/usr/local/share' not empty so not removed
dpkg: warning: while removing bad-ips, directory '/usr/local/lib' not empty so not removed
dpkg: warning: while removing bad-ips, directory '/usr/local/etc/badips.d' not empty so not removed
These warnings appear because:
/usr/local/share and /usr/local/lib are system directories that may contain files from other packages
/usr/local/etc/badips.d may contain custom detector configurations you created
dpkg will not remove non-empty directories to avoid deleting files from other packages or your custom configurations
Complete Cleanup: If you want to remove everything including custom configs:
Monitors systemd journal and log files for attack patterns
🚫 Automatic Blocking
Blocks IPs using nftables with configurable timeouts
🗄️ Centralized Database
PostgreSQL for threat sharing across all servers
⚡ Multi-threaded
Async architecture with queue-based pipeline
🎯 Configurable Detectors
SSH, mail, web, DNS - add your own patterns
🛡️ Trusted Networks
Never-block CIDR filtering for management networks
The NATO Effect
"An attack on one is an attack on all."
When any server blocks an IP, it's shared via database with all servers. An attacker brute-forcing SSH on your mail server gets instantly blocked everywhere.