[FUG-BR] RES: Gerenciar dois links

Wanderson Tinti wanderson em bsd.com.br
Domingo Novembro 2 13:56:08 BRST 2008


Olá pessoal, boa tarde.
Diego de uma olhada nessas regras:

rdr on $dsl_if from any to $dsl_if port 80 -> $web_apache port 80
nat on $cabo_if from $int_if to any -> ($cabo_if)

pass in on $dsl_if reply-to ( $dsl_if $gw ) inet proto tcp \
from any to $web_apache port 80 flags S/SAFR keep state

pass out on $cabo_if inet all keep state
pass out on $dsl_if inet proto tcp from any port 80 to any keep state
pass on $int_if inet all



2008/11/2 Vagner Gonçalves <vagner em vrvinfo.com.br>:
> Estas regras foram retiradas de um Server em produção, espero que te ajude.
>
> #RDR para um host interno através da 2 interface wan
> rdr on $interface_speedy proto tcp from any to $interface_speedy port { 80,
> 5222, 5223, 9090, 9091, 5269, 7777 } -> 10.10.1.10
>
>
> #permite o pacote na segunda placa wan
> pass in quick log on $interface_speedy proto tcp from any to 10.10.1.10 port
> { 5222, 5223, 9090, 9091, 5269, 7777 } flags S/SA keep state tag ROTA_1
>
> #Saida de um host pela segunda placa wan
> pass in quick on $interface_interna route-to {($interface_speedy
> $gw_speedy)} proto tcp from 10.10.1.10 to any flags S/SA keep state
> pass in quick on $interface_interna route-to {($interface_speedy
> $gw_speedy)} proto { udp, icmp } from 10.10.1.10 to any keep state
>
>
> #Tag para pacotes que venham da segunda interface externa com destino a
> interface interna
> pass out quick on $interface_interna reply-to ($interface_speedy $gw_speedy)
> proto tcp tagged ROTA_1 flags S/SA keep state
> pass out quick on $interface_interna reply-to ($interface_speedy $gw_speedy)
> tagged ROTA_1 keep state
>
> #E para que tudo acima funcione
> pass out on $interface_externa route-to ($interface_speedy $gw_speedy) from
> $interface_speedy to any
> pass out on $interface_speedy route-to ($interface_externa $gw_externa) from
> $interface_externa to any
>
>
> Abraços,
>
> Vagner Gonçalves (Slayer)
>
> -----Mensagem original-----
> De: freebsd-bounces em fug.com.br [mailto:freebsd-bounces em fug.com.br] Em nome
> de diego bulsing rodrigues
> Enviada em: domingo, 2 de novembro de 2008 02:49
> Para: Lista Brasileira de Discussão sobre FreeBSD (FUG-BR)
> Assunto: Re: [FUG-BR] Gerenciar dois links
>
> Valeu pelo link, não tinha acompanhado a discursão pois sou novo na lista,
> mas já tinha visto.
> Segue abaixo uma parte do pf.conf, junto com o tcpdump das placas externas.
> Se alguém tiver uma luz, por gentileza, serei grato, já que estou
> perdendo noites de sono por causa disso.
>
> defaultrouter="200.xx.xxx.xx"
>
> #pf.conf
>
> ext_if="xl0"
> int_if="xl1"
> ext_if2="vr0"
>
> ext_ip="200.xx.xxx.xx"
> nat_ip="200.xx.xxx.xx"
> ext_ip2="10.10.10.2"
> ext_gw2="10.10.10.1"
>
> server="192.168.1.100"
>
> # NAT
> nat on $ext_if from $int_if:network to any -> $nat_ip
> nat on $ext_if2 from $int_if:network to any -> $ext_ip2
>
> # RDR
> rdr on $ext_if2 proto tcp from any to $ext_ip2 port 80 tag ROUTE1 ->
> $server port 89
> rdr on $int_if from $int_if:network to $ext_if -> $int_if
>
> # LAN
> pass out quick on $int_if to $int_if:network $tcpflags keep state
> pass in quick on $int_if from $int_if:network to any $tcpflags keep state
>
> # WAN
> pass quick on $ext_if2
>
> pass in quick on $ext_if2_if reply-to ($ext_if2 $ext_gw2) from \
>        $server to any keep state
>
> pass out quick on $ext_if reply-to ($ext_if2 $ext_gw2) from \
>        $server to any tagged ROUTE1 keep state
>
> pass out on $ext_if route-to $ext_if2 from $ext_if2 to any
>
> block log
>
> firewall# tcpdump -pni vr0
>
> 01:39:02.548117 IP 189.24.44.244.55722 > 10.10.10.2.80: S
> 1586601675:1586601675(0) win 65535 <mss 1460,sackOK,eol>
> 01:39:05.877330 IP 189.24.44.244.55722 > 10.10.10.2.80: S
> 1586601675:1586601675(0) win 65535 <mss 1460,sackOK,eol>
> 01:39:09.213199 IP 189.24.44.244.55722 > 10.10.10.2.80: S
> 1586601675:1586601675(0) win 65535 <mss 1460,sackOK,eol>
> 01:39:15.664414 IP 189.24.44.244.55722 > 10.10.10.2.80: S
> 1586601675:1586601675(0) win 65535 <mss 1460,sackOK,eol>
>
> firewall# tcpdump -pni xl0
>
> 01:40:55.408132 IP 10.10.10.2.80 > 189.24.44.244.62060: S
> 4277088621:4277088621(0) ack 2084071544 win 16384
> <mss 1460,nop,wscale 0,nop,nop,timestamp 0 0,nop,nop,sackOK>
> 01:41:04.049022 IP 10.10.10.2.80 > 189.24.44.244.62060: S
> 4277088621:4277088621(0) ack 2084071544 win 16384
> <mss 1460,nop,wscale 0,nop,nop,timestamp 0 0,nop,nop,sackOK>
> 01:41:31.648221 IP 10.10.10.2.80 > 189.24.44.244.62293: S
> 62497568:62497568(0) ack 3116327218 win 16384
> <mss 1460,nop,wscale 0,nop,nop,timestamp 0 0,nop,nop,sackOK>
>
> Desde já agradeço.
>
>
>
> 2008/11/1 Thiago Gomes <thiagomespb em gmail.com>:
>> afinal essa discursão deste tema ficou como ??
>> http://www.fug.com.br/historico/html/freebsd/2008-10/msg00050.html
>>  e qual é a configuração correta ??
>>
>> 2008/11/1 Wanderson Tinti <wanderson em bsd.com.br>:
>>> Achei: http://www.fug.com.br/historico/html/freebsd/2008-10/msg00050.html
>>>
>>> 2008/11/1 Wanderson Tinti <wanderson em bsd.com.br>:
>>>> Não sei se você acompanhou uma discurção onde o reply-to foi muito
>>>> discutido, de uma olhada, talvez você consiga resolver seu problema.
>>>> Era algo como: dois links, uma nao acessível de fora.
>>>>
>>>> Boa sorte.
> -------------------------
> 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
>


Mais detalhes sobre a lista de discussão freebsd