单网卡squid 3.0+iptables做内网透明代理
公司的网络管理,我想是每一个管理员的最大痛苦,什么什么部门不能得罪,什么什么部门要特权,管理员夹在中间受气不说,网络有问题还说你没有管理好,最近被烦得不行,直接做个透明代理来控制他们上网操作,好了,再抱怨下去可能说上一天也说不完,看教程吧.
系统:centos 5.5
ip:192.168.9.166
1.安装squid
这个我是直接yum安装的squid-3.0.STABLE25-1.el5
2.配置
cd /etc/squid/
rm -f squid.conf
vi squid.conf
squid.conf里的内容:
http_port 3128 transparent
cache_mem 64 MB
cache_swap_low 90
cache_swap_high 95
#maximum_object_size 5120 KB
#minimum_object_size 0 KB
maximum_object_size 4096 KB
maximum_object_size_in_memory 8 KB
cache_dir ufs /var/spool/squid 1024 16 256
cache_effective_user squid
cache_effective_group squid
access_log /var/log/squid/access.log squid
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
visible_hostname cdn
dns_nameservers 61.139.2.69
dns_nameservers 202.98.96.68
cache_mgr root
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
acl coach urlpath_regex coach
no_cache deny coach