[Inclusão Digital]Squid + Marcação de Pacotes
Rôney Eduardo Oliveira Santos
roneyeduardosantos em gmail.com
Terça Julho 13 19:21:39 BRT 2010
Exporta um ifconfig ai pra gente...
[]'s
Rôney Eduardo
2010/7/13 JairJunior.net <jair em jairjunior.net>
> Coloquei 2 vezes:
> acl youtube dstdomain youtube.com
> tcp_outgoing_address 10.0.1.2 youtube
>
> mas foi só na hora de copiar do putty, o correto é o primeiro.
>
> Jair Júnior
> Power Soft Informática e Tecnologia
> jair em pstecnologia.com.br
> www.pstecnologia.com.br
>
>
> Em 13 de julho de 2010 18:30, JairJunior.net <jair em jairjunior.net>
> escreveu:
>
> > Aqui ta saindo sempre pelo mesmo IP:
> >
> > A eth1 tá com os ips 10.0.0.2 e 10.0.1.2 o default é 10.0.0.2 e ta saindo
> > tudo por ele.
> > Pelo menos é o que vejo através do TORCH na interface do MK!
> >
> > segue squid.conf:
> >
> >
> >
> ---------------------------------------------------------------------------------------------------------
> >
> > http_port 8080 transparent
> > icp_port 0
> > hierarchy_stoplist cgi-bin ?
> > acl QUERY urlpath_regex cgi-bin \?
> > cache deny QUERY
> > cache_replacement_policy heap LFUDA
> > memory_replacement_policy heap GDSF
> > cache_mem 200 MB
> > maximum_object_size 40000 KB
> > minimum_object_size 4 KB
> > maximum_object_size_in_memory 64 KB
> > cache_dir diskd /partition/squid/cache 10000 16 256 Q1=72 Q2=64
> > access_log /partition/squid/logs/access.log
> > cache_log /partition/squid/logs/cache.log
> > cache_store_log none
> >
> > cache_effective_user nobody
> > cache_effective_group nogroup
> > pid_filename /var/run/squid.pid
> > half_closed_clients off
> > server_persistent_connections off
> > client_persistent_connections off
> > memory_pools on
> > buffered_logs on
> > pipeline_prefetch on
> >
> > dns_retransmit_interval 15 seconds
> >
> > #cache_swap_low 70
> > #cache_swap_high 90
> >
> > refresh_pattern -i ^http://.*\.(css|htm|html|ico|js|jsp|xml)$ 1440 80%
> > 999999
> > refresh_pattern -i ^http://.*\.(bmp|gif|jpeg|jpg|png)$ 1440 80% 999999
> > ignore-re
> > refresh_pattern -i ^http://
> > .*\.(ace|adt|arj|asf|avi|bin|bz2|bzip|cab|dat|dll|doc
> >
> > refresh_pattern ^ftp: 1440 20% 10080
> > refresh_pattern ^gopher: 1440 0% 1440
> > refresh_pattern . 0 20% 4320
> >
> >
> > acl youtube dstdomain youtube.com
> > tcp_outgoing_address 10.0.1.2 youtube
> >
> >
> > acl all src 0.0.0.0/0.0.0.0
> > acl localhost src 127.0.0.1/255.255.255.255
> > buffered_logs on
> > pipeline_prefetch on
> >
> > dns_retransmit_interval 15 seconds
> >
> > #cache_swap_low 70
> > #cache_swap_high 90
> >
> > refresh_pattern -i ^http://.*\.(css|htm|html|ico|js|jsp|xml)$ 1440 80%
> > 999999
> > refresh_pattern -i ^http://.*\.(bmp|gif|jpeg|jpg|png)$ 1440 80% 999999
> > ignore-reload
> > refresh_pattern -i ^http://
> >
> .*\.(ace|adt|arj|asf|avi|bin|bz2|bzip|cab|dat|dll|doc|dot|exe|fla|flv|gz|iso|lha|log|lzh|mdb|mid|m
> >
> > refresh_pattern ^ftp: 1440 20% 10080
> > refresh_pattern ^gopher: 1440 0% 1440
> > refresh_pattern . 0 20% 4320
> >
> >
> > acl youtube dstdomain youtube.com
> > tcp_outgoing_address 10.0.1.1 youtube
> >
> >
> > acl all src 0.0.0.0/0.0.0.0
> > acl localhost src 127.0.0.1/255.255.255.255
> > #acl to_localhost dst 127.0.0.1/32
> >
> >
> >
> > acl SSL_ports port 443 563
> > acl Safe_ports port 80
> > acl Safe_ports port 21
> > acl Safe_ports port 443 563
> > acl Safe_ports port 70
> > acl Safe_ports port 210
> > acl Safe_ports port 8180
> > acl Safe_ports port 1025-65535
> > acl Safe_ports port 280
> > acl Safe_ports port 488
> > acl Safe_ports port 591
> > acl Safe_ports port 777
> > acl Safe_ports port 901
> >
> > acl manager proto cache_object
> > acl PURGE method PURGE
> > acl CONNECT method CONNECT
> >
> > http_access allow PURGE localhost
> > http_access allow manager localhost
> > http_access deny PURGE
> > http_access deny manager
> > http_access deny !Safe_ports
> > http_access deny CONNECT !SSL_ports
> > acl filterneg dstdom_regex "/usr/local/squid/etc/filter.flt"
> > acl block url_regex -i "/usr/local/squid/etc/block.flt"
> > acl internal_net src "/usr/local/squid/etc/ipaccess.yes"
> >
> > #Access deny to Squid ident. header
> > header_access Via deny all
> > header_access X-Forwarded-For deny all
> > header_access Proxy-Connection deny all
> > header_access Accept-Encoding deny all
> > http_access deny filterneg
> > http_access deny block
> > http_access allow internal_net
> > http_access deny all
> > #http_reply_access allow all
> > #icp_access allow all
> > acl apache rep_header Server ^Apache
> > broken_vary_encoding allow apache
> > visible_hostname brazilfw
> > coredump_dir /partition/squid/cache
> > error_directory /usr/local/squid/share/errors/English
> >
> >
> > -----------------------------------------
> >
> >
> > Jair Júnior
> > Power Soft Informática e Tecnologia
> > jair em pstecnologia.com.br
> > www.pstecnologia.com.br
> >
> >
> > Em 13 de julho de 2010 18:16, Rôney Eduardo Oliveira Santos <
> > roneyeduardosantos em gmail.com> escreveu:
> >
> > Só uma correção, o parâmetro correto é tcp_outgoing_address.
> >>
> >> []'s
> >>
> >> Rôney Eduardo
> >>
> >>
> >>
> >> 2010/7/13 Rôney Eduardo Oliveira Santos <roneyeduardosantos em gmail.com>
> >>
> >> > Do PC que tá o squid. Ai no seu gateway MikroTik você faz NAT nesse IP
> >> pra
> >> > sair pelo link que você quer.
> >> >
> >> >
> >> > []'s
> >> >
> >> > Rôney Eduardo
> >> >
> >> >
> >> > 2010/7/13 JairJunior.net <jair em jairjunior.net>
> >> >
> >> >> Onde vc fala: tcp_ougoing_address 192.168.Y.X youtube esse ip seria
> do
> >> MK
> >> >> ou
> >> >> do pc que está o squid??
> >> >>
> >> >> Jair Júnior
> >> >> Power Soft Informática e Tecnologia
> >> >> jair em pstecnologia.com.br
> >> >> www.pstecnologia.com.br
> >> >>
> >> >>
> >> >> Em 13 de julho de 2010 16:56, Rôney Eduardo Oliveira Santos <
> >> >> roneyeduardosantos em gmail.com> escreveu:
> >> >>
> >> >> > Olá,
> >> >> >
> >> >> > Você não precisa marcar os pacotes, basta você fazer o squid sair
> por
> >> um
> >> >> > determinado IP quando o destino for youtube.com, com as seguintes
> >> >> linhas:
> >> >> >
> >> >> > --
> >> >> > acl youtube dstdomain youtube.com
> >> >> > acl youtube dstdomain googlevideos.com
> >> >> >
> >> >> > tcp_ougoing_address 192.168.Y.X youtube
> >> >> > --
> >> >> >
> >> >> > Você só precisa se certificar de duas coisas:
> >> >> >
> >> >> > 1) que o servidor tenha esse IP configurado (um alias);
> >> >> > 2) que você também tenha no seu squid.conf a diretiva
> >> >> > "server_persistent_connections off"
> >> >> >
> >> >> > Com isso, no seu gateway mikrotik você faz NAT desse IP para o link
> >> >> > desejado.
> >> >> >
> >> >> > Você pode extender isso também para outros tipos de acl suportadas
> >> pelo
> >> >> > squid, como "url_regex", "src", "dst", etc...
> >> >> >
> >> >> > []'s
> >> >> >
> >> >> > Rôney Eduardo
> >> >> >
> >> >> >
> >> >> >
> >> >> > 2010/7/13 JairJunior.net <jair em jairjunior.net>
> >> >> >
> >> >> > > Olá pessoal, alguem sabe se tem como marcar pacotes pelo squid
> para
> >> >> por
> >> >> > > exemplo marcar todos os pacotes para *.youtube.com para depois
> >> >> > direcionar
> >> >> > > pelo MK pra um segundo link????
> >> >> > >
> >> >> > > Jair Júnior
> >> >> > > Power Soft Informática e Tecnologia
> >> >> > > jair em pstecnologia.com.br
> >> >> > > www.pstecnologia.com.br
> >> >> > > _______________________________________________
> >> >> > > Inclusaodigital mailing list
> >> >> > > Inclusaodigital em anid.com.br
> >> >> > > http://anid.com.br/mailman/listinfo/inclusaodigital
> >> >> > >
> >> >> > _______________________________________________
> >> >> > Inclusaodigital mailing list
> >> >> > Inclusaodigital em anid.com.br
> >> >> > http://anid.com.br/mailman/listinfo/inclusaodigital
> >> >> >
> >> >> _______________________________________________
> >> >> Inclusaodigital mailing list
> >> >> Inclusaodigital em anid.com.br
> >> >> http://anid.com.br/mailman/listinfo/inclusaodigital
> >> >>
> >> >
> >> >
> >> _______________________________________________
> >> Inclusaodigital mailing list
> >> Inclusaodigital em anid.com.br
> >> http://anid.com.br/mailman/listinfo/inclusaodigital
> >>
> >
> >
> _______________________________________________
> Inclusaodigital mailing list
> Inclusaodigital em anid.com.br
> http://anid.com.br/mailman/listinfo/inclusaodigital
>
Mais detalhes sobre a lista de discussão Inclusaodigital