IP-tables config

Published by

Posted on November 16, 2017

Block an IP
iptables -I INPUT -s -j DROP

After rebooting the server we notice the rules are removed. It’s best to save your configs and restore them after a reboot.
iptables-save > /etc/iptables/rules

iptables-restore < /etc/iptables/rules

flush all rules
iptables -F

flush rules in the input chain
iptables -F INPUT

iptables -L –line-numbers

iptables -D INPUT 3 – delete a line