iptables

Last edit

Summary: f

Deleted:

Changed:

< TO unblocks

to

> To block a specific domain:
> iptables -I INPUT -p tcp --dport 80 -m string --string "Host: bc.googleusercontent.com" --algo kmp -j DROP

> TO unblock

Added:

>


To clear all iptables entries, first stop fail2ban, then clear, then restart fail2ban

 iptables --policy INPUT   ACCEPT;
 iptables --policy OUTPUT  ACCEPT;
 iptables --policy FORWARD ACCEPT;
 iptables -Z; # zero counters
 iptables -F; # flush (delete) rules
 iptables -X; # delete all extra chains

To block:

 iptables -A INPUT -s 43.0.0.0/8 -j DROP

To block a specific domain: iptables -I INPUT -p tcp --dport 80 -m string --string "Host: bc.googleusercontent.com" --algo kmp -j DROP

TO unblock

 iptables -L INPUT --line-numbers

(locate the line number)

 iptables -D INPUT 9 (where 9 is the line number)