Re: [FUG-BR] Erro ao controlar banda usando PF
Em 29/01/07, Cristina Fernandes Silva<[EMAIL PROTECTED]> escreveu: > Alguem tem uma regra usando IPFW+dummynet que possa me disponibilizar para > controle de banda, NAT > e redirecionamento para o squid, nao tenho uma experiencia nele. > > Agradeço a todos > > > Obrigada > > Cristina > > > --- [EMAIL PROTECTED] escreveu: > > > Para provedor de internet, o ideal seria utilizar dummynet. > > > > Em 28/1/2007, "Cristina Fernandes Silva" <[EMAIL PROTECTED]> > > escreveu: > > > > >Pessoal, > > > > > >Sei que ja foi muito discutido aqui na lista, mas estou a maior duvida,vou > > >implementar um > > servidor > > >voltado para um pequeno provedor de internet e estou precisando de um > > >controle de banda eficaz, > > >estou tentando fazer em PF, eis o pf.conf > > > > > >#- > > >int_int="rl0" > > >int_ext="vr0" > > >rede="172.168.0.0" > > > > > >PING = "echoreq" > > >TCP_IN = "{ ssh, ftp, 20, 21, 443 }" > > >UDP_IN = "{ }" > > > > > > > > >TCP_OUT = "{ ssh, 20, 21, ftp, http, 443, ntp, 8080, 5999 }" > > >UDP_OUT = "{ domain, ntp }" > > > > > ># Link > > >down="512Kb" > > >uplo="512Kb" > > > > > >server1="127.0.0.1" > > ># > > ># tabela de Ips internos > > > > > >table { 172.168.0.2, 172.168.0.3, 172.168.0.5, 172.168.0.9, > > >172.168.0.10, 172.168.0.13, > > >172.168.0.15, 172.168.0.16, 172.168.0.17, 172. > > >168.0.18 } > > > > > ># normalizando os pacotes > > ># > > >set timeout { tcp.first 60 tcp.opening 15 tcp.established 86400 \ > > >tcp.closing 300 tcp.finwait 15 tcp.closed 15 } > > >set timeout { udp.first 30 udp.single 15 udp.multiple 30 } > > >set timeout { icmp.first 10 icmp.error 5 } > > >set limit { states 5 frags 25000 } > > >set optimization aggressive > > >set loginterface $int_ext > > >set loginterface $int_int > > >set block-policy return > > >set require-order yes > > >scrub all fragment reassemble random-id no-df > > > > > ># Habilita enfileiramento > > ># > > > > > >altq on $int_int bandwidth $down cbq queue { normal_in baixa_in } > > > queue normal_in bandwidth 256Kb priority 0 cbq(default borrow red) > > > queue baixa_in bandwidth 128Kb priority 1 cbq(borrow red) > > > > > > > > >altq on $int_ext bandwidth $uplo cbq queue { normal_on baixa_on } > > > queue normal_on bandwidth 256Kb priority 0 cbq(default) > > > queue baixa_on bandwidth 128Kb priority 1 > > > > > ># Fazendo o NAT > > >nat on $int_ext inet from $int_int:network to any ->($int_ext) > > > > > > > > ># Redicrecionamento > > ># > > >rdr on $int_int inet proto tcp from any to $int_ext port 80 -> 127.0.0.1 > > >port 3128 > > > > > ># bloqueando spoof > > >antispoof for { $int_ext } inet > > > > > ># bloqueando scanners > > >block drop in quick on { $int_int } from any os { NMAP } > > > > > >#Liberando loopback > > >pass quick on lo0 all > > > > > ># liberando ping/traceroute > > >pass out log on $int_ext inet proto icmp all icmp-type 8 code 0 keep state > > >pass in log on $int_ext inet proto icmp all icmp-type 8 code 0 keep state > > > > > ># Liberando portas > > >#INCOMING > > >#TCP > > >pass in quick on $int_ext inet proto tcp from any to $int_ext port $TCP_IN > > >flags S/SA keep > > state > > >#UDP > > >#pass in quick on $int_ext inet proto udp from any to $int_ext port > > >$UDP_IN keep state > > >#PING > > >pass in quick on $int_ext inet proto icmp from any to $int_ext icmp-type > > >$PING keep state > > > > > >#OUTGOING > > >#EXTERNAL INTERFACE > > > > > >#TCP > > >pass out quick on $int_ext inet proto tcp from $int_ext to any port > > >$TCP_OUT flags S/SA keep > > >state > > > > > >#UDP > > >pass out quick on $int_ext inet proto udp from $int_ext to any port > > >$UDP_OUT keep state > > > > > >#ICMP > > >pass out quick on $int_ext inet proto icmp from $int_ext to any icmp-type > > >$PING keep state > > > > > ># Liberando acesso > > >pass in log on $int_int from to any keep state queue normal_in > > >pass in log on $int_int from to any keep state queue baixa_in > > > > > >pass out log on $int_ext from to any keep state queue normal_on > > >pass out log on $int_ext from to any keep state queue baixa_on > > > > > > > > >Porem acho que nao estou conseguindo fazer este controle, quando faço > > >medição utilizando um > > >velocimetro tipo esse http://www.gratis.com.br/velo/medidor.mv esta > > >acusando 335.76 kbps > > apensar > > >que do ip esta na table de baixa (172.16.0.5) e esta designado para > > >256kpbs. ( Alguem tem > > algum > > >programa em freeBSD ou Windows para medir a velocidade ? ) > > > > > >Vcs podem dar uma olhada este scripts e ver o que esta errado ou então > > >fornecer um exemplo que > > eu > > >possa usar para controlar a banda usando o PF, caso nao seja possivel me > > >mandar com IPFW. > > > > > >Obrigada > > > > > >Cristina > > > > > >
Re: [FUG-BR] Erro ao controlar banda usando PF
Em 29/01/07, Cristina Fernandes Silva<[EMAIL PROTECTED]> escreveu: > Alguem tem uma regra usando IPFW+dummynet que possa me disponibilizar para > controle de banda, NAT > e redirecionamento para o squid, nao tenho uma experiencia nele. > > Agradeço a todos > > > Obrigada > > Cristina > > > --- [EMAIL PROTECTED] escreveu: > > > Para provedor de internet, o ideal seria utilizar dummynet. > > > > Em 28/1/2007, "Cristina Fernandes Silva" <[EMAIL PROTECTED]> > > escreveu: > > > > >Pessoal, > > > > > >Sei que ja foi muito discutido aqui na lista, mas estou a maior duvida,vou > > >implementar um > > servidor > > >voltado para um pequeno provedor de internet e estou precisando de um > > >controle de banda eficaz, > > >estou tentando fazer em PF, eis o pf.conf > > > > > >#- > > >int_int="rl0" > > >int_ext="vr0" > > >rede="172.168.0.0" > > > > > >PING = "echoreq" > > >TCP_IN = "{ ssh, ftp, 20, 21, 443 }" > > >UDP_IN = "{ }" > > > > > > > > >TCP_OUT = "{ ssh, 20, 21, ftp, http, 443, ntp, 8080, 5999 }" > > >UDP_OUT = "{ domain, ntp }" > > > > > ># Link > > >down="512Kb" > > >uplo="512Kb" > > > > > >server1="127.0.0.1" > > ># > > ># tabela de Ips internos > > > > > >table { 172.168.0.2, 172.168.0.3, 172.168.0.5, 172.168.0.9, > > >172.168.0.10, 172.168.0.13, > > >172.168.0.15, 172.168.0.16, 172.168.0.17, 172. > > >168.0.18 } > > > > > ># normalizando os pacotes > > ># > > >set timeout { tcp.first 60 tcp.opening 15 tcp.established 86400 \ > > >tcp.closing 300 tcp.finwait 15 tcp.closed 15 } > > >set timeout { udp.first 30 udp.single 15 udp.multiple 30 } > > >set timeout { icmp.first 10 icmp.error 5 } > > >set limit { states 5 frags 25000 } > > >set optimization aggressive > > >set loginterface $int_ext > > >set loginterface $int_int > > >set block-policy return > > >set require-order yes > > >scrub all fragment reassemble random-id no-df > > > > > ># Habilita enfileiramento > > ># > > > > > >altq on $int_int bandwidth $down cbq queue { normal_in baixa_in } > > > queue normal_in bandwidth 256Kb priority 0 cbq(default borrow red) > > > queue baixa_in bandwidth 128Kb priority 1 cbq(borrow red) > > > > > > > > >altq on $int_ext bandwidth $uplo cbq queue { normal_on baixa_on } > > > queue normal_on bandwidth 256Kb priority 0 cbq(default) > > > queue baixa_on bandwidth 128Kb priority 1 > > > > > ># Fazendo o NAT > > >nat on $int_ext inet from $int_int:network to any ->($int_ext) > > > > > > > > ># Redicrecionamento > > ># > > >rdr on $int_int inet proto tcp from any to $int_ext port 80 -> 127.0.0.1 > > >port 3128 > > > > > ># bloqueando spoof > > >antispoof for { $int_ext } inet > > > > > ># bloqueando scanners > > >block drop in quick on { $int_int } from any os { NMAP } > > > > > >#Liberando loopback > > >pass quick on lo0 all > > > > > ># liberando ping/traceroute > > >pass out log on $int_ext inet proto icmp all icmp-type 8 code 0 keep state > > >pass in log on $int_ext inet proto icmp all icmp-type 8 code 0 keep state > > > > > ># Liberando portas > > >#INCOMING > > >#TCP > > >pass in quick on $int_ext inet proto tcp from any to $int_ext port $TCP_IN > > >flags S/SA keep > > state > > >#UDP > > >#pass in quick on $int_ext inet proto udp from any to $int_ext port > > >$UDP_IN keep state > > >#PING > > >pass in quick on $int_ext inet proto icmp from any to $int_ext icmp-type > > >$PING keep state > > > > > >#OUTGOING > > >#EXTERNAL INTERFACE > > > > > >#TCP > > >pass out quick on $int_ext inet proto tcp from $int_ext to any port > > >$TCP_OUT flags S/SA keep > > >state > > > > > >#UDP > > >pass out quick on $int_ext inet proto udp from $int_ext to any port > > >$UDP_OUT keep state > > > > > >#ICMP > > >pass out quick on $int_ext inet proto icmp from $int_ext to any icmp-type > > >$PING keep state > > > > > ># Liberando acesso > > >pass in log on $int_int from to any keep state queue normal_in > > >pass in log on $int_int from to any keep state queue baixa_in > > > > > >pass out log on $int_ext from to any keep state queue normal_on > > >pass out log on $int_ext from to any keep state queue baixa_on > > > > > > > > >Porem acho que nao estou conseguindo fazer este controle, quando faço > > >medição utilizando um > > >velocimetro tipo esse http://www.gratis.com.br/velo/medidor.mv esta > > >acusando 335.76 kbps > > apensar > > >que do ip esta na table de baixa (172.16.0.5) e esta designado para > > >256kpbs. ( Alguem tem > > algum > > >programa em freeBSD ou Windows para medir a velocidade ? ) > > > > > >Vcs podem dar uma olhada este scripts e ver o que esta errado ou então > > >fornecer um exemplo que > > eu > > >possa usar para controlar a banda usando o PF, caso nao seja possivel me > > >mandar com IPFW. > > > > > >Obrigada > > > > > >Cristina > > > > > >
Re: [FUG-BR] Erro ao controlar banda usando PF
Alguem tem uma regra usando IPFW+dummynet que possa me disponibilizar para controle de banda, NAT e redirecionamento para o squid, nao tenho uma experiencia nele. Agradeço a todos Obrigada Cristina --- [EMAIL PROTECTED] escreveu: > Para provedor de internet, o ideal seria utilizar dummynet. > > Em 28/1/2007, "Cristina Fernandes Silva" <[EMAIL PROTECTED]> > escreveu: > > >Pessoal, > > > >Sei que ja foi muito discutido aqui na lista, mas estou a maior duvida,vou > >implementar um > servidor > >voltado para um pequeno provedor de internet e estou precisando de um > >controle de banda eficaz, > >estou tentando fazer em PF, eis o pf.conf > > > >#- > >int_int="rl0" > >int_ext="vr0" > >rede="172.168.0.0" > > > >PING = "echoreq" > >TCP_IN = "{ ssh, ftp, 20, 21, 443 }" > >UDP_IN = "{ }" > > > > > >TCP_OUT = "{ ssh, 20, 21, ftp, http, 443, ntp, 8080, 5999 }" > >UDP_OUT = "{ domain, ntp }" > > > ># Link > >down="512Kb" > >uplo="512Kb" > > > >server1="127.0.0.1" > ># > ># tabela de Ips internos > > > >table { 172.168.0.2, 172.168.0.3, 172.168.0.5, 172.168.0.9, > >172.168.0.10, 172.168.0.13, > >172.168.0.15, 172.168.0.16, 172.168.0.17, 172. > >168.0.18 } > > > ># normalizando os pacotes > ># > >set timeout { tcp.first 60 tcp.opening 15 tcp.established 86400 \ > >tcp.closing 300 tcp.finwait 15 tcp.closed 15 } > >set timeout { udp.first 30 udp.single 15 udp.multiple 30 } > >set timeout { icmp.first 10 icmp.error 5 } > >set limit { states 5 frags 25000 } > >set optimization aggressive > >set loginterface $int_ext > >set loginterface $int_int > >set block-policy return > >set require-order yes > >scrub all fragment reassemble random-id no-df > > > ># Habilita enfileiramento > ># > > > >altq on $int_int bandwidth $down cbq queue { normal_in baixa_in } > > queue normal_in bandwidth 256Kb priority 0 cbq(default borrow red) > > queue baixa_in bandwidth 128Kb priority 1 cbq(borrow red) > > > > > >altq on $int_ext bandwidth $uplo cbq queue { normal_on baixa_on } > > queue normal_on bandwidth 256Kb priority 0 cbq(default) > > queue baixa_on bandwidth 128Kb priority 1 > > > ># Fazendo o NAT > >nat on $int_ext inet from $int_int:network to any ->($int_ext) > > > > > ># Redicrecionamento > ># > >rdr on $int_int inet proto tcp from any to $int_ext port 80 -> 127.0.0.1 > >port 3128 > > > ># bloqueando spoof > >antispoof for { $int_ext } inet > > > ># bloqueando scanners > >block drop in quick on { $int_int } from any os { NMAP } > > > >#Liberando loopback > >pass quick on lo0 all > > > ># liberando ping/traceroute > >pass out log on $int_ext inet proto icmp all icmp-type 8 code 0 keep state > >pass in log on $int_ext inet proto icmp all icmp-type 8 code 0 keep state > > > ># Liberando portas > >#INCOMING > >#TCP > >pass in quick on $int_ext inet proto tcp from any to $int_ext port $TCP_IN > >flags S/SA keep > state > >#UDP > >#pass in quick on $int_ext inet proto udp from any to $int_ext port $UDP_IN > >keep state > >#PING > >pass in quick on $int_ext inet proto icmp from any to $int_ext icmp-type > >$PING keep state > > > >#OUTGOING > >#EXTERNAL INTERFACE > > > >#TCP > >pass out quick on $int_ext inet proto tcp from $int_ext to any port $TCP_OUT > >flags S/SA keep > >state > > > >#UDP > >pass out quick on $int_ext inet proto udp from $int_ext to any port $UDP_OUT > >keep state > > > >#ICMP > >pass out quick on $int_ext inet proto icmp from $int_ext to any icmp-type > >$PING keep state > > > ># Liberando acesso > >pass in log on $int_int from to any keep state queue normal_in > >pass in log on $int_int from to any keep state queue baixa_in > > > >pass out log on $int_ext from to any keep state queue normal_on > >pass out log on $int_ext from to any keep state queue baixa_on > > > > > >Porem acho que nao estou conseguindo fazer este controle, quando faço > >medição utilizando um > >velocimetro tipo esse http://www.gratis.com.br/velo/medidor.mv esta acusando > >335.76 kbps > apensar > >que do ip esta na table de baixa (172.16.0.5) e esta designado para 256kpbs. > > ( Alguem tem > algum > >programa em freeBSD ou Windows para medir a velocidade ? ) > > > >Vcs podem dar uma olhada este scripts e ver o que esta errado ou então > >fornecer um exemplo que > eu > >possa usar para controlar a banda usando o PF, caso nao seja possivel me > >mandar com IPFW. > > > >Obrigada > > > >Cristina > > > > > >__ > >Fale com seus amigos de graça com o novo Yahoo! Messenger > >http://br.messenger.yahoo.com/ > >- > >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.co
Re: [FUG-BR] Erro ao controlar banda usando PF
Eu ainda não consegui entender essa parte: 0x00ff Em 28/01/07, Helizonaldo Alves de Morais<[EMAIL PROTECTED]> escreveu: > Bom segue a regra que eu uso no ipfw > > ipfw pipe 10 config mask src-ip 0x00ff bw 64kbit/s queue 20Kbytes > ipfw pipe 12 config mask dst-ip 0x00ff bw 64kbit/s queue 20Kbytes > > ipfw add 91 pipe 10 all from any to 192.168.0.0/16 > ipfw add 92 pipe 12 all from 192.168.0.0/16 to any > > > Helizonaldo Alves de Morais > Teresina-PI Brasil. > +-+ >o _ _ _ >_o /\_ _ \\o (_)\__/o (_) > _< \_ _>(_) (_)/<_\_| \ _|/' \/ > (_)>(_) (_)(_) (_)(_)' _\o_ > > > >Pessoal, > > > >Sei que ja foi muito discutido aqui na lista, mas estou a maior duvida,vou > >implementar um servidor > >voltado para um pequeno provedor de internet e estou precisando de um > >controle de banda eficaz, > >estou tentando fazer em PF, eis o pf.conf > > > >#- > >int_int="rl0" > >int_ext="vr0" > >rede="172.168.0.0" > > > >PING = "echoreq" > >TCP_IN = "{ ssh, ftp, 20, 21, 443 }" > >UDP_IN = "{ }" > > > > > >TCP_OUT = "{ ssh, 20, 21, ftp, http, 443, ntp, 8080, 5999 }" > >UDP_OUT = "{ domain, ntp }" > > > ># Link > >down="512Kb" > >uplo="512Kb" > > > >server1="127.0.0.1" > ># > ># tabela de Ips internos > > > >table { 172.168.0.2, 172.168.0.3, 172.168.0.5, 172.168.0.9, > >172.168.0.10, 172.168.0.13, > >172.168.0.15, 172.168.0.16, 172.168.0.17, 172. > >168.0.18 } > > > ># normalizando os pacotes > ># > >set timeout { tcp.first 60 tcp.opening 15 tcp.established 86400 \ > > tcp.closing 300 tcp.finwait 15 tcp.closed 15 } > >set timeout { udp.first 30 udp.single 15 udp.multiple 30 } > >set timeout { icmp.first 10 icmp.error 5 } > >set limit { states 5 frags 25000 } > >set optimization aggressive > >set loginterface $int_ext > >set loginterface $int_int > >set block-policy return > >set require-order yes > >scrub all fragment reassemble random-id no-df > > > ># Habilita enfileiramento > ># > > > >altq on $int_int bandwidth $down cbq queue { normal_in baixa_in } > >queue normal_in bandwidth 256Kb priority 0 cbq(default borrow red) > >queue baixa_in bandwidth 128Kb priority 1 cbq(borrow red) > > > > > >altq on $int_ext bandwidth $uplo cbq queue { normal_on baixa_on } > >queue normal_on bandwidth 256Kb priority 0 cbq(default) > >queue baixa_on bandwidth 128Kb priority 1 > > > ># Fazendo o NAT > >nat on $int_ext inet from $int_int:network to any ->($int_ext) > > > > > ># Redicrecionamento > ># > >rdr on $int_int inet proto tcp from any to $int_ext port 80 -> 127.0.0.1 > >port 3128 > > > ># bloqueando spoof > >antispoof for { $int_ext } inet > > > ># bloqueando scanners > >block drop in quick on { $int_int } from any os { NMAP } > > > >#Liberando loopback > >pass quick on lo0 all > > > ># liberando ping/traceroute > >pass out log on $int_ext inet proto icmp all icmp-type 8 code 0 keep state > >pass in log on $int_ext inet proto icmp all icmp-type 8 code 0 keep state > > > ># Liberando portas > >#INCOMING > >#TCP > >pass in quick on $int_ext inet proto tcp from any to $int_ext port $TCP_IN > >flags S/SA keep state > >#UDP > >#pass in quick on $int_ext inet proto udp from any to $int_ext port $UDP_IN > >keep state > >#PING > >pass in quick on $int_ext inet proto icmp from any to $int_ext icmp-type > >$PING keep state > > > >#OUTGOING > >#EXTERNAL INTERFACE > > > >#TCP > >pass out quick on $int_ext inet proto tcp from $int_ext to any port > >$TCP_OUT flags S/SA keep > >state > > > >#UDP > >pass out quick on $int_ext inet proto udp from $int_ext to any port > >$UDP_OUT keep state > > > >#ICMP > >pass out quick on $int_ext inet proto icmp from $int_ext to any icmp-type > >$PING keep state > > > ># Liberando acesso > >pass in log on $int_int from to any keep state queue normal_in > >pass in log on $int_int from to any keep state queue baixa_in > > > >pass out log on $int_ext from to any keep state queue normal_on > >pass out log on $int_ext from to any keep state queue baixa_on > > > > > >Porem acho que nao estou conseguindo fazer este controle, quando faço > >medição utilizando um > >velocimetro tipo esse http://www.gratis.com.br/velo/medidor.mv esta > >acusando 335.76 kbps apensar > >que do ip esta na table de baixa (172.16.0.5) e esta designado para > >256kpbs. ( Alguem tem algum > >programa em freeBSD ou Windows para medir a velocidade ? ) > > > >Vcs podem dar uma olhada este scripts e ver o que esta errado ou então > >fornecer um exemplo que eu > >possa usar para controlar a banda usando o PF, caso nao seja possivel me > >mandar com IPFW. > > > >Obrigada > > > >Cristina > > > > > >__ > >Fale com seus amigos de graça co
Re: [FUG-BR] Erro ao controlar banda usando PF
Bom segue a regra que eu uso no ipfw ipfw pipe 10 config mask src-ip 0x00ff bw 64kbit/s queue 20Kbytes ipfw pipe 12 config mask dst-ip 0x00ff bw 64kbit/s queue 20Kbytes ipfw add 91 pipe 10 all from any to 192.168.0.0/16 ipfw add 92 pipe 12 all from 192.168.0.0/16 to any Helizonaldo Alves de Morais Teresina-PI Brasil. +-+ o _ _ _ _o /\_ _ \\o (_)\__/o (_) _< \_ _>(_) (_)/<_\_| \ _|/' \/ (_)>(_) (_)(_) (_)(_)' _\o_ >Pessoal, > >Sei que ja foi muito discutido aqui na lista, mas estou a maior duvida,vou >implementar um servidor >voltado para um pequeno provedor de internet e estou precisando de um >controle de banda eficaz, >estou tentando fazer em PF, eis o pf.conf > >#- >int_int="rl0" >int_ext="vr0" >rede="172.168.0.0" > >PING = "echoreq" >TCP_IN = "{ ssh, ftp, 20, 21, 443 }" >UDP_IN = "{ }" > > >TCP_OUT = "{ ssh, 20, 21, ftp, http, 443, ntp, 8080, 5999 }" >UDP_OUT = "{ domain, ntp }" > ># Link >down="512Kb" >uplo="512Kb" > >server1="127.0.0.1" ># ># tabela de Ips internos > >table { 172.168.0.2, 172.168.0.3, 172.168.0.5, 172.168.0.9, >172.168.0.10, 172.168.0.13, >172.168.0.15, 172.168.0.16, 172.168.0.17, 172. >168.0.18 } > ># normalizando os pacotes ># >set timeout { tcp.first 60 tcp.opening 15 tcp.established 86400 \ > tcp.closing 300 tcp.finwait 15 tcp.closed 15 } >set timeout { udp.first 30 udp.single 15 udp.multiple 30 } >set timeout { icmp.first 10 icmp.error 5 } >set limit { states 5 frags 25000 } >set optimization aggressive >set loginterface $int_ext >set loginterface $int_int >set block-policy return >set require-order yes >scrub all fragment reassemble random-id no-df > ># Habilita enfileiramento ># > >altq on $int_int bandwidth $down cbq queue { normal_in baixa_in } >queue normal_in bandwidth 256Kb priority 0 cbq(default borrow red) >queue baixa_in bandwidth 128Kb priority 1 cbq(borrow red) > > >altq on $int_ext bandwidth $uplo cbq queue { normal_on baixa_on } >queue normal_on bandwidth 256Kb priority 0 cbq(default) >queue baixa_on bandwidth 128Kb priority 1 > ># Fazendo o NAT >nat on $int_ext inet from $int_int:network to any ->($int_ext) > > ># Redicrecionamento ># >rdr on $int_int inet proto tcp from any to $int_ext port 80 -> 127.0.0.1 >port 3128 > ># bloqueando spoof >antispoof for { $int_ext } inet > ># bloqueando scanners >block drop in quick on { $int_int } from any os { NMAP } > >#Liberando loopback >pass quick on lo0 all > ># liberando ping/traceroute >pass out log on $int_ext inet proto icmp all icmp-type 8 code 0 keep state >pass in log on $int_ext inet proto icmp all icmp-type 8 code 0 keep state > ># Liberando portas >#INCOMING >#TCP >pass in quick on $int_ext inet proto tcp from any to $int_ext port $TCP_IN >flags S/SA keep state >#UDP >#pass in quick on $int_ext inet proto udp from any to $int_ext port $UDP_IN >keep state >#PING >pass in quick on $int_ext inet proto icmp from any to $int_ext icmp-type >$PING keep state > >#OUTGOING >#EXTERNAL INTERFACE > >#TCP >pass out quick on $int_ext inet proto tcp from $int_ext to any port >$TCP_OUT flags S/SA keep >state > >#UDP >pass out quick on $int_ext inet proto udp from $int_ext to any port >$UDP_OUT keep state > >#ICMP >pass out quick on $int_ext inet proto icmp from $int_ext to any icmp-type >$PING keep state > ># Liberando acesso >pass in log on $int_int from to any keep state queue normal_in >pass in log on $int_int from to any keep state queue baixa_in > >pass out log on $int_ext from to any keep state queue normal_on >pass out log on $int_ext from to any keep state queue baixa_on > > >Porem acho que nao estou conseguindo fazer este controle, quando faço >medição utilizando um >velocimetro tipo esse http://www.gratis.com.br/velo/medidor.mv esta >acusando 335.76 kbps apensar >que do ip esta na table de baixa (172.16.0.5) e esta designado para >256kpbs. ( Alguem tem algum >programa em freeBSD ou Windows para medir a velocidade ? ) > >Vcs podem dar uma olhada este scripts e ver o que esta errado ou então >fornecer um exemplo que eu >possa usar para controlar a banda usando o PF, caso nao seja possivel me >mandar com IPFW. > >Obrigada > >Cristina > > >__ >Fale com seus amigos de graça com o novo Yahoo! Messenger >http://br.messenger.yahoo.com/ >- >Histórico: http://www.fug.com.br/historico/html/freebsd/ >Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd _ MSN Messenger: converse com os seus amigos online. http://messenger.msn.com.br - Histórico: http://www.fug.com.br/hi
Re: [FUG-BR] Erro ao controlar banda usando PF
Para provedor de internet, o ideal seria utilizar dummynet. Em 28/1/2007, "Cristina Fernandes Silva" <[EMAIL PROTECTED]> escreveu: >Pessoal, > >Sei que ja foi muito discutido aqui na lista, mas estou a maior duvida,vou >implementar um servidor >voltado para um pequeno provedor de internet e estou precisando de um controle >de banda eficaz, >estou tentando fazer em PF, eis o pf.conf > >#- >int_int="rl0" >int_ext="vr0" >rede="172.168.0.0" > >PING = "echoreq" >TCP_IN = "{ ssh, ftp, 20, 21, 443 }" >UDP_IN = "{ }" > > >TCP_OUT = "{ ssh, 20, 21, ftp, http, 443, ntp, 8080, 5999 }" >UDP_OUT = "{ domain, ntp }" > ># Link >down="512Kb" >uplo="512Kb" > >server1="127.0.0.1" ># ># tabela de Ips internos > >table { 172.168.0.2, 172.168.0.3, 172.168.0.5, 172.168.0.9, >172.168.0.10, 172.168.0.13, >172.168.0.15, 172.168.0.16, 172.168.0.17, 172. >168.0.18 } > ># normalizando os pacotes ># >set timeout { tcp.first 60 tcp.opening 15 tcp.established 86400 \ >tcp.closing 300 tcp.finwait 15 tcp.closed 15 } >set timeout { udp.first 30 udp.single 15 udp.multiple 30 } >set timeout { icmp.first 10 icmp.error 5 } >set limit { states 5 frags 25000 } >set optimization aggressive >set loginterface $int_ext >set loginterface $int_int >set block-policy return >set require-order yes >scrub all fragment reassemble random-id no-df > ># Habilita enfileiramento ># > >altq on $int_int bandwidth $down cbq queue { normal_in baixa_in } > queue normal_in bandwidth 256Kb priority 0 cbq(default borrow red) > queue baixa_in bandwidth 128Kb priority 1 cbq(borrow red) > > >altq on $int_ext bandwidth $uplo cbq queue { normal_on baixa_on } > queue normal_on bandwidth 256Kb priority 0 cbq(default) > queue baixa_on bandwidth 128Kb priority 1 > ># Fazendo o NAT >nat on $int_ext inet from $int_int:network to any ->($int_ext) > > ># Redicrecionamento ># >rdr on $int_int inet proto tcp from any to $int_ext port 80 -> 127.0.0.1 port >3128 > ># bloqueando spoof >antispoof for { $int_ext } inet > ># bloqueando scanners >block drop in quick on { $int_int } from any os { NMAP } > >#Liberando loopback >pass quick on lo0 all > ># liberando ping/traceroute >pass out log on $int_ext inet proto icmp all icmp-type 8 code 0 keep state >pass in log on $int_ext inet proto icmp all icmp-type 8 code 0 keep state > ># Liberando portas >#INCOMING >#TCP >pass in quick on $int_ext inet proto tcp from any to $int_ext port $TCP_IN >flags S/SA keep state >#UDP >#pass in quick on $int_ext inet proto udp from any to $int_ext port $UDP_IN >keep state >#PING >pass in quick on $int_ext inet proto icmp from any to $int_ext icmp-type $PING >keep state > >#OUTGOING >#EXTERNAL INTERFACE > >#TCP >pass out quick on $int_ext inet proto tcp from $int_ext to any port $TCP_OUT >flags S/SA keep >state > >#UDP >pass out quick on $int_ext inet proto udp from $int_ext to any port $UDP_OUT >keep state > >#ICMP >pass out quick on $int_ext inet proto icmp from $int_ext to any icmp-type >$PING keep state > ># Liberando acesso >pass in log on $int_int from to any keep state queue normal_in >pass in log on $int_int from to any keep state queue baixa_in > >pass out log on $int_ext from to any keep state queue normal_on >pass out log on $int_ext from to any keep state queue baixa_on > > >Porem acho que nao estou conseguindo fazer este controle, quando faço medição >utilizando um >velocimetro tipo esse http://www.gratis.com.br/velo/medidor.mv esta acusando >335.76 kbps apensar >que do ip esta na table de baixa (172.16.0.5) e esta designado para 256kpbs. >( Alguem tem algum >programa em freeBSD ou Windows para medir a velocidade ? ) > >Vcs podem dar uma olhada este scripts e ver o que esta errado ou então >fornecer um exemplo que eu >possa usar para controlar a banda usando o PF, caso nao seja possivel me >mandar com IPFW. > >Obrigada > >Cristina > > >__ >Fale com seus amigos de graça com o novo Yahoo! Messenger >http://br.messenger.yahoo.com/ >- >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
[FUG-BR] Erro ao controlar banda usando PF
Pessoal, Sei que ja foi muito discutido aqui na lista, mas estou a maior duvida,vou implementar um servidor voltado para um pequeno provedor de internet e estou precisando de um controle de banda eficaz, estou tentando fazer em PF, eis o pf.conf #- int_int="rl0" int_ext="vr0" rede="172.168.0.0" PING = "echoreq" TCP_IN = "{ ssh, ftp, 20, 21, 443 }" UDP_IN = "{ }" TCP_OUT = "{ ssh, 20, 21, ftp, http, 443, ntp, 8080, 5999 }" UDP_OUT = "{ domain, ntp }" # Link down="512Kb" uplo="512Kb" server1="127.0.0.1" # # tabela de Ips internos table { 172.168.0.2, 172.168.0.3, 172.168.0.5, 172.168.0.9, 172.168.0.10, 172.168.0.13, 172.168.0.15, 172.168.0.16, 172.168.0.17, 172. 168.0.18 } # normalizando os pacotes # set timeout { tcp.first 60 tcp.opening 15 tcp.established 86400 \ tcp.closing 300 tcp.finwait 15 tcp.closed 15 } set timeout { udp.first 30 udp.single 15 udp.multiple 30 } set timeout { icmp.first 10 icmp.error 5 } set limit { states 5 frags 25000 } set optimization aggressive set loginterface $int_ext set loginterface $int_int set block-policy return set require-order yes scrub all fragment reassemble random-id no-df # Habilita enfileiramento # altq on $int_int bandwidth $down cbq queue { normal_in baixa_in } queue normal_in bandwidth 256Kb priority 0 cbq(default borrow red) queue baixa_in bandwidth 128Kb priority 1 cbq(borrow red) altq on $int_ext bandwidth $uplo cbq queue { normal_on baixa_on } queue normal_on bandwidth 256Kb priority 0 cbq(default) queue baixa_on bandwidth 128Kb priority 1 # Fazendo o NAT nat on $int_ext inet from $int_int:network to any ->($int_ext) # Redicrecionamento # rdr on $int_int inet proto tcp from any to $int_ext port 80 -> 127.0.0.1 port 3128 # bloqueando spoof antispoof for { $int_ext } inet # bloqueando scanners block drop in quick on { $int_int } from any os { NMAP } #Liberando loopback pass quick on lo0 all # liberando ping/traceroute pass out log on $int_ext inet proto icmp all icmp-type 8 code 0 keep state pass in log on $int_ext inet proto icmp all icmp-type 8 code 0 keep state # Liberando portas #INCOMING #TCP pass in quick on $int_ext inet proto tcp from any to $int_ext port $TCP_IN flags S/SA keep state #UDP #pass in quick on $int_ext inet proto udp from any to $int_ext port $UDP_IN keep state #PING pass in quick on $int_ext inet proto icmp from any to $int_ext icmp-type $PING keep state #OUTGOING #EXTERNAL INTERFACE #TCP pass out quick on $int_ext inet proto tcp from $int_ext to any port $TCP_OUT flags S/SA keep state #UDP pass out quick on $int_ext inet proto udp from $int_ext to any port $UDP_OUT keep state #ICMP pass out quick on $int_ext inet proto icmp from $int_ext to any icmp-type $PING keep state # Liberando acesso pass in log on $int_int from to any keep state queue normal_in pass in log on $int_int from to any keep state queue baixa_in pass out log on $int_ext from to any keep state queue normal_on pass out log on $int_ext from to any keep state queue baixa_on Porem acho que nao estou conseguindo fazer este controle, quando faço medição utilizando um velocimetro tipo esse http://www.gratis.com.br/velo/medidor.mv esta acusando 335.76 kbps apensar que do ip esta na table de baixa (172.16.0.5) e esta designado para 256kpbs. ( Alguem tem algum programa em freeBSD ou Windows para medir a velocidade ? ) Vcs podem dar uma olhada este scripts e ver o que esta errado ou então fornecer um exemplo que eu possa usar para controlar a banda usando o PF, caso nao seja possivel me mandar com IPFW. Obrigada Cristina __ Fale com seus amigos de graça com o novo Yahoo! Messenger http://br.messenger.yahoo.com/ - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd