gzhgyzhh 发表于 2013-04-09 10:14

squid 允许某一IP访问某一个网站

下面是我squid配置情况,现在我想实现,让某一台电脑只能访问一个固定的网站,其它网站不能访问,请高手指点,谢谢!!
http_port 80
hierarchy_stoplist cgi-bin ?
no_cache deny QUERY
cache_mem 128 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 4096 KB
cache_dir ufs /home/squid/cache 150 16 256
cache_access_log /home/squid/log/access.log
cache_log /home/squid/log/cache.log
cache_store_log none
mime_table /etc/squid/mime.conf
pid_filename /var/run/squid.pid
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         # https
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 CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
acl local-intranet dstdomain .XXX.com
always_direct allow local-intranet
acl local-servers dstdomain .XXX.com
always_direct allow local-servers
#acl all_client src "/home/squid/user/testip"
#acl denysite urlpath_regex -i "/home/squid/user/testsites"
acl all-user src "/home/squid/user/allowuser"
#http_access allow all_client denysite
http_access allow all-user
acl rt-dom dstdomain .edc.XXX.com
acl rt-ip dst X.X.0.0-X.X.0.0/255.255.0.0
acl rsb-ip dst X.X.X.0/24
acl rt-usr src "/home/squid/user/rtuser"
http_access allow rt-usr rt-dom
http_access allow rt-usr rt-ip
http_access allow rt-usr rsb-ip
#acl all src 0.0.0.0/0.0.0.0
http_access deny all
icp_access allow all
miss_access allow all
cache_effective_user squid
cache_effective_group squid
visible_hostname squidtest
logfile_rotate 7
never_direct allow all
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
页: [1]
查看完整版本: squid 允许某一IP访问某一个网站