QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 938|回复: 2

关于squid不能禁止下载的问题?

[复制链接]
发表于 2005-10-18 18:55:59 | 显示全部楼层 |阅读模式
下边是squid配置文件:
http_port 127.0.0.1:3128

cache_mem 32 MB
cache_swap_low 90
cache_swap_high 95
cache_mgr [email protected]
cache_dir ufs /cache/squid 6000 16 256
cache_access_log /usr/local/squid/var/logs/access.log /dev/null
cache_log /usr/local/squid/var/logs/cache.log /dev/null
cache_store_log /usr/local/squid/var/logs/store.log none

acl all src 0.0.0.0/0.0.0.0
acl localhost src 127.0.0.1
acl mmxfile urlpath_regex -i \.gif$ \.exe$ \.mp3$ \.rmvb$ \.rm$ \.wma$ \.wav$ \.rar$ \.zip
acl star src 192.168.1.0/255.255.255.0
acl teacher arp "/usr/local/squid/teacher.list"
acl teacher1 arp "/usr/local/squid/teacher1.list"
acl baduser maxconn 3

http_access allow teacher teacher1 localhost
http_access deny mmxfile
http_access deny baduser
http_access allow star
http_access deny all

httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

我用iptables做的透明代理代码如下:
modprobe ip_tables
modprobe iptable_nat
modprobe iptable_filter
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F -t nat
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth1 -j SNAT --to xxx.xxx.xxx.xxx
发表于 2005-10-18 19:31:02 | 显示全部楼层
-A PREROUTING -s 192.168.0.0/24 -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
回复

使用道具 举报

 楼主| 发表于 2005-10-19 18:36:15 | 显示全部楼层
首先谢谢hew的答复,但是那些上网机器的IP全都是192.168.1.10-192.168.1.254这个范围的IP地址,用这条语句有用吗???
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-3 04:25 , Processed in 0.034602 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表