BASH IP Tables

From Indie IT Wiki
Jump to: navigation, search

IPTABLES:

Use IPTables Firewall To Block An IP Address

iptables -I INPUT -s {IP-ADDRESS} -j DROP

Use IPTables To List A Blocked IP Address

iptables -L INPUT -v -n
iptables -S
iptables -L INPUT --line-numbers

Thanks to Cyberciti

Thanks to Cyberciti

Use IPTables To Edit / Delete A Chain Rule

List the rules of the Chain first...

iptables -L INPUT --line-numbers

...then delete the Number you want to clear...

iptables -D INPUT 4

Use IPTables To Delete ALL Rules

Thanks to Cyberciti