Enviado em 15/10/2012 - 11:09h
Bom dia,
Já li diversos posts do grupo e não consegui resolver meu problema. Estou rodando um ubuntu 12.04 server, e meu squid não está barrando nenhum site.
Meu setup:
Eth0 => placa de rede interna
Eth1 => placa de rede ligada ao router da GVT
eth0 Link encap:Ethernet Endereço de HW 00:e0:4c:53:44:58
inet end.: 192.168.1.1 Bcast:192.168.1.255 Masc:255.255.255.0
endereço inet6: fe80::2e0:4cff:fe53:4458/64 Escopo:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Métrica:1
pacotes RX:16987 erros:88 descartados:21 excesso:16 quadro:108
Pacotes TX:15371 erros:0 descartados:0 excesso:0 portadora:0
colisões:0 txqueuelen:1000
RX bytes:7840355 (7.8 MB) TX bytes:11039174 (11.0 MB)
eth1 Link encap:Ethernet Endereço de HW 6c:62:6d:fc:bc:e1
inet end.: 192.168.0.2 Bcast:192.168.0.255 Masc:255.255.255.0
endereço inet6: fe80::6e62:6dff:fefc:bce1/64 Escopo:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Métrica:1
pacotes RX:14762 erros:0 descartados:0 excesso:0 quadro:0
Pacotes TX:15906 erros:0 descartados:0 excesso:0 portadora:1
colisões:0 txqueuelen:1000
RX bytes:10970700 (10.9 MB) TX bytes:7992623 (7.9 MB)
IRQ:42
==========================================================
Arquivo que faz o gateway
#!/bin/bash
iniciar(){
modprobe iptable_nat
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
}
parar(){
iptables -F -t nat
}
case "$1" in
"start") iniciar ;;
"stop") parar ;;
"restart") parar; iniciar ;;
*) echo "Use os pametros start ou stop"
esac
===========================================================
Arquivo /etc/squid3/squid.conf
http_port 3128 transparent
visible_hostname ProxyServer
error_directory /usr/share/squid3/errors/Portuguese/
cache_mem 64 MB
maximum_object_size_in_memory 64 KB
maximum_object_size 512 MB
minimum_object_size 0 KB
cache_swap_low 90
cache_swap_high 95
cache_dir_ufs /var/spool/squid3 2048 16 256
cache_access_log /var/log/squid3/access.log
refresh_pattern ^ftp: 15 20% 2280
refresh_pattern ^gopher: 15 0% 2280
refresh_pattern . 15 20% 2280
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl SSL_ports port 443 563
acl Safe_ports port 21 80 443 563 70 210 280 488 59 777 901 1025-65535
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
########
acl liburls dstdomain www.uai.com.br
http_access allow liburls
acl denyurls dstdomain playboy.abril.com.br playboy.com.br
http_access deny denyurls
acl denywords dstdom orkut sexo xxx warez playboy [*****]
http_access deny denywords
########
acl redelocal src 192.168.1.0/24
http_access allow localhost
http_access allow redelocal
http_access deny all
==================================================================
Quando reinicio o squid aparece a seguinte mensagem:
sudo /etc/init.d/squid3 start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service squid3 start
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start squid3
squid3 start/running, process 2336
==================================================================
O meu arquivo de log está vazio
O que mais preciso fazer?
Obrigado.
Já li diversos posts do grupo e não consegui resolver meu problema. Estou rodando um ubuntu 12.04 server, e meu squid não está barrando nenhum site.
Meu setup:
Eth0 => placa de rede interna
Eth1 => placa de rede ligada ao router da GVT
eth0 Link encap:Ethernet Endereço de HW 00:e0:4c:53:44:58
inet end.: 192.168.1.1 Bcast:192.168.1.255 Masc:255.255.255.0
endereço inet6: fe80::2e0:4cff:fe53:4458/64 Escopo:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Métrica:1
pacotes RX:16987 erros:88 descartados:21 excesso:16 quadro:108
Pacotes TX:15371 erros:0 descartados:0 excesso:0 portadora:0
colisões:0 txqueuelen:1000
RX bytes:7840355 (7.8 MB) TX bytes:11039174 (11.0 MB)
eth1 Link encap:Ethernet Endereço de HW 6c:62:6d:fc:bc:e1
inet end.: 192.168.0.2 Bcast:192.168.0.255 Masc:255.255.255.0
endereço inet6: fe80::6e62:6dff:fefc:bce1/64 Escopo:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Métrica:1
pacotes RX:14762 erros:0 descartados:0 excesso:0 quadro:0
Pacotes TX:15906 erros:0 descartados:0 excesso:0 portadora:1
colisões:0 txqueuelen:1000
RX bytes:10970700 (10.9 MB) TX bytes:7992623 (7.9 MB)
IRQ:42
==========================================================
Arquivo que faz o gateway
#!/bin/bash
iniciar(){
modprobe iptable_nat
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
}
parar(){
iptables -F -t nat
}
case "$1" in
"start") iniciar ;;
"stop") parar ;;
"restart") parar; iniciar ;;
*) echo "Use os pametros start ou stop"
esac
===========================================================
Arquivo /etc/squid3/squid.conf
http_port 3128 transparent
visible_hostname ProxyServer
error_directory /usr/share/squid3/errors/Portuguese/
cache_mem 64 MB
maximum_object_size_in_memory 64 KB
maximum_object_size 512 MB
minimum_object_size 0 KB
cache_swap_low 90
cache_swap_high 95
cache_dir_ufs /var/spool/squid3 2048 16 256
cache_access_log /var/log/squid3/access.log
refresh_pattern ^ftp: 15 20% 2280
refresh_pattern ^gopher: 15 0% 2280
refresh_pattern . 15 20% 2280
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl SSL_ports port 443 563
acl Safe_ports port 21 80 443 563 70 210 280 488 59 777 901 1025-65535
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
########
acl liburls dstdomain www.uai.com.br
http_access allow liburls
acl denyurls dstdomain playboy.abril.com.br playboy.com.br
http_access deny denyurls
acl denywords dstdom orkut sexo xxx warez playboy [*****]
http_access deny denywords
########
acl redelocal src 192.168.1.0/24
http_access allow localhost
http_access allow redelocal
http_access deny all
==================================================================
Quando reinicio o squid aparece a seguinte mensagem:
sudo /etc/init.d/squid3 start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service squid3 start
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start squid3
squid3 start/running, process 2336
==================================================================
O meu arquivo de log está vazio
O que mais preciso fazer?
Obrigado.