driovitor
(usa Kurumin)
Enviado em 04/04/2011 - 09:54h
Estou utilizando squid 2.7 transparente para as pessoas de onde trabalho acessarem a rede sem fio, nao tenho interesse de bloquear nada apenas liberar internet par ao povo.
Segue o meu squid.conf e firewall
firewall
#!/bin/bash
2
3 iptables -F
4 iptables -X
5 iptables -t nat -F
6 iptables -t nat -X
7 iptables -t mangle -F
8 iptables -t mangle -X
9 iptables -P INPUT ACCEPT
10 iptables -P FORWARD ACCEPT
11 iptables -P OUTPUT ACCEPT
12 iptables -A INPUT -i lo -j ACCEPT
13 iptables -A INPUT -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
14 iptables -A FORWARD -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
15
16
17 iptables -A FORWARD -i eth1 -p tcp --dport 443 -j ACCEPT
18
19
20
21 iptables -A INPUT -i eth1 -j ACCEPT
22
23
24
25
26
27 iptables -t nat -A POSTROUTING -s 192.168.100.0/255.255.255.0 -o eth0 -j MASQUERADE
28
29 iptables -t nat -A PREROUTING -s 192.168.100.0/255.255.255.0 -p tcp --dport 80 -j REDIRECT --to-port 3128
30
squid.conf
acl all src all
600 acl manager proto cache_object
601 acl localhost src 127.0.0.1/32
602 acl to_localhost dst 127.0.0.0/8
603 #
604 # Example rule allowing access from your local networks.
605 # Adapt to list your (internal) IP networks from where browsing
606 # should be allowed
607 #acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
608 acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
609 acl localnet src 192.168.100.0/24 # RFC1918 possible internal network
610 #
611 acl SSL_ports port 443 # https
612 acl SSL_ports port 563 # snews
613 acl SSL_ports port 873 # rsync
614 acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
616 acl Safe_ports port 443 # https
617 acl Safe_ports port 70 # gopher
618 acl Safe_ports port 210 # wais
619 acl Safe_ports port 1025-65535 # unregistered ports
620 acl Safe_ports port 280 # http-mgmt
621 acl Safe_ports port 488 # gss-http
622 acl Safe_ports port 591 # filemaker
623 acl Safe_ports port 777 # multiling http
624 acl Safe_ports port 631 # cups
625 acl Safe_ports port 873 # rsync
626 acl Safe_ports port 901 # SWAT
627 acl purge method PURGE
628 acl CONNECT method CONNECT
629
630
631 acl permitidos dstdom_regex -i "/etc/squid/permitidos"
632
#Recommended minimum configuration:
655 #
656 # Only allow cachemgr access from localhost
657 http_access allow manager localhost
658 http_access deny manager
659 # Only allow purge requests from localhost
660 http_access allow purge localhost
661 http_access deny purge
662 # Deny requests to unknown ports
663 http_access deny !Safe_ports
664 # Deny CONNECT to other than SSL ports
665 http_access deny CONNECT !SSL_ports
666 #
667 # We strongly recommend the following be uncommented to protect innocent
668 # web applications running on the proxy server who think the only
669 # one who can access services on "localhost" is a local user
670 #http_access deny to_localhost
671 #
672 # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
673
674 # Example rule allowing access from your local networks.
675 # Adapt localnet in the ACL section to list your (internal) IP networks
676
677 # from where browsing should be allowed
678 http_access allow localnet
679 http_access allow localhost
680 http_access allow permitidos
#Allow ICP queries from local networks only
720 icp_access allow localnet
721 icp_access deny all
http_port 3128 transparent
access_log /var/log/squid/access.log squid
#Suggested default:
2740 refresh_pattern ^ftp: 1440 20% 10080
2741 refresh_pattern ^gopher: 1440 0% 1440
2742 refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
2743 refresh_pattern (Release|Package(.gz)*)$ 0 20% 2880
2744 refresh_pattern . 0 20% 4320