[FUG-BR] Uma ajuda para NAT com PF
amigos, estou precisando de um help com PF e NAT, na qual antes de qualquer pessoa dizer que o que falta é leitura ou erros de sintaxe quero deixar claro que segui o padrão que já havia conseguido fazer com o pf.conf no OpenBSD meus passos foram: 1) recompilar o kernel com: device pf device pflog device pfsync options ALTQ options ALTQ_CBQ options ALTQ_RED options ALTQ_RIO options ALTQ_HFSC options ALTQ_PRIQ options ALTQ_NOPCC (falta alguma coisa aqui em cima?) minhas regras são simples, por enquanto, apenas ativar o NAT para um pc por tras do servidor navegar, porém não consigo no FreeBSD eis minhas regras de pf.cong # MACROS nic_interna = vge3 nic_externa = vge0 # TABELAS table rede { 172.16.30.0/28 } # OPCOES set skip on lo0 set block-policy return scrub in all # NAT nat on $nic_externa from rede to any - ($nic_externa) # pass all # pfctl -Fa pfctl /etc/pf.conf e nada de navegação no computador da LAN se eu ativar o squid nesse servidor, e por proxy na conf do navegador, ai funciona, porém navegação direta não no meu primeiro teste, estava tentando natear os IPs nao roteaveis da lan para outro IP nao roteavel de uma DMZ cliente 172.16.1.2 - server 172.16.1.1 | nat 192.168.0.13 - 200.XXX.XXX.XXX porém, agora tentei conectando direto o servidor ao roteador com um IP valido e fazer nat da lan e tbm nao funcionou? precisa de mais algo pra ativar o NAT ? abraços e agradeço muitissimo qualquer ajuda -- ENIO RODRIGO MARCONCINI www.Enio.Pro.Br skype: eniorm FreeBSD -:- OpenBSD -:- Slackware Coleções Marcas de Cigarros Obi-Wan has taught you well - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
Re: [FUG-BR] Uma ajuda para NAT com PF
2009/8/6 Enio Marconcini -:- www.Enio.Pro.Br -:- eni...@gmail.com: amigos, estou precisando de um help com PF e NAT, na qual antes de qualquer pessoa dizer que o que falta é leitura ou erros de sintaxe quero deixar claro que segui o padrão que já havia conseguido fazer com o pf.conf no OpenBSD meus passos foram: 1) recompilar o kernel com: device pf device pflog device pfsync options ALTQ options ALTQ_CBQ options ALTQ_RED options ALTQ_RIO options ALTQ_HFSC options ALTQ_PRIQ options ALTQ_NOPCC (falta alguma coisa aqui em cima?) minhas regras são simples, por enquanto, apenas ativar o NAT para um pc por tras do servidor navegar, porém não consigo no FreeBSD eis minhas regras de pf.cong # MACROS nic_interna = vge3 nic_externa = vge0 # TABELAS table rede { 172.16.30.0/28 } # OPCOES set skip on lo0 set block-policy return scrub in all # NAT nat on $nic_externa from rede to any - ($nic_externa) # pass all # pfctl -Fa pfctl /etc/pf.conf pfctl -Fa pfctl -f /etc/pf.conf depois disso, execute e cole os resultados # pfctl -sa # sysctl net.inet.ip.forwarding # ifconfig # netstat -nr -- Renato Botelho - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
Re: [FUG-BR] Uma ajuda para NAT com PF
2009/8/6 Renato Botelho rbga...@gmail.com pfctl -Fa pfctl -f /etc/pf.conf depois disso, execute e cole os resultados # pfctl -sa # sysctl net.inet.ip.forwarding # ifconfig # netstat -nr -- Renato Botelho - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd aí vai hobbit# pfctl -Fa rules cleared nat cleared 0 tables deleted. altq cleared 0 states cleared source tracking entries cleared pf: statistics cleared pf: interface flags reset hobbit# (para checar a sintaxe) hobbit# pfctl -n -f /etc/pf.conf hobbit# (carrego as regras) hobbit# pfctl -f /etc/pf.conf hobbit# (show nat) hobbit# pfctl -sn nat on vge0 from rede_pref to any - (vge0) round-robin hobbit# (pingo um dominio, e resolve, entao meu dns-cache está OK) hobbit# ping -c1 www.google.com.br PING www.l.google.com (74.125.67.147): 56 data bytes 64 bytes from 74.125.67.147: icmp_seq=0 ttl=240 time=147.859 ms (vou no note que pertente a lan, pingo no google e tbm resolve) c:\ping www.google.com.br Disparando contra www.1.google.com [74.125.67.147] com 32 bytes de dados (no servidor) hobbit# sysctl net.inet.ip.forwarding net.inet.ip.forwarding: 1 hobbit# hobbit# ifconfig vr0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 1500 options=2808VLAN_MTU,WOL_UCAST,WOL_MAGIC ether 00:17:31:27:1c:06 inet 192.168.0.13 netmask 0xff00 broadcast 192.168.0.255 media: Ethernet autoselect (100baseTX full-duplex) status: active vge0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 1500 options=1bRXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING ether 00:0c:42:1a:56:14 inet 200.200.200.0 netmask 0xfff8 broadcast 200.200.200.255 media: Ethernet autoselect (100baseTX full-duplex) status: active vge1: flags=8802BROADCAST,SIMPLEX,MULTICAST metric 0 mtu 1500 options=1bRXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING ether 00:0c:42:1a:56:15 media: Ethernet autoselect (none) status: no carrier vge2: flags=8802BROADCAST,SIMPLEX,MULTICAST metric 0 mtu 1500 options=1bRXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING ether 00:0c:42:1a:56:16 media: Ethernet autoselect (none) status: no carrier vge3: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 1500 options=1bRXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING ether 00:0c:42:1a:56:17 inet 172.16.30.1 netmask 0xfff0 broadcast 172.16.30.15 media: Ethernet autoselect (1000baseTX full-duplex) status: active plip0: flags=108810POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT metric 0 mtu 1500 pfsync0: flags=0 metric 0 mtu 1460 syncpeer: 224.0.0.240 maxupd: 128 lo0: flags=8049UP,LOOPBACK,RUNNING,MULTICAST metric 0 mtu 16384 inet 127.0.0.1 netmask 0xff00 pflog0: flags=0 metric 0 mtu 33204 as placas vge1 e 2 não estão em uso, vr0 está conectado na minha LAN que conecta ao meu desktop, vge0 conectado ao roteador, e vge3 ao meu notebook /etc/rc.conf o defaultrouter está setado para o IP do roteador, o netstat -nr mostra corretamente o IP do meu default router o que eu acho mais estranho de tudo é que tenho seguido o padrão que usei no pf.conf do OpenBSD e que consegui natear conexões, ainda por cima usando block all, depois fui liberando o que precisava, no caso agora do PF no Free eu nem deixando o final com pass all nao funciona -- ENIO RODRIGO MARCONCINI www.Enio.Pro.Br skype: eniorm FreeBSD -:- OpenBSD -:- Slackware Coleções Marcas de Cigarros Obi-Wan has taught you well - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
Re: [FUG-BR] Uma ajuda para NAT com PF
2009/8/6 Enio Marconcini -:- www.Enio.Pro.Br -:- eni...@gmail.com: 2009/8/6 Renato Botelho rbga...@gmail.com pfctl -Fa pfctl -f /etc/pf.conf depois disso, execute e cole os resultados # pfctl -sa # sysctl net.inet.ip.forwarding # ifconfig # netstat -nr -- Renato Botelho - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd aí vai hobbit# pfctl -Fa rules cleared nat cleared 0 tables deleted. altq cleared 0 states cleared source tracking entries cleared pf: statistics cleared pf: interface flags reset hobbit# (para checar a sintaxe) hobbit# pfctl -n -f /etc/pf.conf hobbit# (carrego as regras) hobbit# pfctl -f /etc/pf.conf hobbit# (show nat) hobbit# pfctl -sn # pfctl -sa Do seu laptop # traceroute -n www.uol.com.br -- Renato Botelho - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
Re: [FUG-BR] Uma ajuda para NAT com PF
2009/8/6 Renato Botelho rbga...@gmail.com # pfctl -sa Do seu laptop # traceroute -n www.uol.com.br -- Renato Botelho - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd pfctl -sa gera bastante linhas: hobbit# pfctl -sa TRANSLATION RULES: nat on vge0 from rede_pref to any - (vge0) round-robin FILTER RULES: scrub in all fragment reassemble pass all flags S/SA keep state No queue in use INFO: Status: Disabled for 0 days 00:01:33 Debug: Urgent State Table Total Rate current entries0 searches 00.0/s inserts00.0/s removals 00.0/s Counters match 00.0/s bad-offset 00.0/s fragment 00.0/s short 00.0/s normalize 00.0/s memory 00.0/s bad-timestamp 00.0/s congestion 00.0/s ip-option 00.0/s proto-cksum00.0/s state-mismatch 00.0/s state-insert 00.0/s state-limit00.0/s src-limit 00.0/s synproxy 00.0/s TIMEOUTS: tcp.first 120s tcp.opening 30s tcp.established 86400s tcp.closing 900s tcp.finwait 45s tcp.closed 90s tcp.tsdiff 30s udp.first60s udp.single 30s udp.multiple 60s icmp.first 20s icmp.error 10s other.first 60s other.single 30s other.multiple 60s frag 30s interval 10s adaptive.start 6000 states adaptive.end 12000 states src.track 0s LIMITS: stateshard limit1 src-nodes hard limit1 frags hard limit 5000 tableshard limit 1000 table-entries hard limit 20 TABLES: rede_pref OS FINGERPRINTS: 696 fingerprints loaded hobbit# porém o tracert do meu note só alcançou o IP do servidor, apos isso só apareceu asteriscos e esgotado o tempo limite, mas o traceroute no servidor para um ip externo foi -- ENIO RODRIGO MARCONCINI www.Enio.Pro.Br skype: eniorm FreeBSD -:- OpenBSD -:- Slackware Coleções Marcas de Cigarros Obi-Wan has taught you well - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
Re: [FUG-BR] Uma ajuda para NAT com PF
rapaz, depois de tudo que vi (saídas dos comandos que renato falou), recomendo começar do zero. a iface com IP válido é vge0, isso ? cria um pf.conf beeem simples com: nat on vge0 from any to any - (vge0) salva e carrega. tenta então. só mais uma coisa, não vi nada sobre como tá a rede no cliente (notebook se não engano). tais diretamente logado no roteador ou via ssh ? matheus -- We will call you cygnus, The God of balance you shall be A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? http://en.wikipedia.org/wiki/Posting_style - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
[FUG-BR] Uma ajuda com o NAT
Boa tarde a todos Estou tentando fazer uma configuração no FreeBSD 5.4 e nada. Deve ser simples pra quem esta acostumado. Agradeço a ajuda. Preciso fazer um gateway para separar duas sub-rede que tem o mesmo bloco de IP em uma delas. A saida para a rl0 deve ser sempre com o IP 10.9.17.25 Kernel compilado com: options INCLUDE_CONFIG_FILE options IPFIREWALL options IPFIREWALL_FORWARD options IPFIREWALL_DEFAULT_TO_ACCEPT options IPFIREWALL_VERBOSE options IPFIREWALL_VERBOSE_LIMIT=100 options IPDIVERT options DUMMYNET options TCP_DROP_SYNFIN /etc/rc.conf ifconfig_rl0=inet 10.9.17.25 netmask 255.255.240.0 ifconfig_xl0=inet 10.0.17.4 netmask 255.255.240.0 ifconfig_xl0_alias0=inet 10.0.19.200 netmask 255.255.240.0 ifconfig_xl0_alias1=inet 10.0.19.201 netmask 255.255.240.0 gateway_enable=YES natd_enable=YES natd_flags=-l -u -f /etc/natd.conf natd_interface=rl0 -- EOF /etc/natd.conf interface xl0 dynamic yes same_ports yes use_sockets yes #redirecionamento de IP redirect_address 10.9.17.1 10.0.19.200 redirect_address 10.9.17.3 10.0.19.201 -- EOF Tentei usar o ipfw para redirecionar os pacotes e nada. /sbin/ipfw add fwd 10.9.17.3 all from 10.0.16.0/20 to 10.0.19.201 /sbin/ipfw add divert natd all from any to any via rl0 in ___ freebsd mailing list freebsd@fug.com.br http://lists.fug.com.br/listinfo.cgi/freebsd-fug.com.br
Re: [FUG-BR] Uma ajuda
o google é seu amigo, eu fui dar uma vista d´olhos e achei uns links interessantes que provávelmente respondem sua pergunta (veja do 3o em diante): http://google.vtnc.org/ http://www.google.com/search?sourceid=navclientie=UTF-8rls=WZPA,WZPA:2006- 01,WZPA:enq=ipfw+caixa flames /dev/null Original Message: - From: BRUNNO [EMAIL PROTECTED] Date: Tue, 7 Feb 2006 15:54:31 -0200 To: Freebsd@fug.com.br Subject: [FUG-BR] Uma ajuda Estou com um pequeno problena na Conectividade Social da Caixa , quando ativo meu squid ela para de funcionar já tentei varias regras e nenhuma da certo.. mail2web - Check your email from the web at http://mail2web.com/ . ___ freebsd mailing list freebsd@fug.com.br http://lists.fug.com.br/listinfo.cgi/freebsd-fug.com.br