arthurmatiello
(usa Debian)
Enviado em 01/10/2014 - 13:50h
Boa tarde,
Possuo um firewall utilizando proxy autenticado no AD com Squid3 e IPTABLES.
Estou tentando acessar qualquer site que está hospedado na minha rede local e não consigo.
Com uma 'gambiarra' no navegador achei uma solução (coloco *.minhaempresa.com.br; 192.168.*.* nas exceções do meu navegador e deixo marcado a opção 'Não usar proxy para endereço local'), porém não vejo como a melhor solução para o caso, vejo como uma gambiarra, pois gostaria que todo acesso feito para um endereço da rede local não saisse pelo proxy.
Segue meu squid.conf:
---------------------------
# Parametros gerais do Squid
http_port 192.168.10.1:3128
icp_port 0
cache_access_log /var/log/squid3/access.log
cache_mem 1536 MB
dns_nameservers 8.8.8.8
cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF
cache_dir diskd /var/spool/squid3 1600 64 256 Q1=62 Q2=72
cache_store_log none
logfile_rotate 7
maximum_object_size 32768 KB
# Rede Robocop
acl rederobocop src 192.168.10.0/23
# Rede Laguna
acl redelaguna src 192.168.0.0/23
# Rede Jundiai
acl redejundiai src 192.168.6.0/23
# Autenticacao do AD
auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp
auth_param ntlm children 30
auth_param basic program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-basic
auth_param basic children 30
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 12 hours
#
acl senha proxy_auth REQUIRED
#
external_acl_type nt_group ttl=300 children=50 %LOGIN /usr/lib/squid3/wbinfo_group.pl
#
acl internet-total external nt_group internet-total
acl internet-parcial external nt_group internet-parcial
acl internet-restrito external nt_group internet-restrito
acl internet-liberanegado external nt_group internet-liberanegado
acl internet-cloud external nt_group internet-cloud
# Listas de palavras e sites para acesso
#********************************************
acl url-negado dstdomain "/etc/squid3/url-negado"
acl url-parcial dstdomain "/etc/squid3/url-parcial"
acl url-semauth dstdomain "/etc/squid3/url-semauth"
acl url-liberanegado dstdomain "/etc/squid3/url-liberanegado"
acl url-liberacloud dstdomain "/etc/squid3/url-liberacloud"
# Para funcionar o OCS Inventory (agm - 05/09/2014)
ignore_expect_100 on
# Libera tudo (manter desabilitado)
#http_access allow all
# Liberando o protocolo FTP para sites (ftp://ftp.*)
acl ftp proto FTP
http_access allow ftp
# Libera sites sem autenticacao (Windows Update e similares)
http_access allow url-semauth
# Libera usuarios da rede
http_access allow senha internet-total
http_access allow senha url-liberanegado internet-liberanegado
http_access allow senha url-liberacloud internet-cloud
http_access allow senha url-parcial internet-parcial
http_access deny url-negado
http_access allow senha internet-restrito
# ACLs de uso geral
#***********************
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl SSL_ports port 443 563 1049
acl Safe_ports port 80 83 20 21 443 563 70 210 1025-65535
acl CONNECT method CONNECT
# Acesso de uso geral
# **************************
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
ie_refresh on
---------------------------
Segue me script de regras IPTABLES:
---------------------------------
#!/bin/bash
### BEGIN INIT INFO
# Provides: regras
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start regras at boot time
# Description: Enable service provided by regras.
### END INIT INFO
#Libera forward
echo "1" > /proc/sys/net/ipv4/ip_forward
# Aumenta valor CONN_TRACK - 2012-03-07
echo "131072" > /proc/sys/net/ipv4/netfilter/ip_conntrack_max
# Limpando regras
/sbin/iptables -F
/sbin/iptables -F -t nat
/sbin/iptables -F -t mangle
/sbin/iptables -X
/sbin/iptables -X -t nat
/sbin/iptables -Z
# Carrega modulos
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
modprobe ip_conntrack_sip
modprobe ip_nat_sip
IPTABLES="/sbin/iptables"
# Define constantes link primario
INET="189.57.x.a"
INET2="189.57.x.b"
INET3="189.57.x.c"
INET4="189.57.x.d"
INET5="189.57.x.e"
# Define constantes link secundario
INETB="189.109.y.a"
INETB2="189.109.y.b"
INETB3="189.109.y.c"
INETB4="189.109.y.d"
INETB5="189.109.y.e"
# Link primario LAGUNA
LAGUNA01="200.153.z.a"
# Link segundario LAGUNA
LAGUNA02="189.21.z.b"
# Link primario JUNDIAI
JUNDIAI01="200.205.w.a"
# Link segundario JUNDIAI
JUNDIAI02="187.95.w.b"
INT="192.168.10.1"
REDEINT="192.168.10.0/23"
REDEJUND="192.168.6.0/23"
REDELAGUNA="192.168.0.0/23"
BROADCAST="255.255.255.255"
ETHINET="eth1"
ETHINETB="eth2"
ETHINT="eth0"
# PPTP
ETHPPP0="ppp0"
ETHPPP1="ppp1"
ETHPPP2="ppp2"
ETHPPP3="ppp3"
ETHPPP4="ppp4"
ETHPPP5="ppp5"
ETHPPP6="ppp6"
ETHPPP7="ppp7"
ETHPPP8="ppp8"
ETHPPP9="ppp9"
ETHPPP10="ppp10"
ETHPPP11="ppp11"
ETHPPP12="ppp12"
ETHPPP13="ppp13"
ETHPPP14="ppp14"
ROTEADOR="189.21.x.a"
# Servidores Robocop
SPA="192.168.x.a" #
DETROIT="192.168.x.b" #
SUZUKA="192.168.x.c" #
JEREZ="192.168.x.d" #
MPLS01="192.168.x.e" #
MONZA="192.168.x.f" #
HOCKENHEIM="192.168.x.g" #
MONACO="192.168.x.h" #
LEMANS="192.168.x.i" #
IMOLA="192.168.x.j" #
JUNDWEB="192.168.x.k" #
YASMARINA="192.168.x.l" #
SRVBKP="192.168.x.m" #
SRVTI="192.168.x.n" #
SRVMONITOR="192.168.x.n" #
MPLS02="192.168.x.o" #
DAKAR="192.168.x.p" #
SRV01="192.168.x.q" #
MPLS03="192.168.x.r" #
SRVSMTP="192.168.x.s" #
LIVRE02="192.168.x.t" #
LIVRE03="192.168.x.u" #
SRVNAGIOS="192.168.x.v" #
# Notebooks e Estacoes
NOTEAM="192.168.10.69"
# Impede que o log va para a console
/bin/dmesg -n 1
##################
# INPUT e OUTPUT #
##################
# Cria chains para as interfaces
$IPTABLES -N ext-entr
$IPTABLES -N ext-sai
$IPTABLES -N int
$IPTABLES -N pptp
$IPTABLES -N vpn
# Direciona pacotes para as interfaces
# Entrada
$IPTABLES -A INPUT -p ALL -i $ETHINT -j int
$IPTABLES -A INPUT -p ALL -i $ETHINET -j ext-entr
$IPTABLES -A INPUT -p ALL -i $ETHINETB -j ext-entr
$IPTABLES -A INPUT -p ALL -i $ETHPPP0 -j pptp
$IPTABLES -A INPUT -p ALL -i $ETHPPP1 -j pptp
$IPTABLES -A INPUT -p ALL -i $ETHPPP2 -j pptp
$IPTABLES -A INPUT -p ALL -i $ETHPPP3 -j pptp
$IPTABLES -A INPUT -p ALL -i $ETHPPP4 -j pptp
$IPTABLES -A INPUT -p ALL -i $ETHPPP5 -j pptp
$IPTABLES -A INPUT -p ALL -i $ETHPPP6 -j pptp
$IPTABLES -A INPUT -p ALL -i $ETHPPP7 -j pptp
$IPTABLES -A INPUT -p ALL -i $ETHPPP8 -j pptp
$IPTABLES -A INPUT -p ALL -i $ETHPPP9 -j pptp
$IPTABLES -A INPUT -p ALL -i $ETHPPP10 -j pptp
$IPTABLES -A INPUT -p ALL -i $ETHPPP11 -j pptp
$IPTABLES -A INPUT -p ALL -i $ETHPPP12 -j pptp
$IPTABLES -A INPUT -p ALL -i $ETHPPP13 -j pptp
$IPTABLES -A INPUT -p ALL -i $ETHPPP14 -j pptp
# Saida
$IPTABLES -A OUTPUT -p ALL -o $ETHINT -j int
$IPTABLES -A OUTPUT -p ALL -o $ETHINET -j ext-sai
$IPTABLES -A OUTPUT -p ALL -o $ETHINETB -j ext-sai
$IPTABLES -A OUTPUT -p ALL -o $ETHPPP0 -j pptp
$IPTABLES -A OUTPUT -p ALL -o $ETHPPP1 -j pptp
$IPTABLES -A OUTPUT -p ALL -o $ETHPPP2 -j pptp
$IPTABLES -A OUTPUT -p ALL -o $ETHPPP3 -j pptp
$IPTABLES -A OUTPUT -p ALL -o $ETHPPP4 -j pptp
$IPTABLES -A OUTPUT -p ALL -o $ETHPPP5 -j pptp
$IPTABLES -A OUTPUT -p ALL -o $ETHPPP6 -j pptp
$IPTABLES -A OUTPUT -p ALL -o $ETHPPP7 -j pptp
$IPTABLES -A OUTPUT -p ALL -o $ETHPPP8 -j pptp
$IPTABLES -A OUTPUT -p ALL -o $ETHPPP9 -j pptp
$IPTABLES -A OUTPUT -p ALL -o $ETHPPP10 -j pptp
$IPTABLES -A OUTPUT -p ALL -o $ETHPPP11 -j pptp
$IPTABLES -A OUTPUT -p ALL -o $ETHPPP12 -j pptp
$IPTABLES -A OUTPUT -p ALL -o $ETHPPP13 -j pptp
$IPTABLES -A OUTPUT -p ALL -o $ETHPPP14 -j pptp
# Libera trafego localhost
$IPTABLES -A INPUT -p ALL -i lo -j ACCEPT
$IPTABLES -A INPUT -p ALL -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
$IPTABLES -A INPUT -p ALL -s $INT -d $INT -j ACCEPT
$IPTABLES -A INPUT -p ALL -s $INET -d $INET -j ACCEPT
$IPTABLES -A INPUT -p ALL -s $INETB -d $INETB -j ACCEPT
$IPTABLES -A INPUT -p ALL -j LOG --log-prefix "input " --log-level info
$IPTABLES -A INPUT -p ALL -j DROP
$IPTABLES -A OUTPUT -p ALL -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
$IPTABLES -A OUTPUT -p ALL -s $INT -d $INT -j ACCEPT
$IPTABLES -A OUTPUT -p ALL -s $INET -d $INET -j ACCEPT
$IPTABLES -A OUTPUT -p ALL -s $INETB -d $INETB -j ACCEPT
$IPTABLES -A OUTPUT -p ALL -j LOG --log-prefix "output " --log-level info
$IPTABLES -A OUTPUT -p ALL -j DROP
# Pacotes com destino a interface EXTERNA
$IPTABLES -A ext-entr -p tcp ! --syn -j ACCEPT
$IPTABLES -A ext-entr -p tcp -m state --state ESTABLISHED,RELATED -j ACCEPT
# Libera ICMP
$IPTABLES -A ext-entr -p icmp -j ACCEPT
# IPSec
$IPTABLES -A ext-entr -p udp --dport 500 -j ACCEPT
$IPTABLES -A ext-entr -p udp --dport 4500 -j ACCEPT
$IPTABLES -A ext-entr -p 50 -j ACCEPT
# AUTH
$IPTABLES -A ext-entr -p tcp --dport auth -j ACCEPT
# SSH
$IPTABLES -A ext-entr -p tcp -s $ULTRIX01 --dport 59821 -j ACCEPT
# DNS
$IPTABLES -A ext-entr -p udp --sport 53 -j ACCEPT
$IPTABLES -A ext-entr -p udp --dport 53 -j ACCEPT
# PPTP
$IPTABLES -A ext-entr -p tcp --dport 1723 -j ACCEPT
$IPTABLES -A ext-entr -p 47 -j ACCEPT
$IPTABLES -A ext-entr -p ALL -j LOG --log-prefix "ext-entr " --log-level info
$IPTABLES -A ext-entr -p ALL -j DROP
# Libera retorno do ping para uso no MON
$IPTABLES -A ext-entr -p icmp -s 8.8.8.8 -j ACCEPT
$IPTABLES -A ext-entr -p icmp -s 8.8.4.4 -j ACCEPT
$IPTABLES -A ext-entr -p ALL -j LOG --log-prefix "ext-entr " --log-level info
$IPTABLES -A ext-entr -p ALL -j DROP
# Pacotes saindo da interface EXTERNA
$IPTABLES -A ext-sai -p ALL -j ACCEPT
$IPTABLES -A ext-sai -p ALL -j LOG --log-prefix "ext-sai " --log-level info
$IPTABLES -A ext-sai -p ALL -j DROP
# Pacotes com destino a interface INTERNA
$IPTABLES -A int -s $REDEINT -d $REDEINT -p ALL -j ACCEPT
$IPTABLES -A int -s $REDEINT -d $REDEJUND -p ALL -j ACCEPT
$IPTABLES -A int -s $REDEJUND -d $REDEINT -p ALL -j ACCEPT
$IPTABLES -A int -s $REDEINT -d $REDELAGUNA -p ALL -j ACCEPT
$IPTABLES -A int -s $REDELAGUNA -d $REDEINT -p ALL -j ACCEPT
$IPTABLES -A int -s $REDEJUND -d $REDELAGUNA -p ALL -j ACCEPT
$IPTABLES -A int -s $REDELAGUNA -d $REDEJUND -p ALL -j ACCEPT
# Rejeita broadcast UDP
$IPTABLES -A int -d $BROADCAST -p UDP -j DROP
$IPTABLES -A int -p ALL -j LOG --log-prefix "int " --log-level info
$IPTABLES -A int -p ALL -j DROP
###########
# FORWARD #
###########
# Criacao dos chains
$IPTABLES -N int-ext
$IPTABLES -N ext-int
$IPTABLES -N aat-aat
# Redirecionamento do FORWARD
# Liberacoes de PPTP
$IPTABLES -A FORWARD -o $ETHPPP0 -j pptp
$IPTABLES -A FORWARD -o $ETHPPP1 -j pptp
$IPTABLES -A FORWARD -o $ETHPPP2 -j pptp
$IPTABLES -A FORWARD -o $ETHPPP3 -j pptp
$IPTABLES -A FORWARD -o $ETHPPP4 -j pptp
$IPTABLES -A FORWARD -o $ETHPPP5 -j pptp
$IPTABLES -A FORWARD -o $ETHPPP6 -j pptp
$IPTABLES -A FORWARD -o $ETHPPP7 -j pptp
$IPTABLES -A FORWARD -o $ETHPPP8 -j pptp
$IPTABLES -A FORWARD -o $ETHPPP9 -j pptp
$IPTABLES -A FORWARD -o $ETHPPP10 -j pptp
$IPTABLES -A FORWARD -o $ETHPPP11 -j pptp
$IPTABLES -A FORWARD -o $ETHPPP12 -j pptp
$IPTABLES -A FORWARD -o $ETHPPP13 -j pptp
$IPTABLES -A FORWARD -o $ETHPPP14 -j pptp
$IPTABLES -A FORWARD -i $ETHPPP0 -j pptp
$IPTABLES -A FORWARD -i $ETHPPP1 -j pptp
$IPTABLES -A FORWARD -i $ETHPPP2 -j pptp
$IPTABLES -A FORWARD -i $ETHPPP3 -j pptp
$IPTABLES -A FORWARD -i $ETHPPP4 -j pptp
$IPTABLES -A FORWARD -i $ETHPPP5 -j pptp
$IPTABLES -A FORWARD -i $ETHPPP6 -j pptp
$IPTABLES -A FORWARD -i $ETHPPP7 -j pptp
$IPTABLES -A FORWARD -i $ETHPPP8 -j pptp
$IPTABLES -A FORWARD -i $ETHPPP9 -j pptp
$IPTABLES -A FORWARD -i $ETHPPP10 -j pptp
$IPTABLES -A FORWARD -i $ETHPPP11 -j pptp
$IPTABLES -A FORWARD -i $ETHPPP12 -j pptp
$IPTABLES -A FORWARD -i $ETHPPP14 -j pptp
$IPTABLES -A FORWARD -s $REDEINT -o $ETHINET -j int-ext
$IPTABLES -A FORWARD -s $REDEINT -o $ETHINETB -j int-ext
$IPTABLES -A FORWARD -s $REDEJUND -o $ETHINET -j int-ext
$IPTABLES -A FORWARD -s $REDEJUND -o $ETHINETB -j int-ext
$IPTABLES -A FORWARD -s $REDELAGUNA -o $ETHINT -j aat-aat
$IPTABLES -A FORWARD -s $REDEJUND -o $ETHINT -j aat-aat
$IPTABLES -A FORWARD -s $REDEINT -d $REDEJUND -j aat-aat
$IPTABLES -A FORWARD -s $REDEINT -d $REDELAGUNA -j aat-aat
# INTERNO-EXTERNO
# Libera conexoes de retorno e relacionadas
$IPTABLES -A int-ext -p tcp ! --syn -j ACCEPT
$IPTABLES -A int-ext -p tcp -m state --state ESTABLISHED,RELATED -j ACCEPT
# INTERNO-EXTERNO
# Libera conexoes de retorno e relacionadas
$IPTABLES -A int-ext -p tcp ! --syn -j ACCEPT
$IPTABLES -A int-ext -p tcp -m state --state ESTABLISHED,RELATED -j ACCEPT
# Registra Trafego interno
# $IPTABLES -A int-ext -p ALL -j LOG --log-prefix TRAFEGO --log-level info
# Libera com destino a Ultrix
$IPTABLES -A int-ext -d 189.25.14.137 -p ALL -j ACCEPT
# Libera Download de Atualizacao do Microsoft Endpoint (agm_04-10-2013)
$IPTABLES -A int-ext -d 64.4.61.253 -p ALL -j ACCEPT
# Libera acesso as filiais pelo IP externo
# Jundiai
$IPTABLES -A int-ext -d $JUNDIAI01 -p ALL -j ACCEPT
$IPTABLES -A int-ext -d $JUNDIAI02 -p ALL -j ACCEPT
# Laguna
$IPTABLES -A int-ext -d $LAGUNA01 -p ALL -j ACCEPT
$IPTABLES -A int-ext -d $LAGUNA02 -p ALL -j ACCEPT
# Libera acesso aos protocolos de PPTP
$IPTABLES -A int-ext -p tcp --dport 1723 -j ACCEPT
$IPTABLES -A int-ext -p 47 -j ACCEPT
# Libera aplicativo CAT 4.0 - arafonso - 16-01-2014
$IPTABLES -A int-ext -p tcp --dport 5017 -j ACCEPT
$IPTABLES -A int-ext -p tcp --dport 5022 -j ACCEPT
# Libera aplicativo TOTVS - arafonso - 03-02-2014
$IPTABLES -A int-ext -p tcp --dport 2008 -j ACCEPT
$IPTABLES -A int-ext -p tcp --sport 2008 -j ACCEPT
# Libera Servidores
$IPTABLES -A int-ext -p ALL -s $DETROIT -j ACCEPT
$IPTABLES -A int-ext -p ALL -s $SUZUKA -j ACCEPT
$IPTABLES -A int-ext -p ALL -s $JEREZ -j ACCEPT
$IPTABLES -A int-ext -p ALL -s $MONZA -j ACCEPT
$IPTABLES -A int-ext -p ALL -s $MONACO -j ACCEPT
$IPTABLES -A int-ext -p ALL -s $HOCKENHEIM -j ACCEPT
$IPTABLES -A int-ext -p ALL -s $LEMANS -j ACCEPT
$IPTABLES -A int-ext -p ALL -s $JUNDWEB -j ACCEPT
$IPTABLES -A int-ext -p ALL -s $YASMARINA -j ACCEPT
$IPTABLES -A int-ext -p ALL -s $SRVTI -j ACCEPT
$IPTABLES -A int-ext -p ALL -s $SRVMONITOR -j ACCEPT
$IPTABLES -A int-ext -p ALL -s $SRV01 -j ACCEPT
$IPTABLES -A int-ext -p ALL -s $SRVSMTP -j ACCEPT
$IPTABLES -A int-ext -p ALL -s $SRVNAGIOS -j ACCEPT
# Libera Notebooks e Estacoes
$IPTABLES -A int-ext -p ALL -s $NOTEAM -j ACCEPT
# Libera acesso ao servidor da Locaweb
$IPTABLES -A int-ext -p tcp --dport 8769 -j ACCEPT
$IPTABLES -A int-ext -p udp --dport 8769 -j ACCEPT
$IPTABLES -A int-ext -p ALL -d 189.10.x.y -j ACCEPT
# Libera acesso a IMAP externo
$IPTABLES -A int-ext -p tcp --dport 587 -j ACCEPT
$IPTABLES -A int-ext -p tcp --dport 465 -j ACCEPT
$IPTABLES -A int-ext -p tcp --dport 143 -j ACCEPT
$IPTABLES -A int-ext -p tcp --dport 993 -j ACCEPT
# Libera o acesso a Servidores POP3
$IPTABLES -A int-ext -p tcp --dport 110 -j ACCEPT
# Libera acesso a MS SQL
$IPTABLES -A int-ext -p tcp --dport 1433 -j ACCEPT
# Libera TeamViewer
$IPTABLES -A int-ext -p tcp --dport 5938 -j ACCEPT
# Libera acesso ao Prot. UDP, porta 500
$IPTABLES -A int-ext -p udp --dport 500 -j ACCEPT
# Automatiza - Shoptime
$IPTABLES -A int-ext -p tcp --dport 7103 -j ACCEPT
# Libera acesso ao MySQL
$IPTABLES -A int-ext -p tcp --dport 3306 -j ACCEPT
# Libera Acesso Conectividade Social
$IPTABLES -A int-ext -p tcp --dport 10060 -j ACCEPT
# Protocolos liberados para uso das estacoes - UDP
$IPTABLES -A int-ext -p udp --dport domain -j ACCEPT
$IPTABLES -A int-ext -p udp --dport 1024: -j ACCEPT
# Libera acesso para SFTP e SSH
$IPTABLES -A int-ext -p tcp --dport 22 -j ACCEPT
# Libera trafego para a CBDS
$IPTABLES -A int-ext -p ALL -d 201.6.103.236 -j ACCEPT
$IPTABLES -A int-ext -p ALL -d 184.168.84.250 -j ACCEPT
# FTP
$IPTABLES -A int-ext -p tcp --dport ftp -j ACCEPT
$IPTABLES -A int-ext -p tcp --dport ftp-data -j ACCEPT
# SEFAZ NET
$IPTABLES -A int-ext -d 201.55.62.86 -p ALL -j ACCEPT
$IPTABLES -A int-ext -p tcp --dport 1049 -j ACCEPT
# ICMP
$IPTABLES -A int-ext -p icmp -j ACCEPT
# Libera uso do Interchange do banco Fibra
$IPTABLES -A int-ext -p tcp --dport 1414 -j ACCEPT
# Libera uso do ReceitaNet
$IPTABLES -A int-ext -p tcp --dport 3456 -j ACCEPT
# TED
$IPTABLES -A int-ext -p tcp --dport 8017 -j ACCEPT
# 06/01 - Acesso ao sistema do SERASA
$IPTABLES -A int-ext -p tcp --dport 10000 -j ACCEPT
# Libera SSH
$IPTABLES -A int-ext -p tcp --dport 59821 -j ACCEPT
# Libera acesso ao Banco Central - RT-29/04/03
$IPTABLES -A int-ext -p tcp --dport 5024 -j ACCEPT
# Libera chamada Skype
$IPTABLES -A int-ext -p tcp -m multiport --dports 5204,5212,5283,5289,5295,5329,5336,5337,5384,5389,5393,5402,5431 -j ACCEPT
# Libera acesso ao HTTPS - Skype, MSN, Neogrid
$IPTABLES -A int-ext -p tcp --dport 443 -j ACCEPT
# Libera acesso ao DATAPREV
$IPTABLES -A int-ext -p tcp --dport 5017 -j ACCEPT
# Libera rede dos Correios sem proxy
$IPTABLES -A int-ext -p tcp -d 200.252.60.0/24 --dport www -j ACCEPT
# Libera rede do GissOnline sem proxy - 18-06-2014 - agm
$IPTABLES -A int-ext -p tcp -d 201.77.231.19 -j ACCEPT
$IPTABLES -A int-ext -p tcp -d 200.215.180.85 -j ACCEPT
# Libera Conectividade Social
$IPTABLES -A int-ext -p ALL -d 200.201.160.0/20 -j ACCEPT
# Libera Rede da SERPRO
$IPTABLES -A int-ext -p ALL -d 200.198.192.0/18 -j ACCEPT
# Nao faz log da porta 80 pra evitar excesso de registro nos logs
$IPTABLES -A int-ext -p tcp --dport 80 -j DROP
# Libera tudo (desativado)
#$IPTABLES -A int-ext -p ALL -j ACCEPT
# NAT - IP Fixo
$IPTABLES -t nat -A POSTROUTING -o $ETHINET -j SNAT --to $INET
$IPTABLES -t nat -A POSTROUTING -o $ETHINETB -j SNAT --to $INETB
$IPTABLES -A int-ext -p ALL -j LOG --log-prefix "int-ext " --log-level info
$IPTABLES -A int-ext -p ALL -j DROP
# EXTERNO-INTERNO
# Libera conexoes de retorno e relacionadas
$IPTABLES -A ext-int -p tcp --dport 1433 -j LOG --log-prefix "SQL-ext-int " --log-level info
$IPTABLES -A ext-int -p tcp ! --syn -j ACCEPT
$IPTABLES -A ext-int -p tcp -m state --state ESTABLISHED,RELATED -j ACCEPT
# Libera consultas DNS
$IPTABLES -A ext-int -p udp --dport 1024: -j ACCEPT
# Libera NTP
$IPTABLES -A ext-int -p udp --dport 123 -j ACCEPT
# Libera ICMP
$IPTABLES -A ext-int -p icmp -j ACCEPT
# Libera PPTP
$IPTABLES -A ext-int -p 47 -j ACCEPT
$IPTABLES -A ext-int -i $ETHPPP0 -o $ETHINT -j pptp
$IPTABLES -A ext-int -i $ETHPPP1 -o $ETHINT -j pptp
$IPTABLES -A ext-int -i $ETHPPP2 -o $ETHINT -j pptp
$IPTABLES -A ext-int -i $ETHPPP3 -o $ETHINT -j pptp
$IPTABLES -A ext-int -i $ETHPPP4 -o $ETHINT -j pptp
$IPTABLES -A ext-int -i $ETHPPP5 -o $ETHINT -j pptp
$IPTABLES -A ext-int -i $ETHPPP6 -o $ETHINT -j pptp
$IPTABLES -A ext-int -i $ETHPPP7 -o $ETHINT -j pptp
$IPTABLES -A ext-int -i $ETHPPP8 -o $ETHINT -j pptp
$IPTABLES -A ext-int -i $ETHPPP9 -o $ETHINT -j pptp
$IPTABLES -A ext-int -i $ETHPPP10 -o $ETHINT -j pptp
$IPTABLES -A ext-int -i $ETHPPP11 -o $ETHINT -j pptp
$IPTABLES -A ext-int -i $ETHPPP12 -o $ETHINT -j pptp
$IPTABLES -A ext-int -i $ETHPPP13 -o $ETHINT -j pptp
$IPTABLES -A ext-int -i $ETHPPP14 -o $ETHINT -j pptp
#############
### SRV01 ###
#############
$IPTABLES -A ext-int -p tcp -d $SRV01 --dport 143 -j ACCEPT
$IPTABLES -A ext-int -p tcp -d $SRV01 --dport 110 -j ACCEPT
$IPTABLES -t nat -A PREROUTING -d $INET -p tcp -m multiport --dports 143,110 -j DNAT --to $SRV01
$IPTABLES -t nat -A PREROUTING -d $INETB -p tcp -m multiport --dports 143,110 -j DNAT --to $SRV01
####################
### SRVSMTP ###
####################
$IPTABLES -A ext-int -p tcp -d $SRVSMTP --dport 25 -j ACCEPT
$IPTABLES -A ext-int -p tcp -d $SRVSMTP --dport 587 -j ACCEPT
$IPTABLES -t nat -A PREROUTING -d $INET -p tcp -m multiport --dports 25,587 -j DNAT --to $SRVSMTP
$IPTABLES -t nat -A PREROUTING -d $INETB -p tcp -m multiport --dports 25,587 -j DNAT --to $SRVSMTP
###################
### WEBMAIL ###
###################
$IPTABLES -A ext-int -p tcp -d $SRVMONITOR --dport 80 -j ACCEPT
$IPTABLES -t nat -A PREROUTING -d $INET -p tcp --dport 80 -j DNAT --to $SRVMONITOR
$IPTABLES -t nat -A PREROUTING -d $INETB -p tcp --dport 80 -j DNAT --to $SRVMONITOR
##############
### LEMANS ###
##############
$IPTABLES -A ext-int -p tcp -d $LEMANS --dport 59822 -j ACCEPT
$IPTABLES -t nat -A PREROUTING -d $INET -p tcp -m multiport --dports 59822 -j DNAT --to $LEMANS
$IPTABLES -t nat -A PREROUTING -d $INETB -p tcp -m multiport --dports 59822 -j DNAT --to $LEMANS
################
### IMOLA TS ###
################
$IPTABLES -t nat -A PREROUTING -s $LAGUNA01 -d $INET -p tcp -m multiport --dports 3389 -j DNAT --to $IMOLA
$IPTABLES -t nat -A PREROUTING -s $LAGUNA02 -d $INET -p tcp -m multiport --dports 3389 -j DNAT --to $IMOLA
$IPTABLES -A ext-int -p ALL -j LOG --log-prefix "ext-int " --log-level info
$IPTABLES -A ext-int -p ALL -j DROP
# PPTP
$IPTABLES -A pptp -s $REDEINT -d $REDEINT -p ALL -j ACCEPT
$IPTABLES -A pptp -s $REDEINT -d $REDEJUND -p ALL -j ACCEPT
$IPTABLES -A pptp -s $REDEINT -d $REDELAGUNA -p ALL -j ACCEPT
$IPTABLES -A pptp -s $REDEJUND -d $REDEINT -p ALL -j ACCEPT
$IPTABLES -A pptp -s $REDELAGUNA -d $REDEINT -p ALL -j ACCEPT
$IPTABLES -A pptp -s $REDEINT -d $BROADCAST -p ALL -j ACCEPT
$IPTABLES -A pptp -p ALL -j LOG --log-prefix "pptp " --log-level info
$IPTABLES -A pptp -p ALL -j DROP
# MPLS
$IPTABLES -A aat-aat -s $REDEJUND -p ALL -j ACCEPT
$IPTABLES -A aat-aat -d $REDEJUND -p ALL -j ACCEPT
$IPTABLES -A aat-aat -s $REDELAGUNA -p ALL -j ACCEPT
$IPTABLES -A aat-aat -d $REDELAGUNA -p ALL -j ACCEPT
$IPTABLES -A aat-aat -p ALL -j LOG --log-prefix "aat-aat " --log-level info
$IPTABLES -A aat-aat -p ALL -j DROP
$IPTABLES -A int-ext -p ALL -s $NOTEZM -j ACCEPT
---------------------------------
Se puderem me ajudar sou muito grato,
Não fui eu que criei o script, eu somente fiz modificações de acordo com a utilização da rede.
Se tiver alguma sugestão de melhorias ou criticas também, pode falar.
Obrigado.
Arthur Matiello