#Limpa tabelas
iptables -X
iptables -t filter -F
iptables -t nat -F
#Negando tudo
iptables -P INPUT DROP
iptables -P FORWARD DROP
#Encaminhamento de pacotes
echo 1 > /proc/sys/net/ipv4/ip_forward
#Macarar pacote nat
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
#Permite protocolo icmp (ping)
iptables -A FORWARD -p icmp -j ACCEPT
#Liberando DSN para Rede local
iptables -A INPUT -p udp -s 192.168.20.10 -d 192.168.20.0/24 --dport 53 -j ACCEPT
iptables -A OUTPUT -p udp -s 192.168.20.10 -d 192.168.20.0/24 --dport 53 -j ACCEPT
#Liberando porta 80 rede local
iptables -A INPUT -p tcp -s 192.168.20.10 -d 192.168.20.0/24 --dport 80 -j ACCEPT
iptables -A OUTPUT -p tcp -s 192.168.20.10 -d 192.168.20.0/24 --dport 80 -j ACCEPT
#Liberando porta HTTPS
iptables -A INPUT -p tcp -s 192.168.20.10 -d 192.168.20.0/24 --dport 443 -j ACCEPT
iptables -A OUTPUT -p tcp -s 192.168.20.10 -d 192.168.20.0/24 --dport 443 -j ACCEPT