edzero3
(usa Debian)
Enviado em 09/06/2014 - 19:03h
As paginas não são bloqueadas por ele, são pelo squid
#!/bin/sh
echo "Iniciando firewall..."
echo "Limpando regras..."
iptables -F INPUT
iptables -F OUTPUT
iptables -F FORWARD
iptables -F POSTROUTING -t nat
iptables -F PREROUTING -t nat
iptables -F -t filter
iptables -F -t nat
echo "Compartilhando a internet..."
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo "Regras INPUT..."
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -s 192.168.1.0/24 -j ACCEPT
iptables -A INPUT -p tcp -s 192.168.1.0/255.255.255.0 --dport 3128 -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
echo "Liberando DNS..."
iptables -A FORWARD -p udp -m udp -s 192.168.1.0/24 --dport 53 -d 0/0 -j ACCEPT
iptables -A FORWARD -p tcp -m tcp -s 192.168.1.0/24 --dport 53 -d 0/0 -j ACCEPT
echo "Bloq. local a porta 80..."
iptables -I FORWARD -p tcp -s 192.168.1.0/24 -i eth1 --dport 80 -j DROP
echo "Bloq. local a porta 443..."
iptables -I FORWARD -p tcp -s 192.168.1.0/24 -i eth1 --dport 443 -j DROP
echo "Liberando servidor ntp..."
iptables -A INPUT -p udp --dport 123 -j ACCEPT