# reset defaults iptables -F; iptables -P OUTPUT ACCEPT; iptables -P FORWARD DROP; iptables -P INPUT DROP; # maintenance iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT; # accept as INPUT all already ESTABLISHED connections iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT;