jonatasfn
(usa Debian)
Enviado em 20/11/2012 - 16:44h
Segue arquivo S90firewall:
#Configuracao dos Links
echo "Configurando Links..."
LAN=ETH1
LINK=ETH0
#>Configuracao da Rede Interna
REDE_INTERNA=192.168.2.0/24
#>interface
iptables -t nat -A PREROUTING -p tcp --dport 443 -s $REDE_INTERNA -d wprovip.ts.dmz.fedex.com -j ACCEPT
#>iptables -t nat -A PREROUTING -s 192.168.2.0/24 -p tcp --dport 443 -d mia04s03-in-f83.1e100.net -j ACCEPT
iptables -t nat -A PREROUTING -d 200.141.167.106 -p udp --dport 5000:15000 -j ACCEPT
iptables -t nat -A PREROUTING -s 192.168.2.0/24 -d 189.38.92.254 -p tcp --dport 0:65535 -j ACCEPT
iptables -t nat -A PREROUTING -s 192.168.2.0/24 -d 189.38.92.254 -p udp --dport 0:65535 -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j LOG --log-level DEBUG --log-prefix REDIRECO_80_3128_
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j LOG --log-level DEBUG --log-prefix REDIRECO_80_3128_
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
#>Acesso Terminal Service MGSUL
iptables -A PREROUTING -t nat -p tcp -s 189.126.229.2 -j DNAT --to 192.168.2.28:3389
iptables -A FORWARD -s 189.126.229.2 -p tcp -d 192.168.2.28 --dport 3389 -j ACCEPT
#>Acesso Terminal Service SAO JOSE DOS CAMPOS
iptables -A PREROUTING -t nat -p tcp -s 189.110.3.184 --dport 3389 -j DNAT --to 192.168.2.28:3389
iptables -A FORWARD -s 189.110.3.184 -p tcp -d 192.168.2.28 --dport 3389 -j ACCEPT
#>Acesso Terminal Server Debora
iptables -A PREROUTING -t nat -p tcp -s 186.215.158.50 --dport 3389 -j DNAT --to 192.168.2.253:3389
iptables -A FORWARD -s 186.215.158.50 -p tcp -d 192.168.2.253 --dport 3389 -j ACCEPT
#>Libera porta 53
iptables -A FORWARD -p tcp --dport 53 -j ACCEPT
#> Libera Acesso ao Servidor de Email: SPI
echo "Libera Acesso ao Servidor de Email: SPI"
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 25 -d smtp.spi.ind.br -j LOG --log-prefix "EMAIL "
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 25 -d smtp.spi.ind.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 25 -d smtp.spi.ind.br -j LOG --log-prefix "EMAIL "
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 25 -d smtp.spi.ind.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d smtp.spi.ind.br -j LOG --log-prefix "EMAIL "
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d smtp.spi.ind.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 110 -d pop.spi.ind.br -j LOG --log-prefix "EMAIL "
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 110 -d pop.spi.ind.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 110 -d pop.spi.ind.br -j LOG --log-prefix "EMAIL "
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 110 -d pop.spi.ind.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d pop.spi.ind.br -j LOG --log-prefix "EMAIL "
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d pop.spi.ind.br -j MASQUERADE
#>Libera Acesso ao Servidor de Email: ALMAK
echo "Libera Acesso ao Servidor de Email: ALMAK"
sleep 1
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 25 -d smtp.almak.com.br -j LOG --log-prefix "EMAIL "
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 25 -d smtp.almak.com.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 25 -d smtp.almak.com.br -j LOG --log-prefix "EMAIL "
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 25 -d smtp.almak.com.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d smtp.almak.com.br -j LOG --log-prefix "EMAIL "
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d smtp.almak.com.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 110 -d pop.almak.com.br -j LOG --log-prefix "EMAIL "
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 110 -d pop.almak.com.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 110 -d pop.almak.com.br -j LOG --log-prefix "EMAIL "
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 110 -d pop.almak.com.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d pop.almak.com.br -j LOG --log-prefix "EMAIL "
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d pop.almak.com.br -j MASQUERADE
#>Libera Acesso ao Servidor de Email: MGSUL
echo "Libera Acesso ao Servidor de Email: MGSUL"
sleep 1
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 25 -d smtp.mgsul.ind.br -j LOG --log-prefix "EMAIL "
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 25 -d smtp.mgsul.ind.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 25 -d smtp.mgsul.ind.br -j LOG --log-prefix "EMAIL "
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 25 -d smtp.mgsul.ind.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d smtp.mgsul.ind.br -j LOG --log-prefix "EMAIL "
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d smtp.mgsul.ind.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 110 -d pop.mgsul.ind.br -j LOG --log-prefix "EMAIL "
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 110 -d pop.mgsul.ind.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 110 -d pop.mgsul.ind.br -j LOG --log-prefix "EMAIL "
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 110 -d pop.mgsul.ind.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d pop.mgsul.ind.br -j LOG --log-prefix "EMAIL "
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d pop.mgsul.ind.br -j MASQUERADE
#>Libera Acesso ao Servidor de Email: TIRA-TEIMA UOL
echo "Libera Acesso ao Servidor de Email: UOL"
sleep 1
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 25 -d smtp.uol.com.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 110 -d pop3.uol.com.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 25 -d smtp.ig.com.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 110 -d pop.ig.com.br -j MASQUERADE
#>Libera Acesso ao Servidor de Email: LetaFlex
echo "Libera Acesso ao Servidor de Email: LetaFlex"
sleep 1
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 25 -d smtp.letaflex.com.br -j LOG --log-level DEBUG --log-prefix ENV_EMAIL__LETAFLEX__TCP__
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 25 -d smtp.letaflex.com.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 25 -d smtp.letaflex.com.br -j LOG --log-level DEBUG --log-prefix ENV_EMAIL__LETAFLEX__UDP__
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 25 -d smtp.letaflex.com.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d smtp.letaflex.com.br -j LOG --log-level DEBUG --log-prefix ENV_EMAIL__LETAFLEX__TCP__
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d smtp.letaflex.com.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 110 -d pop.letaflex.com.br -j LOG --log-level DEBUG --log-prefix RECEB_EMAIL__LETAFLEX__TCP__
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 110 -d pop.letaflex.com.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 110 -d pop.letaflex.com.br -j LOG --log-level DEBUG --log-prefix RECEB_EMAIL__LETAFLEX__UDP__
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 110 -d pop.letaflex.com.br -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d pop.letaflex.com.br -j LOG --log-level DEBUG --log-prefix RECEB_EMAIL__LETAFLEX__TCP__
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d pop.letaflex.com.br -j MASQUERADE
###############################################CONECTIVIDADE SOCIAL##############################################################################
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d 200.201.174.0/24 -j LOG --log-level DEBUG --log-prefix CONECTIVIDADE_SOCIAL__TCP__
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d 200.201.174.0/24 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp -d 200.201.174.0/24 -j LOG --log-level DEBUG --log-prefix CONECTIVIDADE_SOCIAL__UDP__
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp -d 200.201.174.0/24 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d 200.194.179.90 -j LOG --log-level DEBUG --log-prefix CONECTIVIDADE_SOCIAL__TCP__
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d 200.194.179.90 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp -d 200.194.179.90 -j LOG --log-level DEBUG --log-prefix CONECTIVIDADE_SOCIAL__UDP__
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp -d 200.194.179.90 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d 200.201.173.68 -j LOG --log-level DEBUG --log-prefix CONECTIVIDADE_SOCIAL__TCP__
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d 200.201.173.68 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp -d 200.201.173.68 -j LOG --log-level DEBUG --log-prefix CONECTIVIDADE_SOCIAL__UDP__
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp -d 200.201.173.68 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d 200.201.166.200 -j LOG --log-level DEBUG --log-prefix CONECTIVIDADE_SOCIAL__TCP__
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d 200.201.166.200 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp -d 200.201.166.200 -j LOG --log-level DEBUG --log-prefix CONECTIVIDADE_SOCIAL__UDP__
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp -d 200.201.166.200 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d 200.225.81.34 -j LOG --log-level DEBUG --log-prefix CONECTIVIDADE_SOCIAL__TCP__
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d 200.225.81.34 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp -d 200.225.81.34 -j LOG --log-level DEBUG --log-prefix CONECTIVIDADE_SOCIAL__UDP__
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp -d 200.225.81.34 -j MASQUERADE
#>Libera TERMINAL SERVER ALMAK
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d 189.126.237.206 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp -d 189.126.237.206 -j MASQUERADE
#>Libera TERMINAL SERVER MGSUL
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d 189.127.243.56 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp -d 189.127.243.56 -j MASQUERADE
#>Libera TERMINAL SERVER SSA
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d 201.26.184.204 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp -d 201.26.184.204 -j MASQUERADE
#>Libera Acesso bradesconet empresas
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp -d 200.155.86.35 -j MASQUERADE
#>Libera IP Servidor Emails
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 0:65535 -d 50.97.96.57 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 0:65535 -d 50.97.96.57 -j MASQUERADE
#>Libera IP Servidor Emails
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 0:65535 -d 174.123.132.83 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 0:65535 -d 174.123.132.83 -j MASQUERADE
#>Libera IP Servidor Emails
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 0:65535 -d 189.38.92.254 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 0:65535 -d 189.38.92.254 -j MASQUERADE
#>Libera IP Servidor Emails
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 0:65535 -d 189.38.95.101 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 0:65535 -d 189.38.95.101 -j MASQUERADE
#>Libera IP Servidor Emails
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 0:65535 -d 189.38.92.250 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 0:65535 -d 189.38.92.250 -j MASQUERADE
#>Libera IP - Programa CAT - Comunicacao de Acidente de Trabalho
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport 5017 -d 200.152.32.148 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p udp --dport 5017 -d 200.152.32.148 -j MASQUERADE
iptables -A FORWARD -s 192.168.2.0/24 -m multiport -p tcp --port 43804,30229,10001,36567,80,10002,15000,36456,36570,37466,47611 -j ACCEPT
iptables -A FORWARD -s 192.168.2.0/24 -m multiport -p udp --port 43804,30229,36567,10001,27888,28888 -j ACCEPT
#>Politica padrao DROP
iptables -P INPUT DROP