![Marcin Paterka](https://static.goldenline.pl/user_photo_basic.jpg)
Marcin Paterka Bez opisu
Temat: Ubuntu +most+squid - bardzo muli
Witam serdeczniePostanowiłem postawić w sieci serwer proxy - taki transparentny, na samodzielnej maszynie między switchem a ruterem.
Niby wszystko okej - po pierwszej konfiguracji squid dział dość szybko - więc wyłączyłem komputer i poszedłem do domu. Następnego dnia masakra - strony wczytują się po około minucie. Wyczyściłem i przebudowałem cache ale bez skutku. Podejrzewam, że coś namieszałem w iptables - jeżeli ktoś mógłby mi coś podpowiedzieć - poniżej to co zrobiłem:
Po pierwsze konfiguracja mostu w network/interfaces:
auto lo
iface lo inet loopback
auto eth1
iface eth1 inet static
address 192.168.10.164
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255
auto br0
iface br0 inet static
address 192.168.10.163
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255
gateway 192.168.10.1
bridge-ports eth0 eth1
Później do rc.local dodałem reguły:
route add default gw 192.168.10.1 dev br0
ebtables -t broute -A BROUTING -p IPv4 --ip-protocol 6 --ip-destination-port 80 -j redirect --redirect-target ACCEPT
iptables -t nat -A PREROUTING -i br0 -p tcp --dport 80 -j REDIRECT --to-port 3128
Następnie odchaszowałem dwie linie w sysctl.conf:
net.ipv4.ip_forward=1
net.ipv6.conf.all.forwarding=1
Następnie podstawowy konfig squida:
acl localnet src 192.168.10.0/24 # Your network here
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 block_www url_regex "/etc/squid3/block_http://acl"
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny block_www
http_access allow localnet
http_access deny to_localhost
icp_access deny all
htcp_access deny all
http_port 3129
http_port 3128 intercept
hierarchy_stoplist cgi-bin ?
access_log /var/log/squid3/access.log squid
#Suggested default:
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid3
#acl whitelist dstdomain "/etc/squid3/whitelist.txt"
# Allow localnet machines to whitelisted sites
#http_access allow localnet whitelist
# block all other access
http_access deny all
cache_dir ufs /mnt/proxy_cache 100000 16 256
store_avg_object_size 10 MB
cache_mem 1 GB
maximum_object_size 10 MB
No i restart serwera:
W obecnej chwili serwer się uruchamia, squid nic nie loguje - dopiero jak z palca dodam regułe iptables któa przekierowuje ruch na port 3128 to zaczyna działać, ale cholernie muli....
Dodam jeszcze, że zaczęło się to dziać po próbie skonfigurowania dansguardiana - jednak teraz DansGuardian jest zatrzymany i kurcze nawet czyściłem iptables... bez skutku.
Proszę o pomoc :-)
Pozdrawiam serdecznie