Gule # escreveu: > Nada feito > ------------------------- > Histórico: http://www.fug.com.br/historico/html/freebsd/ > Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd > > !DSPAM:8,46bc72a26401354521195!
Cara, estou te passando meu script, pra ver se te ajuda: É a seguinte arquitetura |Internet| | |LAN| | | Proxy Loja X Mail Server ----- Firewall (PF) ---|--- Roteador Nuvem FR------/--- Proxy Loja Y \ Proxy Loja Z -------------------- # $Id: pf.conf,v 1.57 2007/07/18 20:16:28 root Exp $ # /etc/pf.conf by RZ if_ext = "rl0" if_dmz = "xl0" if_lan = "xl1" if_vpn = "tun0" ext_ip = "200.x.x.x" icmp_types = "echoreq" rfc1918 = "{ 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 }" lan_net = "172.17.0.0/24" dmz_net = "192.168.0.0/24" ext_net = "200.x.x.x/29" lojas_net = "172.16.0.0/16" proxies_net = "192.168.255.0/24" voip_net = "172.25.0.0/24" vpn_net = "10.255.255.255/24" lojas_vpn_net = "172.18.16.0/16" nat_ip_lan = "200.x.x.x" nat_ip_proxies = "200.x.x.x" nat_ip_lojas = "200.x.x.x" tcp_in_fw = "{ 3003 }" udp_in_fw = "{ 1194 }" tcp_fwd_lan = "{ 20 21 22 53 80 443 2004 2011 3003 8500 }" udp_fwd_lan = "{ 53 123 }" tcp_fwd_lojas = "{ 20 21 22 25 80 81:83 110 123 143 220 443 465 990:996 1025 1707 1863 2002 2004 2010 2011 2525 2631 3003 3004 3007 3310 3389 3456 4017 5017 5080 5169 5297 5999 6000 6891:6901 7791 8017 8080 8087 8088 8097 8180 8443 8500 9900 21234 31125 31651 41651 54731 }" ips_liberados = "{ 172.16.5.163 172.16.5.158 172.16.13.180 }" destinos_liberados = "{ 204.11.233.76 204.11.233.58 204.11.233.62 204.11.233.52 161.148.185.46 200.255.15.215 200.255.15.220 200.255.15.0/24 }" ext_ip_naboo1 = "200.x.x.x" dmz_ip_naboo1 = "192.168.0.11" tcp_fwd_naboo1 = "{ 20 21 25 2525 110 143 993 995 80 443 }" udp_fwd_naboo1 = "{ 53 }" ext_ip_naboo2 = "200.x.x.x" dmz_ip_naboo2 = "192.168.0.12" udp_fwd_naboo2 = "{ 53 }" tcp_fwd_naboo2 = "{ 25 }" table <privadas> { $lan_net $proxies_net $lojas_net } set optimization normal set block-policy return set loginterface $if_ext #---- libera lo0 ----# set skip on lo0 #---- Normaliza os pacotes -----# scrub in all scrub out all no-df max-mss 1492 random-id #-------------- NAT para a Lan e para as Lojas ------------------# nat on $if_ext from $lan_net to any -> $nat_ip_lan nat on $if_ext from $lojas_net to any -> $nat_ip_lojas nat on $if_ext from $proxies_net to any -> $nat_ip_proxies #-------------- NAT OpenVpn ------------------# nat on $if_lan from $vpn_net to any -> $if_lan #--------------- NAT para mail server (ip1) ----------------# nat on $if_ext from $dmz_ip_naboo1 to any -> $ext_ip_naboo1 rdr on $if_ext proto tcp from any to $ext_ip_naboo1 port $tcp_fwd_naboo1 -> $dmz_ip_naboo1 rdr on $if_ext proto udp from any to $ext_ip_naboo1 port $udp_fwd_naboo1 -> $dmz_ip_naboo1 rdr on $if_lan proto tcp from <privadas> to $ext_ip_naboo1 port $tcp_fwd_naboo1 -> $dmz_ip_naboo1 rdr on $if_lan proto udp from <privadas> to $ext_ip_naboo1 port $udp_fwd_naboo1 -> $dmz_ip_naboo1 #--------------- NAT para mail server (ip2) ----------------# nat on $if_ext from $dmz_ip_naboo2 to any -> $ext_ip_naboo2 rdr on $if_ext proto tcp from any to $ext_ip_naboo2 port $tcp_fwd_naboo2 -> $dmz_ip_naboo2 rdr on $if_ext proto udp from any to $ext_ip_naboo2 port $udp_fwd_naboo2 -> $dmz_ip_naboo2 rdr on $if_lan proto tcp from <privadas> to $ext_ip_naboo2 port $tcp_fwd_naboo2 -> $dmz_ip_naboo2 rdr on $if_lan proto udp from <privadas> to $ext_ip_naboo2 port $udp_fwd_naboo2 -> $dmz_ip_naboo2 #---- RDR FTP Proxy ----# rdr on $if_lan proto tcp from any to any port 21 -> 127.0.0.1 port 8021 rdr on $if_dmz proto tcp from any to any port 21 -> 127.0.0.1 port 8021 #----- Bloqueia entrada por default ---------# block in all #---- Bloqueia identificação de SO pelo NMAP -------# block in quick os NMAP block in quick proto tcp flags FUP/FUP block in quick proto tcp flags FUP/WEUAPRSF block in quick proto tcp flags WEUAPRSF/WEUAPRSF block in quick proto tcp flags SRAFU/WEUAPRSF block in quick proto tcp flags /WEUAPRSF block in quick proto tcp flags SR/SR block in quick proto tcp flags SF/SF block in quick proto tcp flags SF/SRFA block in quick proto tcp flags /SRFA #----- Libera saida ---------# pass out proto tcp all modulate state pass out proto { udp, icmp } all keep state #----- Bloqueia redes reservadas vindas pela interface externa --------# block drop in quick on $if_ext from $rfc1918 to any block drop out quick on $if_ext from any to $rfc1918 #---- FTP Proxy ----# pass in on $if_lan from { $lan_net $proxies_net $lojas_net } to lo0 keep state pass in on $if_dmz from $dmz_net to lo0 keep state pass in on $if_ext inet proto tcp from any to $if_ext \ user proxy keep state #----- Permite conexoes no firewall pela internet --------# pass in on $if_ext inet proto tcp from any to $ext_ip port $tcp_in_fw \ flags S/SA keep state pass in on $if_ext inet proto udp from any to $ext_ip port $udp_in_fw \ keep state #----- OpenVPN --------# pass in on $if_vpn from $vpn_net to { $lan_net $lojas_net $proxies_net $voip_net } \ keep state pass in on $if_lan from { $lan_net $lojas_net $proxies_net $voip_net } to $vpn_net \ keep state pass in on $if_vpn from $lojas_vpn_net to { $lan_net $lojas_net $proxies_net $voip_net } \ keep state pass in on $if_lan from { $lan_net $lojas_net $proxies_net $voip_net } to $lojas_vpn_net \ keep state #----- Libera portas de conexao para mail server (ip1 e ip2) --------# pass in on $if_ext inet proto tcp from any to $dmz_ip_naboo1 port $tcp_fwd_naboo1 \ flags S/SA synproxy state pass in on $if_ext inet proto udp from any to $dmz_ip_naboo1 port $udp_fwd_naboo1 \ synproxy state pass in on $if_ext inet proto tcp from any to $dmz_ip_naboo2 port $tcp_fwd_naboo2 \ flags S/SA synproxy state pass in on $if_ext inet proto udp from any to $dmz_ip_naboo2 port $udp_fwd_naboo2 \ synproxy state #----- Libera geral para ips liberados pass in on $if_lan inet proto tcp from $ips_liberados to any keep state pass in on $if_lan inet proto udp from $ips_liberados to any keep state #----- Permite aos servidores da Lan efetuarem conexoes na internet ------# pass in on $if_lan inet proto tcp from $if_lan:network to any port $tcp_fwd_lan \ keep state pass in on $if_lan inet proto udp from $if_lan:network to any port $udp_fwd_lan \ keep state pass in on $if_lan inet proto tcp from $if_lan:network to $destinos_liberados keep state pass in on $if_lan inet proto udp from $if_lan:network to $destinos_liberados keep state #- Permite aos computadores das lojas efetuarem conexoes na internet -# pass in on $if_lan inet proto tcp from $lojas_net to any port $tcp_fwd_lojas \ keep state pass in on $if_lan inet proto udp from $lojas_net to any port $udp_fwd_lojas \ keep state pass in on $if_lan inet proto tcp from $lojas_net to $destinos_liberados keep state pass in on $if_lan inet proto udp from $lojas_net to $destinos_liberados keep state #- Permite aos proxies lojas efetuarem conexoes na internet -# pass in on $if_lan inet proto tcp from $proxies_net to any port $tcp_fwd_lojas \ keep state pass in on $if_lan inet proto udp from $proxies_net to any port $udp_fwd_lojas \ keep state pass in on $if_lan inet proto tcp from $proxies_net to $destinos_liberados keep state pass in on $if_lan inet proto udp from $proxies_net to $destinos_liberados keep state #-- Permite aos computadores da dmz efetuarem conexoes na internet -----# block in quick on $if_dmz from $if_dmz:network to <privadas> pass in on $if_dmz from $if_dmz:network to any keep state #----- Permite ICMP -------------# pass in inet proto icmp all icmp-type $icmp_types keep state -- Cordialmente, Rodolfo Zappa Archive TSP - Total Solution Provider Nosso negócio é garantir que a sua rede de informações não pare! (21) 2567-1842 [EMAIL PROTECTED] http://www.archive.com.br "Se a gente se lança sem vigor, sete de dez ações tomadas não dão certo. É extremamente difícil tomar decisões num estado de agitação. Por outro lado, se sem se preocupar com as conseqüências menores, abordamos os problemas com o espírito afiado como uma lâmina, sempre encontramos a solução em menos tempo do que é necessáio para respirar sete vezes." Nabeshima Naoshige (1538-1618) ------------------------- Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd