Re: [FUG-BR] CARP - (longo)

2005-08-24 Por tôpico Ricardo A Reis

Sergio,


Ve se isso nao e o seu caso!


At this point only passive mode FTP connections will function. To enable 
active mode connections, the ftp-data connection that the FTP server 
initiates must be passed in on the firewall. Unfortunately, the port 
that this connection comes in on can't be known beforehand, only the 
range that it falls within. What is known, however, is that the 
connection will be initiated from port 20 (ftp-data port) and that 
ftp-proxy will be accepting the connection (and then relaying data to 
the client). Since ftp-proxy runs as the user proxy, the user keyword 
can be used in the filter rule.


   pass in on $ext_if inet proto tcp from port 20 to ($ext_if) \
   user proxy flags S/SA keep state 



http://www.openbsd.org/faq/pf/ftp.html

Aqui funciona perfeitamente!!


3) NOVAMENTE : NÃO CONSIGO FAZER O FTP FUNCIONAR
CORRETAMENTE DO PF.

O ftp-proxy tá instalado e rodando via inetd :
ftp-proxy   stream  tcp nowait  root/usr/libexec/ftp-proxy
ftp-proxy

tcp4   0  0  *.8021 *.*
LISTEN

no pf :

rdr on $int_if proto tcp from any to ! me port ftp - 127.0.0.1 port
8021

Ftp via squid tá ok,  mas quando tem que sair direto do cliente fazendo
nat
não funciona de jeito nenhum.tinfo/freebsd_fug.com.br

 




___
Freebsd mailing list
Freebsd@fug.com.br
http://mail.fug.com.br/mailman/listinfo/freebsd_fug.com.br


[FUG-BR] CARP - (longo)

2005-08-16 Por tôpico Sérgio José Ferreira
Boa Noite, 

Coloquei o CARP pra funcionar no seguinte ambiente :

   (internet)
|
switch wan---
|   |
|   |
   DMZ--[HOST_A]..sync..[HOST_B]--DMZ
|   |
|   |
switch lan===
|   |   |   |   |
clientes-

Neste caso, preciso de redundância em 3 interfaces WAN, DMZ e
LAN.

sysctl :

sysctl -w net.inet.carp.allow=1
sysctl -w net.inet.carp.preempt=1
sysctl -w net.inet.carp.log=1
sysctl -w net.inet.carp.arpbalance=0

o rc.conf do host A :

cloned_interfaces=carp0 carp1 carp2
network_interfaces=lo0 xl0 re0 bge0 bge1 carp0 carp1 carp2 pfsync0

# Controle do Cluster - CARP
ifconfig_xl0=inet 10.10.10.1 netmask 255.255.255.252
ifconfig_pfsync0=up syncif xl0

# Acesso a rede interna ( carp0 )
ifconfig_re0=inet 172.30.30.59 netmask 255.255.255.192

# Acesso a DMZ ( carp1)
ifconfig_bge1=inet 200.200.200.61  netmask 255.255.255.192

# Acesso a Internet ( carp2 )
ifconfig_bge0=inet 200.200.200.125  netmask 255.255.255.192

#
ifconfig_carp0=vhid 1 pass lan 172.30.30.10/26
ifconfig_carp0_alias0=172.30.30.29/32
ifconfig_carp1=vhid 2 pass dmz 200.200.200.1/26
ifconfig_carp2=vhid 3 pass wan 200.200.200.67/26

Já os Ips do CARP são idênticos nos dois hosts, ficando a diferença
apenas na hierarquia.

Rc.conf do host B:   

cloned_interfaces=carp0 carp1 carp2
network_interfaces=lo0 rl0 vr0 fxp0 fxp1 carp0 carp1 carp2 pfsync0

# Controle do Cluster - CARP
ifconfig_rl0=inet 10.10.10.2 netmask 255.255.255.252
ifconfig_pfsync0=up syncif rl0
#

# Acesso a rede interna
ifconfig_vr0=inet 172.30.30.60 netmask 255.255.255.192
#
# Acesso a Internet
ifconfig_fxp0=inet 200.178.1.126  netmask 255.255.255.192
# ifconfig_fxp0=inet 200.178.1.68  netmask 255.255.255.192
#
# Acesso a DMZ
ifconfig_fxp1=inet 200.178.1.62  netmask 255.255.255.192
#

ifconfig_carp0=vhid 1 advskew 100 pass lan 172.30.30.10/26
ifconfig_carp0_alias0=172.30.30.29/32
ifconfig_carp1=vhid 2 advskew 100 pass dmz 200.178.1.1/26
ifconfig_carp2=vhid 3 advskew 100 pass wan 200.178.1.67/26

O pf foi ativado e está fazendo NAT na interface WAN.

MyLocalNet=172.30.30.0/23
NoNat=! 200.200.200.0/25
nat on $ext_if from $MyLocalNet to $NoNat - carp2

Até aqui, funcionando 90%.

Problemas encontrados :

1) Estas máquinas rodam squid. Assim, quando o squid vai
acessar um site o endereço usado é o da interface real, cujo
IP é diferente entre os hosts( bge0 e fxp0 ). Se acontece algo
e o segundo host assume, todas as conexões caem pq o IP é 
diferente. 
  = Fiz NAT do IP da bge0 também..assim, sai sempre com o IP 
da interface CARP2. 
nat on $ext_if from 200.178.1.125 to $NoNat - carp2
  = até aqui resolvido.

2) Se no host A tiro uma interface do ar para simular
um problema, todas as interfaces desta máquina deverião
passar de MASTER para BACKUP e o host B deveria assumir.
Neste ponto, apenas a interface que tirei do ar é que tá
ficando INIT no host A e no host B MASTER, as outras
interfaces permanecem MASTER no host A e isso está errado.
  = Solução ???

Resolvendo isso, posso fazer um howto do carp bem 
explicadinho para ajudar quem precisa.

e
3) NOVAMENTE : NÃO CONSIGO FAZER O FTP FUNCIONAR
CORRETAMENTE DO PF.

O ftp-proxy tá instalado e rodando via inetd :
ftp-proxy   stream  tcp nowait  root/usr/libexec/ftp-proxy
ftp-proxy

tcp4   0  0  *.8021 *.*
LISTEN

no pf :

rdr on $int_if proto tcp from any to ! me port ftp - 127.0.0.1 port
8021

Ftp via squid tá ok,  mas quando tem que sair direto do cliente fazendo
nat
não funciona de jeito nenhum.


[]'s

Sérgio José Ferreira
WGO Telecom






___
Freebsd mailing list
Freebsd@fug.com.br
http://mail.fug.com.br/mailman/listinfo/freebsd_fug.com.br


RES: [FUG-BR] CARP - (longo) - Ops

2005-08-16 Por tôpico Sérgio José Ferreira
No host B deveria ser os Ips 200.200.200 

Mas a anta aqui esqueceu de substituir e colocou os reais. Não venham me
atacar tá.

[]'s

Sérgio.


___
Freebsd mailing list
Freebsd@fug.com.br
http://mail.fug.com.br/mailman/listinfo/freebsd_fug.com.br