Howto: Reset iptables firewall

Recently, one of the customer trying to make some changes from the iptables and ended up the server couldn’t access through SSH.

In order to get it done, I have consider to reset the iptables firewall rules with the following command.

# iptables -P INPUT ACCEPT
# iptables -F
# iptables -A INPUT -i lo -j ACCEPT
# iptables -A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT
# iptables -A INPUT -p tcp –dport 22 -j ACCEPT
# iptables -P INPUT DROP
# iptables -P FORWARD DROP
# iptables -P OUTPUT ACCEPT
# iptables -L -v