我正在尝试使用Squid拥有的Splash页面function,但是我试图让它只在某个子网上使用。 我无法弄清楚使用两个ACL来做到这一点。
我有我的squid3.conf文件中的以下内容
external_acl_type sessions ttl=60 concurrency=100 %SRC /usr/lib/squid3/squid_session -t 7200 -b /tmp/squidcache/sessions.db acl guests external sessions src 192.168.200.0/24 acl trusted 192.168.1.0/24 deny_info http://192.168.200.5/splash.html guests http_access deny !guests
这不会出现启动页面,而是出现在两个networking中。
有没有人遇到过这个?
干杯,
吉姆
你不能以这种方式给acl guests添加额外的条件 – 每个squid ACL可能只有一个types(你可以为同一个ACL实现“或者逻辑”,而不是“和”)。 acl NAME external TYPE ...行上的其他参数实际上被附加到外部帮助程序的命令行中。
另外你在下一行有一个语法错误( src关键字缺失),但是在你的configuration代码片段中不会使用trusted acl。
编写这些规则的正确方法是为IP范围添加单独的ACL,并在http_access行中使用多个ACL:
external_acl_type sessions ttl=60 concurrency=100 %SRC /usr/lib/squid3/squid_session -t 7200 -b /tmp/squidcache/sessions.db acl guests_ip src 192.168.200.0/24 # can add more "acl guests_ip src ..." here acl guests_sessions external sessions deny_info http://192.168.200.5/splash.html guests_sessions http_access deny guests_ip !guests_sessions