Squid !!

Postate qui per tutte le discussioni legate a Linux in generale.

Moderatore: Staff

Regole del forum
1) Citare sempre la versione di Slackware usata, la versione del Kernel e magari anche la versione della libreria coinvolta. Questi dati aiutano le persone che possono rispondere.
2) Per evitare confusione prego inserire in questo forum solo topic che riguardano appunto Gnu/Linux in genere, se l'argomento è specifico alla Slackware usate uno dei forum Slackware o Slackware64.
3) Leggere attentamente le risposte ricevute
4) Scrivere i messaggi con il colore di default, evitare altri colori.
5) Scrivere in Italiano o in Inglese, se possibile grammaticalmente corretto, evitate stili di scrittura poco chiari, quindi nessuna abbreviazione tipo telegramma o scrittura stile SMS o CHAT.
6) Appena registrati è consigliato presentarsi nel forum dedicato.

La non osservanza delle regole porta a provvedimenti di vari tipo da parte dello staff, in particolare la non osservanza della regola 5 porta alla cancellazione del post e alla segnalazione dell'utente. In caso di recidività l'utente rischia il ban temporaneo.
Rispondi
jaym
Linux 0.x
Linux 0.x
Messaggi: 18
Iscritto il: lun 4 apr 2005, 0:00

Squid !!

Messaggio da jaym »

ragazzi dopo avere installato Samba come pdc sto cercando ora di far funzionare Squid sulla stessa macchina. In rc.local ho impostto alcune regole di firewalling e masquerade:
<BR>
<BR>echo 1 > /proc/sys/net/ipv4/ip_forward
<BR>iptables -F
<BR>iptables -P INPUT DROP
<BR>iptables -P OUTPUT ACCEPT
<BR>iptables -P FORWARD DROP
<BR>iptables -A INPUT -p tcp --dport 22 -j ACCEPT
<BR>iptables -A INPUT -p tcp --dport 53 -j ACCEPT
<BR>iptables -A INPUT -i eth0 -j ACCEPT
<BR>iptables -A INPUT -s 10.0.0.0/8 -i eth1 -j DROP
<BR>iptables -A FORWARD -s 10.0.0.0/8 -i eth1 -j DROP
<BR>iptables -A INPUT -s 172.16.0.0/12 -i eth1 -j DROP
<BR>iptables -A FORWARD -s 172.16.0.0/12 -i eth1 -j DROP
<BR>iptables -A INPUT -s 192.168.0.0/16 -i eth1 -j DROP
<BR>iptables -A FORWARD -s 192.168.0.0/16 -i eth1 -j DROP
<BR>iptables -A INPUT -s 224.0.0.0/3 -i eth1 -j DROP
<BR>iptables -A FORWARD -s 224.0.0.0/3 -i eth1 -j DROP
<BR>iptables -A INPUT -s 127.0.0.1 -i eth1 -j DROP
<BR>iptables -A FORWARD -s 127.0.0.1 -i eth1 -j DROP
<BR>iptables -A INPUT -i eth1 -p tcp --dport 1024:65535 -j ACCEPT
<BR>iptables -A InPUT -i eth1 -p udp --dport 1024:65535 -j ACCEPT
<BR>iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
<BR>iptables -A INPUT -p icmp --icmp-type echo-request -m limit --limit 2/s -j ACCEPT
<BR>iptables -A INPUT -p icmp --icmp-type echo-request -j DROP
<BR>iptables -A FORWARD -i eth1 -o eth0 -m state ESTABLISHED,RELATED -j ACCEPT
<BR>iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
<BR>iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
<BR>
<BR>aggiungendo poi:
<BR>iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
<BR>per redirigere il traffico http sullo squid locale.
<BR>
<BR>il file squid.conf :
<BR>http_port 3128
<BR>icp_port 3130
<BR>cache_mem 8 MB
<BR>cache_dir ufs /var/log/squid/cache 100 16 256
<BR>cache_access_log /var/log/squid/logs/access.log
<BR>cache_log /var/log/squid/logs/cache.log
<BR>cache_store_log /var/log/squid/logs/store.log
<BR>emulate_httpd_log off
<BR>mime_table /etc/squid/mime.conf
<BR>acl all src 0.0.0.0/0.0.0.0
<BR>acl manager proto cache_object
<BR>acl localhost src 127.0.0.1/255.255.255.255
<BR>acl to_localhost dst 127.0.0.0/8
<BR>acl SSL_ports port 443 563
<BR>acl Safe_ports port 80 # http
<BR>acl Safe_ports port 21 # ftp
<BR>acl Safe_ports port 443 563 # https, snews
<BR>acl Safe_ports port 70 # gopher
<BR>acl Safe_ports port 210 # wais
<BR>acl Safe_ports port 1025-65535 # unregistered ports
<BR>acl Safe_ports port 280 # http-mgmt
<BR>acl Safe_ports port 488 # gss-http
<BR>acl Safe_ports port 591 # filemaker
<BR>acl Safe_ports port 777 # multiling http
<BR>acl locallan src 192.168.0.0/255.255.255.0
<BR>acl CONNECT method CONNECT
<BR>http_access allow manager localhost
<BR>http_access deny manager
<BR>http_access deny !Safe_ports
<BR>http_access deny CONNECT !SSL_ports
<BR>http_access allow localhost
<BR>http_access allow locallan
<BR>http_access deny all
<BR>cache_effective_user nobody
<BR>cache_effective_group nobody
<BR>
<BR>
<BR>adesso non funzione più la condivisione internet. Sto approfondendo Squid ma intanto mi piacerebbe vederlo funzionare, e´ da più di un giorno ch ci smanetto senza risultati :-[ <br>

jaym
Linux 0.x
Linux 0.x
Messaggi: 18
Iscritto il: lun 4 apr 2005, 0:00

Squid !!

Messaggio da jaym »

dunque, adesso Squid funziona ma non il transparent proxy per cui sono costretto ad impostare indirizzo IP e porta 8080 sul browser. Ecco i nuovi file di conf. e rc.local che uso (lo so che è un post lungo ma vi prego leggetelo per darmi una mano a capire dove sta il problema):
<BR>
<BR>SQUID.CONF
<BR>#Seleziono Le Porte Di Ascolto Di Squid
<BR>http_port 8080
<BR>#Le Pagine CGI non verranno messe in cache
<BR>acl QUERY urlpath_regex cgi-bin \?
<BR>#Imposto La Memoria Che Utilizzerà Squid
<BR>cache_mem 32 MB
<BR>#Imposto La Quantità Di Cache che utiizzerà Squid (2550 Significa 2.5GB)
<BR>cache_dir ufs /var/log/squid/cache 2500 16 256
<BR>
<BR>#Imposto Le directory Dove Squid Scriverà i Logs
<BR>cache_log /var/log/squid/cache.log
<BR>cache_access_log /var/log/squid/access.log
<BR>cache_store_log /var/log/squid/store.log
<BR>cache_swap_log /var/log/squid/swap.log
<BR>#I Log Di Squid ruoteranno per 10 giorni e poi li cancello
<BR>logfile_rotate 10
<BR>
<BR>redirect_rewrites_host_header off
<BR>
<BR>cache_replacement_policy GDSF
<BR>#Imposto Delle regole per la sicurezza del Proxy
<BR>acl localnet src 192.168.100.0/255.255.255.0
<BR>acl localhost src 127.0.0.1/255.255.255.255
<BR>acl Safe_ports port 80 443 210 119 70 20 21 1025-65535
<BR>acl CONNECT method CONNECT
<BR>acl all src 0.0.0.0/0.0.0.0
<BR>http_access allow localnet
<BR>http_access allow localhost
<BR>http_access deny !Safe_ports
<BR>http_access deny CONNECT
<BR>http_access deny all
<BR>maximum_object_size 3000 KB
<BR>store_avg_object_size 50 KB
<BR>
<BR>#Imposto Il Proxy in Modalità Trsparente.
<BR>httpd_accel_host virtual
<BR>httpd_accel_port 80
<BR>httpd_accel_with_proxy on
<BR>httpd_accel_uses_host_header on
<BR>
<BR>cache_mgr <a href="mailto:giuseppe@localhost" target="_new">giuseppe@localhost</a>
<BR>cachemgr_passwd startac85 all
<BR>
<BR>#Imposto L´Anonimato Per i Client
<BR>forwarded_for off
<BR>client_db off
<BR>
<BR>log_icp_queries off
<BR>buffered_logs on
<BR>
<BR>#Non Imposto Il Limite Del Download Per Gli Utenti Della Mia Rete
<BR>acl magic_words1 url_regex -i 192.168
<BR>
<BR>#Imposto Il Limite Del Download Per Queste Estensioni
<BR>acl magic_words2 url_regex -i ftp .mp3 .vqf .tar.gz .gz .rpm .avi .mpeg .mpe .mpg .qt .wav .exe .zip
<BR>
<BR>#Limito La Banda Dalle 09:00 Alle 23:59 e Do Piena Banda La Notte
<BR>acl day time 09:00-23:59
<BR>no_cache deny QUERY
<BR>
<BR>e il file rc.local dove ho messo:
<BR>
<BR>RC.LOCAL
<BR>echo 1 > /proc/sys/net/ipv4/ip_forward
<BR>iptables -F
<BR>iptables -P INPUT DROP
<BR>iptables -P OUTPUT ACCEPT
<BR>iptables -P FORWARD DROP
<BR>iptables -A INPUT -p tcp --dport 22 -j ACCEPT
<BR>iptables -A INPUT -p tcp --dport 53 -j ACCEPT
<BR>iptables -A INPUT -i eth0 -j ACCEPT
<BR>iptables -A INPUT -s 10.0.0.0/8 -i eth1 -j DROP
<BR>iptables -A FORWARD -s 10.0.0.0/8 -i eth1 -j DROP
<BR>iptables -A INPUT -s 172.16.0.0/12 -i eth1 -j DROP
<BR>iptables -A FORWARD -s 172.16.0.0/12 -i eth1 -j DROP
<BR>iptables -A INPUT -s 192.168.0.0/16 -i eth1 -j DROP
<BR>iptables -A FORWARD -s 192.168.0.0/16 -i eth1 -j DROP
<BR>iptables -A INPUT -s 224.0.0.0/3 -i eth1 -j DROP
<BR>iptables -A FORWARD -s 224.0.0.0/3 -i eth1 -j DROP
<BR>iptables -A INPUT -s 127.0.0.1 -i eth1 -j DROP
<BR>iptables -A FORWARD -s 127.0.0.1 -i eth1 -j DROP
<BR>iptables -A INPUT -i eth1 -p tcp --dport 1024:65535 -j ACCEPT
<BR>iptables -A InPUT -i eth1 -p udp --dport 1024:65535 -j ACCEPT
<BR>iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
<BR>iptables -A INPUT -p icmp --icmp-type echo-request -m limit --limit 2/s -j ACCEPT
<BR>iptables -A INPUT -p icmp --icmp-type echo-request -j DROP
<BR>iptables -A FORWARD -i eth1 -o eth0 -m state ESTABLISHED,RELATED -j ACCEPT
<BR>iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
<BR>iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
<BR>iptables -A PREROUTING -p tcp -m tcp -s 192.168.100.0 --dport 80 -j REDIRECT --to-ports 8080<br>

jaym
Linux 0.x
Linux 0.x
Messaggi: 18
Iscritto il: lun 4 apr 2005, 0:00

Squid !!

Messaggio da jaym »

Da ignorante mi sto chedendo se c´e´ qualche altro script firewall attivo che in qualche modo rompe le gnagnnere! stranamento poi il file rc.firewall che mi ricordavo essere presente sul myo slack adesso non c´e´ piu´. Help please!<br>

Rispondi