serviço squid esta ativo mas não pega regras

1. serviço squid esta ativo mas não pega regras

Thiago
thi

(usa Ubuntu)

Enviado em 06/06/2013 - 08:48h

Bom dia,

Montei um servidor UbuntuServer 12.4. Instalei os serviços e pacotes necessários. Instalei um Gateway e DNS server no ubuntu. Com isso a estação que passa pelo ubuntu já esta navegando através do proxy, porém não esta pegando as regras do squid.

O serviço do squid esta sem erros e ativo.

Dei um ps aux | grep squid e mostra os serviços ativos

Dei um os aux | grep squid | wc -l e mostra o serviço iniciado como 4

Quando dou o squid -k reconfigure não apresenta nenhum erro!

Como eu montei o ubuntuserver e instalei o squid 2.7 baseado no tutorial que peguei, obviamente o squid.conf veio do tutorial. Segue o conf:


acl QUERY urlpath_regex -i cgi-bin ? localhost
acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl mikrotik src 192.168.2.0/24 #change this IP/Netmask if not same on your network
acl to_localhost dst 127.0.0.0/8
acl OLCNETWORK src 192.168.1.0/24 #change this IP/Netmask if not same on your network
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl snmppublic snmp_community public
acl CONNECT method CONNECT
acl PURGE method PURGE
snmp_access allow snmppublic localhost
http_access allow PURGE localhost
http_access deny PURGE
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow OLCNETWORK
http_access allow mikrotik
snmp_access deny all
http_access deny all

# NETWORK OPTIONS
# -----------------------------------------------------------------------------

http_port 3128 transparent
zph_mode tos
zph_local 0x30
zph_parent 0
zph_option 136

# PARENT/SIBLING CACHE OPTIONS
# -----------------------------------------------------------------------------

hierarchy_stoplist cgi-bin localhost

# OPTIONS WHICH AFFECT THE CACHE SIZE
# -----------------------------------------------------------------------------

cache_mem 8 MB
maximum_object_size_in_memory 64 KB
memory_replacement_policy heap GDSF
cache_replacement_policy heap LFUDA
cache_dir aufs /cache1 7500 16 256
cache_dir aufs /cache2 7500 16 256
cache_dir aufs /cache3 7500 16 256
store_dir_select_algorithm least-load
maximum_object_size 20480 KB
cache_swap_low 90
cache_swap_high 95
update_headers off

# LOGFILE PATHNAMES AND CACHE DIRECTORIES
# -----------------------------------------------------------------------------

access_log none
cache_log /dev/null
cache_store_log none
logfile_rotate 5
log_ip_on_direct off
log_icp_queries off
buffered_logs off
netdb_filename none
pid_filename /var/run/squid.pid

# OPTIONS FOR TUNING THE CACHE
# -----------------------------------------------------------------------------

cache deny QUERY
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i .(gif|png|jp?g|ico|bmp|tiff?)$ 10080 95% 43200 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private
refresh_pattern -i .(rpm|cab|deb|exe|msi|psd|msu|zip|tar|gz|tgz|rar|bin|7z|doc?|xls?|ppt?|pdf)$ 10080 90% 43200 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private
refresh_pattern -i .(avi|iso|wav|mid|mp?|mpeg|mov|3gp|wm?|swf|flv|x-flv|axd)$ 43200 95% 432000 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private
refresh_pattern -i (/cgi-bin/|?) 0 0% 0
refresh_pattern . 1440 90% 10080

quick_abort_min 0 KB
quick_abort_max 0 KB
quick_abort_pct 98
store_avg_object_size 32 KB

# HTTP OPTIONS
# -----------------------------------------------------------------------------

server_http11 on
collapsed_forwarding on
vary_ignore_expire on
header_access From deny all
header_access Server deny all
header_access Link deny all
header_access Via deny all
header_access X-Forwarded-For deny all

# TIMEOUTS
# -----------------------------------------------------------------------------

forward_timeout 240 seconds
connect_timeout 60 seconds
peer_connect_timeout 5 seconds
read_timeout 600 seconds
request_timeout 60 seconds
persistent_request_timeout 60 seconds
client_lifetime 86400 seconds
half_closed_clients off
pconn_timeout 60 seconds
shutdown_lifetime 15 seconds

# ADMINISTRATIVE PARAMETERS
# -----------------------------------------------------------------------------

cache_mgr OLCNETWORK
cache_effective_user squid
cache_effective_group squid
httpd_suppress_version_string on
visible_hostname OLCNETWORK

# ADVANCED NETWORKING OPTIONS
# -----------------------------------------------------------------------------

max_filedescriptors 65535

# DNS OPTIONS
# -----------------------------------------------------------------------------

check_hostnames off
dns_timeout 30 seconds
dns_nameservers 192.168.2.1
hosts_file /etc/hosts
ipcache_size 8192
ipcache_low 95
ipcache_high 98
fqdncache_size 4096

# MISCELLANEOUS
# -----------------------------------------------------------------------------

memory_pools off
forwarded_for off
reload_into_ims on
coredump_dir /home/squid
pipeline_prefetch on


Obs: não me aprofundei no squid.conf. Só fiz para levantar o ubuntuserver e instalar o squid. A princípio o serviço esta ativo, estou navegando através do proxy, mas ele não ta puxando as regras do squid. Se alguém puder dar uma luz, agradeço.

Grato.


  


2. Re: serviço squid esta ativo mas não pega regras

Daniel Lara Souza
danniel-lara

(usa Fedora)

Enviado em 06/06/2013 - 08:50h

fez o redirecionamento da porta 80 para 3128 do squid ?


3. Re: serviço squid esta ativo mas não pega regras

Thiago
thi

(usa Ubuntu)

Enviado em 06/06/2013 - 09:06h

http_port 3128 transparente tá assim no squid.conf

Vc diz o redirecionamento pelo iptables??? se sim, eu n fiz... como seria?




4. Re: serviço squid esta ativo mas não pega regras

Daniel Lara Souza
danniel-lara

(usa Fedora)

Enviado em 06/06/2013 - 09:08h

thi escreveu:

http_port 3128 transparente tá assim no squid.conf

Vc diz o redirecionamento pelo iptables??? se sim, eu n fiz... como seria?



posta ai a regras do iptables também


5. Re: serviço squid esta ativo mas não pega regras

Thiago
thi

(usa Ubuntu)

Enviado em 06/06/2013 - 09:22h

Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT udp -- anywhere udp dpt: domain
ACCEPT tcp -- anywhere tcp dpt: domain
ACCEPT udp -- anywhere udp dpt: bootps
ACCEPT tcp -- anywhere tcp dpt: bootps

Chain FORWARD (policy ACCEPT)

target prot opt source destination
ACCEPT all -- anywhere 192.168.122.0/24 state RELATED.ESTABILISHED
ACCEPT all -- 192.168.122.0/24
ACCEPT all -- anywhere
ACCEPT all -- anywhere
REJECT all -- anywhere
REJECT all -- anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source



Basicamente é isso. Desculpe essa parte eu digitei. Obrigado pela ajuda.

Abs


6. Re: serviço squid esta ativo mas não pega regras

Thiago
thi

(usa Ubuntu)

Enviado em 06/06/2013 - 10:41h

O proxy no squid.conf ta como transparente.. mas como não estava pegando, fui no navegador e defini em conexões

Endereço: 10.1.100.1 Porta: 3128

Agora passa pelo squid, só que bloqueia tudo rsrs

como faço só para testar liberar alguns sites? estou olhando na squid.conf la tentei definir algumas acls mas ele ta bloqueando tudo.

Abs,


7. Re: serviço squid esta ativo mas não pega regras

Buckminster
Buckminster

(usa Debian)

Enviado em 06/06/2013 - 13:17h

thi escreveu:

O proxy no squid.conf ta como transparente.. mas como não estava pegando, fui no navegador e defini em conexões

Endereço: 10.1.100.1 Porta: 3128

Agora passa pelo squid, só que bloqueia tudo rsrs

como faço só para testar liberar alguns sites? estou olhando na squid.conf la tentei definir algumas acls mas ele ta bloqueando tudo.

Abs,


Com o Squid transparente não precisa setar o proxy no navegador.

Coloca essa regra no Iptables:

iptables -t nat -A PREROUTING -i ethx -p tcp --dport 80 -j REDIRECT --to-port 3128 << em ethx você coloca a placa de rede que responde pela tua rede interna.

E no Squid faltou liberar a tua rede interna:

acl localnet src xxx.xxx.xxx.xxx/xx << aqui você coloca o endereço da tua rede interna com a máscara.
http_access allow localnet
http_access deny all



  



Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts