Networking

Tools

iptables

List rules in all chains (default table is filter, there are mangle, nat and raw tables beside it):

$ sudo iptables -L -n --line-numbers [-t filter]

Print rules for all chains (for a specific chains):

$ sudo iptables -S [INPUT [1]]

fail2ban

  • /etc/fail2ban/filter.d - filters which turn into user-defined fail2ban iptables rules (automatically).

Status:

$ sudo service fail2ban status
$ sudo fail2ban-client status
$ sudo fail2ban-client status sshd

Unban:

$ sudo fail2ban-client unban --all
$ sudo fail2ban-client set sshd unbanip <IP>