BigField
(usa Debian)
Enviado em 04/11/2013 - 18:37h
#!/bin/bash
echo Inicializando regras do firewall sleep 0
IF_WAN=eth0 # INTERFACE DE SAIDA PARA INTERNET
LAN=192.168.0.0/24 # ENDEREÇO PARA REDE LOCAL LAN
# LIMPA REGRAS DO FIREWALL
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -F
iptables -t nat -F
echo "nameserver 127.0.0.1" > /etc/resolv.conf echo "nameserver 8.8.8.8" >> /etc/resolv.conf
echo "nameserver 8.8.4.4" >> /etc/resolv.conf
#ATIVA O SISTEMA DE ROTEAMENTO DE PACOTES
echo 1 > /proc/sys/net/ipv4/ip_forward
# ATIVA O MODO DE MASQUERADE
iptables -t nat -A POSTROUTING -o $IF_WAN -j MASQUERADE # Mascaramento de rede
# FORÇA A NAVEGACAO PELA PORTA 3128
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -s $LAN -j REDIRECT--to 3128 # Forca navegacao na 3128
#iptables -t nat -A PREROUTING -p tcp -s $LAN --dport 1863 -j DROP
# BLOQUEANDO SITE COM HTTPS
#cat /etc/squid/bloqueados/bloq_https | while read SITES; # do
# iptables -A FORWARD -p tcp -d $SITES -j ACCEPT # done