iptables defaults

# Set default policies for INPUT, FORWARD and OUTPUT chains
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

# Set access for localhost
iptables -A INPUT -i lo -j ACCEPT

# Accept packets belonging to established and related connections
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# ICMP (ping) - ping flood protection 1 per second
iptables -A INPUT -p icmp -m limit --limit 5/s --limit-burst 5 -j ACCEPT
iptables -A INPUT -p icmp -j DROP

# MySql (3306)
iptables -A INPUT -p tcp --dport 3306 -j ACCEPT
iptables -A IMPUT -p udp --dport 3306 -j ACCEPT

# Save settings
/sbin/service iptables save

# List rules
iptables -L -v