sub1="x.x.x.0/23"
### Flush tables iptables -F iptables -X iptables -Z
### Policies iptables -P INPUT DROP iptables -P OUTPUT DROP iptables -P FORWARD DROP
### Loopback iptables -A INPUT -i lo -j ACCEPT iptables -A OUTPUT -o lo -j ACCEPT
### DNS
iptables -A FORWARD -m state --state NEW -s $sub1 -p UDP --dport 53 -j ACCEPT
### HTTP
iptables -A FORWARD -m state --state NEW -s $sub1 -p TCP -m multiport --dport 80,443 -j ACCEPT
## to block access to the webserver that's sitting behind the firewall I have to add this to this
## script if I don't I can get to the webserver
#iptables -A FORWARD -p TCP -d $sub1 --dport 80 -j DROP
### Accept established connections iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT