Plup
(usa Outra)
Enviado em 01/03/2019 - 14:44h
Consegui bloquear todos sites menos o google. Alguem sabe o que eu fiz de errado?
#!/bin/bash
# Apagando todas as regras
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
# Mudando a politica - Começa bloqueando tudo
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD ACCEPT
# Libera conexões pre-estabelecidas
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
# Liberar HTTPS - aqui você coloca o IP do domínio
iptables -A OUTPUT -p tcp -d 216.58.202.14 --dport 443 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p tcp -d 78.138.112.35 --dport 443 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p tcp -d 54.174.181.24 --dport 443 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p tcp -d 54.174.181.241 --dport 443 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p tcp -d 54.72.24.212 --dport 443 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p tcp -d 144.217.126.200 --dport 443 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p tcp -d 198.27.112.201 --dport 443 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p tcp -d 167.114.189.50 --dport 443 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p tcp -d 216.58.194.206 --dport 443 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p tcp -d 172.217.3.174 --dport 443 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p tcp -d 54.68.182.72 --dport 443 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p tcp -d 93.184.220.127 --dport 443 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p tcp -d 72.21.91.127 --dport 443 -m state --state NEW -j ACCEPT
# Liberar DNS
iptables -A OUTPUT -p tcp --dport 53 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p udp --dport 53 -m state --state NEW -j ACCEPT
#Liberar DHCP - na minha rede interna usa DHCP
iptables -A OUTPUT -p tcp --dport 67 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p udp --dport 67 -m state --state NEW -j ACCEPT