Linux iptables and its successor nftables provide powerful, low-level network filtering with excellent performance.
Basic iptables Blocking
Use iptables DROP or REJECT rules to block individual IPs or ranges.
Using ipset
ipset enables efficient matching against large IP lists with minimal performance overhead.
Modern nftables
nftables provides improved syntax and performance for modern Linux systems.
Best Practices
- Use ipset - Hash-based sets for large blocklists.
- Persist Rules - Save rules to survive reboots.
- Logging - Log blocked packets for analysis.
Download Linux Feeds
Get blocklists formatted for iptables and ipset.