Hi guys i have the follwoing iptables file for my ubuntu 12.04 server. ITs a bit messy because i tried different ways to fix it but the problem is it doesnt allow apt commands such as apt-get to run. It shows connecting to archive.ubuntu.com and the connection times out. I guess it has something to do with the outgoing rules but im not sure. The exact same issue appeared with using UFW too. Can you please advice me as to how to fix/improve my iptables structure or maybe a fix for UFW to work. Thanks!
UPDATED::
Completed on Mon May 14 23:09:19 2012 # Generated by iptables-save v1.4.12 on Mon May 14 23:09:19 2012 *filter :INPUT DROP [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT -A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT -A INPUT -s 127.0.0.1/32 -j ACCEPT -A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied" --log-level 7 -A INPUT -p icmp -m icmp --icmp-type 0 -j ACCEPT -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT -A INPUT -p tcp -m tcp --sport 53 -j ACCEPT -A INPUT -p udp -m udp --sport 53 -j ACCEPT -A INPUT -i lo -j ACCEPT COMMIT # Completed on Mon May 14 23:09:19 2012