CrowdSec VS Fail2Ban VS NFtables Sets
CrowdSec vs Fail2Ban vs nftables Sets: Which Layer Stops Brute Force First?
Fail2Ban, CrowdSec, and plain nftables sets all reduce brute-force noise, but they sit at different layers. Fail2Ban watches local logs and bans. CrowdSec does the same and can share signals across a community. nftables sets are just firewall data structures you populate yourself. This post covers where each one belongs and how they can run together without fighting.
Visual Overview
1. Fail2Ban
Local log watcher that bans after failed attempts.
2. CrowdSec
Log analysis plus shared community blocklists.
3. nftables Sets
Pure firewall layer you fill with any source.
What Changed
Fail2Ban Is Still the Local Baseline
CrowdSec Added Shared Signals
nftables Sets Became the Common Enforcement Point
Technical Comparison
Fail2Ban
[sshd]
enabled = true
maxretry = 5
findtime = 10m
bantime = 10m
ignoreip = 203.0.113.4/32
CrowdSec
sudo cscli decisions list
sudo cscli metrics
sudo cscli bouncers list
nftables Sets
set banned_ipv4 {
type ipv4_addr
flags timeout
timeout 1h
}
Fail2Ban Basics
Install and enable
sudo apt install -y fail2ban
sudo systemctl enable --now fail2ban
Ignore your own IP
sudo nano /etc/fail2ban/jail.local
What it does under the hood
CrowdSec Basics
Install the agent
curl -s https://install.crowdsec.net | sudo sh
sudo apt install crowdsec
Add a bouncer
sudo apt install crowdsec-firewall-bouncer-nftables
sudo systemctl enable --now crowdsec-firewall-bouncer
Community lists
sudo cscli decisions list
nftables Sets Alone
Create a dynamic set
table inet filter {
set banned_ipv4 {
type ipv4_addr
flags timeout
timeout 1h
}
chain input {
type filter hook input priority 0; policy drop;
ip saddr @banned_ipv4 drop
# ... rest of your rules
}
}
Populate from elsewhere
When this is enough
Running Them Together
Common pattern
Order of operations
What to watch
Official Resources
Questions for the Community
Are you still on Fail2Ban only?
How do you keep your own IP from being banned?
Any unexpected interactions?
Disclaimer
This content is for educational and informational purposes only. It is not technical advice. Firewall and ban configurations can lock you out. Test on a spare system, keep an out-of-band console available, and verify commands against the versions you actually run.
DISCUSSION
No replies yet. Be the first to join the discussion!