[FUG-BR] Bandwidth e Proxy/Squid

Welkson Renny de Medeiros welkson em focusautomacao.com.br
Quarta Abril 15 21:22:02 BRT 2009


Wanderson Tinti escreveu:
> Pessoal, boa noite.
> Estou com uma maquina em laboratório e estou tentando introduzir um
> controle de banda (dummynet) para a rede interna; Essa maquina roda,
> squid, nat e ipfw. Só que não consigo controlar a banda quando o squid
> está em funcionamento. Venho procurando a solução a 2 dias, procurei
> no histórico da fug e pela internet a fora, infelizmente não tive
> resultado positivo. Acredito que alguém tenha um ambiente desse em
> funcionamento. Vocês usam o squid na mesma maquina que faz controle de
> banda ou tem executado o squid em uma maquina separada do servidor que
> controla a banda?
> Qualquer intenção de ajuda será muito bem vindo.
>
> Minhas regras tem sido todas em stateless, abaixo tem um exemplo em teste:
>
> sysctl -w net.inet.ip.fw.one_pass=0
>
> eu=10.2.100.100
>
> cmdfw="/sbin/ipfw"
> skip="skipto 8000"
> ext_if="xl0"
> int_if="rl0"
> lan="10.2.100.0/24"
> $cmdfw -f flush
>
> $cmdfw add 500 divert natd ip from any to me in via xl0
> $cmdfw add 600 fwd 10.2.100.100,3128 tcp from $lan to any 80 in via $int_if
> $cmdfw add 700 allow ip from any to any via $int_if
>
> $cmdfw add 790 pipe 30 all from any to 10.2.100.1 in via $ext_if
> $cmdfw add 800 pipe 31 all from 10.2.100.1 to any out via $ext_if
> $cmdfw pipe 30 config mask dst-ip 0x000000ff bw 128Kbit/s queue 10KBytes
> $cmdfw pipe 31 config mask src-ip 0x000000ff bw 64Kbit/s queue 10KBytes
>
>
> $cmdfw add 2000 $skip udp from any to any 53 out
> $cmdfw add 2010 $skip icmp from any to any out
> $cmdfw add 2020 $skip tcp from me to any 80 out
> $cmdfw add 2030 $skip tcp from $lan to any 443 out
> $cmdfw add 3000 deny all from any to any out
>
> $cmdfw add 3100 allow udp from any 53 to any in
> $cmdfw add 3200 allow icmp from any to any in
> $cmdfw add 3300 allow tcp from any 80 to me  in
> $cmdfw add 3400 allow tcp from any 443 to $lan in
> $cmdfw add 4000 deny all from any to any in
>
> $cmdfw add 8000 divert natd all from any to any out
> $cmdfw add 8010 allow all from any to any out
> $cmdfw add 9999 deny all from any to any
>
> Bom pessoal a regra se resume nisso.
> Obrigado, Wanderson.
> -------------------------
> Histórico: http://www.fug.com.br/historico/html/freebsd/
> Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
>
>
>   
Coloca os pipes antes do divert e fwd (proxy transparente).

-
Welkson Renny de Medeiros
Focus Automação Comercial
Desenvolvimento / Gerência de Redes
welkson em focusautomacao.com.br
 
 
 
                      Powered by ....
 
                                           (__)
                                        \\\'',)
                                          \/  \ ^
                                          .\._/_)
 
                                      www.FreeBSD.org 




Mais detalhes sobre a lista de discussão freebsd