加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

proxy – Squid 3.2 – 使用单一用户身份验证对随机出站IP进行适

发布时间:2020-12-13 20:08:53 所属栏目:百科 来源:网络整理
导读:我正在尝试将AclRandom用于Squid 3.2,我认为我对此方法有点困惑.这是我的配置: http_port 3128auth_param basic program /usr/local/squid32/libexec/basic_ncsa_auth /usr/local/squid32/etc/passwordsauth_param basic children 5auth_param basic realm
我正在尝试将AclRandom用于Squid 3.2,我认为我对此方法有点困惑.这是我的配置:
http_port 3128
auth_param basic program /usr/local/squid32/libexec/basic_ncsa_auth /usr/local/squid32/etc/passwords
auth_param basic children 5
auth_param basic realm proxy
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
acl my_auth proxy_auth REQUIRED
http_access allow my_auth

max_filedesc 32768

acl randomIP random 1/3
tcp_outgoing_address x.154.198.x randomIP
tcp_outgoing_address x.154.198.x randomIP
tcp_outgoing_address x.154.198.x randomIP

tcp_outgoing_address x.154.198.x

forwarded_for delete
via off

它始终使用列表中的第一个IP地址.有谁知道如何让它随机使用3中的一个?此外,我正在为我要求的任何网站获取大量TCP_MISS,还有其他看起来很奇怪的东西吗?

编辑:使用潜在解决方案更新:

http_port 3128
auth_param basic program /usr/local/squid32/libexec/basic_ncsa_auth /usr/local/squid32/etc/passwords
auth_param basic children 5
auth_param basic realm proxy
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
acl my_auth proxy_auth REQUIRED
http_access allow my_auth
http_access allow localhost
http_access deny all

max_filedesc 32768

authenticate_ttl 5 seconds
authenticate_ip_ttl 1 seconds

acl r_14 random 1/14
acl r_13 random 1/13
acl r_12 random 1/12
acl r_11 random 1/11
acl r_10 random 1/10
acl r_9 random 1/9
acl r_8 random 1/8
acl r_7 random 1/7
acl r_6 random 1/6
acl r_5 random 1/5
acl r_4 random 1/4
acl r_3 random 1/3
acl r_2 random 1/2
acl r_1 random 1/1

tcp_outgoing_address x.x.198.145 r_14
tcp_outgoing_address x.x.198.146 r_13
tcp_outgoing_address x.x.198.147 r_12
tcp_outgoing_address x.x.198.148 r_11
tcp_outgoing_address x.x.198.149 r_10
tcp_outgoing_address x.x.198.150 r_9
tcp_outgoing_address x.x.198.151 r_8
tcp_outgoing_address x.x.198.152 r_7
tcp_outgoing_address x.x.198.153 r_6
tcp_outgoing_address x.x.198.154 r_5
tcp_outgoing_address x.x.198.155 r_4
tcp_outgoing_address x.x.198.156 r_3
tcp_outgoing_address x.x.198.157 r_2
tcp_outgoing_address x.x.198.158 r_1

tcp_outgoing_address x.x.198.148

forwarded_for delete
via off
在线文档中有一个例子是三向分割.每一步都会消除到达该步骤的一部分流量,而不是所有流量的一部分.

>从占所有流量的1/3叶子2/3开始.
>取一半的2/3叶1/3
>取剩下的所有1/3

Squid-Cache-Wiki:Feature: ACL type “Random”

acl third random 1/3
acl half random 1/2

tcp_outgoing_address x.154.198.x third
tcp_outgoing_address x.154.198.x half
tcp_outgoing_address x.154.198.x

你的配置有1 / 3,1 / 3,所有这些都适用于:

>从所有人开始1/3离开2/3
>取1/3的2/3(2/9)叶4/9
>占4/9(4/27)叶子的1/3
>剩余的8/27

如果您的第一个和第四个传出地址相同,那么它将获得17/27的流量.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读