- 论坛徽章:
- 0
|
eth2 外网 229.146.115.76 DNS:221.53.149.13 gateway:229.146.115.73
eth1 内网 192.168.0.1 /24
以下是我根据网上的教程写的配置,高手们指教一下,小弟弄了三天了都没弄通,救救我.另外客户PC需要如何设置?
/etc/squid.conf (其中其它默认的项目用#标没有改动)
http_port 3128
icp_port 3130
cache_mem 256 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 40960 KB
maximum_object_size_in_memory 4096 KB
ipcache_size 1024
ipcache_low 90
ipcache_high 95
fqdncache_size 1024
cache_dir ufs /var/spool/squid 40000 16 256
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
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 to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
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 Safe_ports port 53 #DNS
acl CONNECT method CONNECT
acl inside src 192.168.0.0/24 (内网)
http_access allow all
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports (这两句是默认的,但我没看懂)
http_reply_access allow all
icp_access allow all
cache_effective_user squid
cache_effective_group squid
httpd_accel_port 80
httpd_accel_single_host off
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
coredump_dir /var/spool/squid
iptables:
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth2 -j SNAT --to 229.146.115.76
iptables -t nat -A PREROUTING -s 192.168.0.0/24 -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -A INPUT -i eth1 -p udp -m multiport --dports 53 -j ACCEPT |
|