[FUG-BR] ipfw + 3 way handshake

Luiz Gustavo S. Costa luizgustavo em luizgustavo.pro.br
Sexta Agosto 30 20:09:21 BRT 2013


Em 30 de agosto de 2013 20:01, Marcelo Gondim <gondim em bsdinfo.com.br> escreveu:
>
> Pessoal,
>
> Estou com um problema que é o seguinte. Quando coloco essa regra:
>
> ipfw add allow tcp from any to me 80 in via em0 setup limit src-addr 10
>
> Na minha concepção só seria registrado como regra consumindo stateful se
> houvesse o 3 way handshake na tentativa de conexão, por causa do setup.
> Ou o ipfw não faz dessa forma? Eu sei que o pf tem esse recurso usando o
> synproxy.
>
>   The synproxy state option can be used to cause
>   pf(4) itself to complete the handshake with the active endpoint, perform
>   a handshake with the passive endpoint, and then forward packets between
>   the endpoints.
>
> []'s
> Gondim
> -------------------------
> Histórico: http://www.fug.com.br/historico/html/freebsd/
> Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd


Godim,

Por padrão, o ipfw não mantem estado (state), você tem que especificar
isso, veja no man [1], na sessão de examplos, tem um exemplo do que
você quer fazer:

  ipfw add check-state
  ipfw add deny tcp from any to any established
  ipfw add allow tcp from my-net to any setup keep-state

  ipfw add allow tcp from my-net/24 to any setup limit src-addr 10
  ipfw add allow tcp from any to me setup limit src-addr 4


[1] http://www.freebsd.org/cgi/man.cgi?query=ipfw&apropos=0&sektion=0&manpath=FreeBSD+9.1-RELEASE&arch=default&format=html#EXAMPLES

-- 
Luiz Gustavo Costa (Powered by BSD)
*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
mundoUnix - Consultoria em Software Livre
http://www.mundounix.com.br
ICQ: 2890831 / MSN: contato em mundounix.com.br
Tel: 55 (21) 4063-7110 / 8194-1905 / (11) 4063-0407
Blog: http://www.luizgustavo.pro.br


Mais detalhes sobre a lista de discussão freebsd