Re: [FUG-BR] natd + ipfw + ip secundario
Se não me engano voce tem que fazer o nat da ida e volta do pacote. #ipfw add divert 8666 tcp from IP_INTERNO_EMAIL to any out #ipfw add divert 8666 tcp from any to IP_ALIAS in -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lucas Mocellin Sent: Tuesday, July 15, 2008 2:50 PM To: Lista Brasileira de Discussão sobre FreeBSD (FUG-BR); [EMAIL PROTECTED] Subject: [FUG-BR] natd + ipfw + ip secundario Boa tarde, Estou com o seguinte problema, talvez alguem possa me ajudar: Tenho uma máquina com dois ips (um é alias), e preciso fazer com que os e-mails destinados a um determinado servidor saiam com o ip do alias. O que eu fiz até agora foi o seguinte: natd -s -m -a ip_do_alias -p 8666 ipfw add divert 8666 tcp from me to any 25 out Rodando um tcpdump no servidor de destino eu vejo que a requisição chega com o ip do alias e é respondida, porém no servidor de origem parece que se perde. Alguem tem alguma luz? Agradeço desde ja. Lucas. - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
Re: [FUG-BR] natd + ipfw + ip secundario
eu geralmente uso pf para nat, mais como ja funcionou blz. 2008/7/15 Lucas Mocellin [EMAIL PROTECTED]: eh isso mesmo amigo, funcionou, muito obrigado. um abraço! Lucas. Em 15/07/08, Renato Frederick[EMAIL PROTECTED] escreveu: Se não me engano voce tem que fazer o nat da ida e volta do pacote. #ipfw add divert 8666 tcp from IP_INTERNO_EMAIL to any out #ipfw add divert 8666 tcp from any to IP_ALIAS in -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lucas Mocellin Sent: Tuesday, July 15, 2008 2:50 PM To: Lista Brasileira de Discussão sobre FreeBSD (FUG-BR); [EMAIL PROTECTED] Subject: [FUG-BR] natd + ipfw + ip secundario Boa tarde, Estou com o seguinte problema, talvez alguem possa me ajudar: Tenho uma máquina com dois ips (um é alias), e preciso fazer com que os e-mails destinados a um determinado servidor saiam com o ip do alias. O que eu fiz até agora foi o seguinte: natd -s -m -a ip_do_alias -p 8666 ipfw add divert 8666 tcp from me to any 25 out Rodando um tcpdump no servidor de destino eu vejo que a requisição chega com o ip do alias e é respondida, porém no servidor de origem parece que se perde. Alguem tem alguma luz? Agradeço desde ja. Lucas. - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd -- Alessandro de Souza Rocha Administrador de Redes e Sistemas FreeBSD-BR User #117 Long live FreeBSD Powered by (__) \\\'',) \/ \ ^ .\._/_) www.FreeBSD.org - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
Re: [FUG-BR] Natd + ipfw
Com toda já montei dessa forma vários servidores NAT. Você pode me dar mais detalhes se estiver dando algum erro?? On Wed, 20 Jul 2005 20:31:42 +, Giancarlo Rubio wrote On Wed, 2005-07-20 at 18:08 -0300, Gelsimauro Batista dos Santos wrote: FreeBSD - Servidor NAT Wireless com Controle de Banda 1- Configurando o Kernel cd /usr/src/sys/i386/conf cp GENERIC NOVOKERNEL ee NOVOKERNEL A- Depois de editar o Kernel options IPFIREWALL options IPFIREWALL_DEFAULT_TO_ACCEPT options IPFIREWALL_VERBOSE_LIMIT=300 options IPDIVERT options IPSTEALTH options DUMMYNET options TCP_DROP_SYNFIN . Gelsimauro Segui os passo a risca e nd. A configuracao das maquina q navegam estao com o gateway da maquina q faz nat so isso basta?? Giancarlo ___ Freebsd mailing list Freebsd@fug.com.br http://mail.fug.com.br/mailman/listinfo/freebsd_fug.com.br -- Open WebMail Project (http://openwebmail.org) ___ Freebsd mailing list Freebsd@fug.com.br http://mail.fug.com.br/mailman/listinfo/freebsd_fug.com.br
Re: [FUG-BR] Natd + ipfw
Nao me retorna erro algum. Segui passo a passo, apenas retirei o controle de banda pois nao necessito. Giancarlo Gelsimauro Batista dos Santos disse: Com toda já montei dessa forma vários servidores NAT. Você pode me dar mais detalhes se estiver dando algum erro?? On Wed, 20 Jul 2005 20:31:42 +, Giancarlo Rubio wrote On Wed, 2005-07-20 at 18:08 -0300, Gelsimauro Batista dos Santos wrote: FreeBSD - Servidor NAT Wireless com Controle de Banda 1- Configurando o Kernel cd /usr/src/sys/i386/conf cp GENERIC NOVOKERNEL ee NOVOKERNEL A- Depois de editar o Kernel options IPFIREWALL options IPFIREWALL_DEFAULT_TO_ACCEPT options IPFIREWALL_VERBOSE_LIMIT=300 options IPDIVERT options IPSTEALTH options DUMMYNET options TCP_DROP_SYNFIN . Gelsimauro Segui os passo a risca e nd. A configuracao das maquina q navegam estao com o gateway da maquina q faz nat so isso basta?? Giancarlo ___ Freebsd mailing list Freebsd@fug.com.br http://mail.fug.com.br/mailman/listinfo/freebsd_fug.com.br -- Open WebMail Project (http://openwebmail.org) ___ Freebsd mailing list Freebsd@fug.com.br http://mail.fug.com.br/mailman/listinfo/freebsd_fug.com.br ___ Freebsd mailing list Freebsd@fug.com.br http://mail.fug.com.br/mailman/listinfo/freebsd_fug.com.br
Re: [FUG-BR] Natd + ipfw
digite ipfw list veja somente deve aparecer as regras abaixo. Se tiver mais de 4 linhas seu firewall deve estar bloquendo não?? 00050 allow ip from any to any via lo0 00051 deny ip from any to 127.0.0.0/8 00052 divert 8668 ip from any to any via rl0 65535 allow ip from any to any Aqui novamente mais enxuto regra pra criar a nat 1- Configurando o Kernel cd /usr/src/sys/i386/conf cp GENERIC NOVOKERNEL ee NOVOKERNEL A- Depois de editar o Kernel options IPFIREWALL options IPFIREWALL_DEFAULT_TO_ACCEPT options IPFIREWALL_VERBOSE_LIMIT=300 options IPDIVERT options IPSTEALTH options DUMMYNET options TCP_DROP_SYNFIN B- Compilando execute os seguintes comandos: config NOVOKERNEL cd ../../compile/SEUKERNEL make depend make make install fastboot ee /etc/rc.conf ifconfig_rl0=inet 100.100.100.2 netmask 255.255.255.192 ifconfig_rl1=inet 192.168.1.1 netmask 255.255.255.0 defaultrouter=100.100.100.1 hostname=servidor gateway_enable=YES sshd_enable=YES natd -f /etc/gbs/natd.conf sh /etc/gbs/rc.filters Interfaces de NAT ee /etc/gbs/natd.conf interface rl0 dynamic yes same_ports yes use_sockets yes Esse arquivo será executado dessa forma natd f /etc/gbs/natd.conf. ee /etc/gbs/rc.filters com o conteúdo abaixo #!/bin/sh /sbin/ipfw -f flush /sbin/ipfw add 51 allow ip from any to any via lo0 /sbin/ipfw add 52 deny ip from any to 127.0.0.0/8 /sbin/ipfw add 53 divert 8668 all from any to any via rl0 digite sh /etc/gbs/rc.filters para executa-lo ___ Freebsd mailing list Freebsd@fug.com.br http://mail.fug.com.br/mailman/listinfo/freebsd_fug.com.br
Re: [FUG-BR] Natd + ipfw
Um detalhe meu ip da internet nao eh fixo..o resto esta igual isso altera alguma coisa? meu ipfw # ipfw list 00051 allow ip from any to any via lo0 00052 deny ip from any to 127.0.0.0/8 00053 divert 8668 ip from any to any via sk0 65535 allow ip from any to any # natd.conf interface sk0 dynamic yes use_sockets yes same_ports yes natd esta rodando Att Giancarlo On Thu, 2005-07-21 at 17:00 -0300, Gelsimauro Batista dos Santos wrote: digite ipfw list veja somente deve aparecer as regras abaixo. Se tiver mais de 4 linhas seu firewall deve estar bloquendo não?? 00050 allow ip from any to any via lo0 00051 deny ip from any to 127.0.0.0/8 00052 divert 8668 ip from any to any via rl0 65535 allow ip from any to any Aqui novamente mais enxuto regra pra criar a nat 1- Configurando o Kernel cd /usr/src/sys/i386/conf cp GENERIC NOVOKERNEL ee NOVOKERNEL A- Depois de editar o Kernel options IPFIREWALL options IPFIREWALL_DEFAULT_TO_ACCEPT options IPFIREWALL_VERBOSE_LIMIT=300 options IPDIVERT options IPSTEALTH options DUMMYNET options TCP_DROP_SYNFIN B- Compilando execute os seguintes comandos: config NOVOKERNEL cd ../../compile/SEUKERNEL make depend make make install fastboot ee /etc/rc.conf ifconfig_rl0=inet 100.100.100.2 netmask 255.255.255.192 ifconfig_rl1=inet 192.168.1.1 netmask 255.255.255.0 defaultrouter=100.100.100.1 hostname=servidor gateway_enable=YES sshd_enable=YES natd -f /etc/gbs/natd.conf sh /etc/gbs/rc.filters Interfaces de NAT ee /etc/gbs/natd.conf interface rl0 dynamic yes same_ports yes use_sockets yes Esse arquivo será executado dessa forma “natd –f /etc/gbs/natd.conf. ee /etc/gbs/rc.filters com o conteúdo abaixo #!/bin/sh /sbin/ipfw -f flush /sbin/ipfw add 51 allow ip from any to any via lo0 /sbin/ipfw add 52 deny ip from any to 127.0.0.0/8 /sbin/ipfw add 53 divert 8668 all from any to any via rl0 digite sh /etc/gbs/rc.filters para executa-lo ___ Freebsd mailing list Freebsd@fug.com.br http://mail.fug.com.br/mailman/listinfo/freebsd_fug.com.br ___ Freebsd mailing list Freebsd@fug.com.br http://mail.fug.com.br/mailman/listinfo/freebsd_fug.com.br
Re: [FUG-BR] Natd + ipfw
Cara se você tem isso tudo configurado então só resta verificar se a linha gateway_enable=YES esta /etc/rc.local pois sem ela não faz nat quanto ao seu IP ser obtido por DHCP eu tenho um servidor FreeBSD funcionado assim isso não influencia. On Thu, 21 Jul 2005 18:07:09 +, Giancarlo Rubio wrote Um detalhe meu ip da internet nao eh fixo..o resto esta igual isso altera alguma coisa? meu ipfw # ipfw list 00051 allow ip from any to any via lo0 00052 deny ip from any to 127.0.0.0/8 00053 divert 8668 ip from any to any via sk0 65535 allow ip from any to any # natd.conf interface sk0 dynamic yes use_sockets yes same_ports yes natd esta rodando ___ Freebsd mailing list Freebsd@fug.com.br http://mail.fug.com.br/mailman/listinfo/freebsd_fug.com.br
Re: [FUG-BR] Natd + ipfw
ja tava no rc.conf Tem algum log ou maneira de eu testar se esta funcioanndo td? Giancarlo On Thu, 2005-07-21 at 19:51 -0300, Gelsimauro Batista dos Santos wrote: Cara se você tem isso tudo configurado então só resta verificar se a linha gateway_enable=YES esta /etc/rc.local pois sem ela não faz nat quanto ao seu IP ser obtido por DHCP eu tenho um servidor FreeBSD funcionado assim isso não influencia. On Thu, 21 Jul 2005 18:07:09 +, Giancarlo Rubio wrote Um detalhe meu ip da internet nao eh fixo..o resto esta igual isso altera alguma coisa? meu ipfw # ipfw list 00051 allow ip from any to any via lo0 00052 deny ip from any to 127.0.0.0/8 00053 divert 8668 ip from any to any via sk0 65535 allow ip from any to any # natd.conf interface sk0 dynamic yes use_sockets yes same_ports yes natd esta rodando ___ Freebsd mailing list Freebsd@fug.com.br http://mail.fug.com.br/mailman/listinfo/freebsd_fug.com.br ___ Freebsd mailing list Freebsd@fug.com.br http://mail.fug.com.br/mailman/listinfo/freebsd_fug.com.br
Re: [FUG-BR] Natd + ipfw
porque não tenta o m0n0wall - http://m0n0.ch/wall Giancarlo Rubio escreveu: Alguem possui um bom tutorial de ipfw +natd para compartilhar a conexao?? Giancarlo ___ Freebsd mailing list Freebsd@fug.com.br http://mail.fug.com.br/mailman/listinfo/freebsd_fug.com.br
Re: [FUG-BR] Natd + ipfw
Nao tem q ser no bsd mesmo. Giancarlo On Wed, 2005-07-20 at 17:15 -0300, Carlos A. Talhati wrote: From: Carlos A. Talhati [EMAIL PROTECTED] Reply-To: Lista de discussao do grupo FUG-BR Freebsd@fug.com.br To: Lista de discussao do grupo FUG-BR Freebsd@fug.com.br Subject: Re: [FUG-BR] Natd + ipfw Date: Wed, 20 Jul 2005 17:15:45 -0300 (20:15 UTC) porque não tenta o m0n0wall - http://m0n0.ch/wall Giancarlo Rubio escreveu: Alguem possui um bom tutorial de ipfw +natd para compartilhar a conexao?? Giancarlo ___ Freebsd mailing list Freebsd@fug.com.br http://mail.fug.com.br/mailman/listinfo/freebsd_fug.com.br
Re: [FUG-BR] Natd + ipfw
On Wed, 2005-07-20 at 18:08 -0300, Gelsimauro Batista dos Santos wrote: FreeBSD - Servidor NAT Wireless com Controle de Banda 1- Configurando o Kernel cd /usr/src/sys/i386/conf cp GENERIC NOVOKERNEL ee NOVOKERNEL A- Depois de editar o Kernel options IPFIREWALL options IPFIREWALL_DEFAULT_TO_ACCEPT options IPFIREWALL_VERBOSE_LIMIT=300 options IPDIVERT options IPSTEALTH options DUMMYNET options TCP_DROP_SYNFIN . Gelsimauro Segui os passo a risca e nd. A configuracao das maquina q navegam estao com o gateway da maquina q faz nat so isso basta?? Giancarlo ___ Freebsd mailing list Freebsd@fug.com.br http://mail.fug.com.br/mailman/listinfo/freebsd_fug.com.br