Here is my firewall script for an internal development server. I want to be able to get out with http/https but I only want the server accessible via ssh/http from within the internal network.
iptables -P INPUT DROP iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT iptables -F iptables -A INPUT -i eth0 -p tcp -s 10.1.1.0/24 --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A INPUT -p tcp --sport 3306 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A INPUT -p tcp -s 10.1.1.0/24 --dport http -j ACCEPT
Seems to work as I expected but for some reason I cannot get seem to access the outside world. For example:
super@dev0:~$ ping google.com ping: unknown host google.com
Since I set my default OUTPUT policy to ACCEPT, shouldn't I be able to get out without any limits? What am I misunderstanding?