Squid将每个传出的ip绑定到用户?

问题描述 投票:0回答:1

我正在尝试使用squid并将2个传出的ips分别绑定到2个用户。

理想的结果是,我可以访问以下内容:

xxx.xxx.xxx.14:3128:user1:user1password 
xxx.xxx.xxx.18:3128:user2:user2password

但不是:

xxx.xxx.xxx.14:3128:user2:user2password 
xxx.xxx.xxx.18:3128:user1:user1password

我找到了一个类似的问题并使用了类似的squid.conf:

squid bind outgoing ip

这是我的配置:

acl http proto http
acl port_80 port 80
acl port_443 port 443
acl CONNECT method CONNECT


auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/passwords
acl ncsa_users proxy_auth REQUIRED
external_acl_type userIp %SRC %LOGIN /usr/lib64/squid/ext_file_userip_acl -f /etc/squid/userIp.conf

acl userIp external userIp

http_access deny !ncsa_users
http_access allow userIp
http_access deny all

http_port 3128
acl ip1 myip xxx.xxx.xxx.14
tcp_outgoing_address xxx.xxx.xxx.14 ip1

acl ip2 myip xxx.xxx.xxx.18
tcp_outgoing_address xxx.xxx.xxx.18 ip2

在我的userIp.conf中,我有:

xxx.xxx.xxx.14 user1
xxx.xxx.xxx.18 user2

在我的/ etc / squid / passwords中,我有以下由htpasswd创建的:

user1:encrypted password
user2:encrypted password

问题是:如果我删除'http_access deny!ncsa_users',则user1可以访问xxx.xxx.xxx.14和xxx.xxx.xxx.18。与user2相同。

但如果我按原样保留'http_access deny!ncsa_users',那么所有连接都会失败。

我觉得'http_access允许userIp'不能按预期工作。

我无法在网上搜索类似的问题...希望有人可以帮助我

authentication proxy acl squid
1个回答
0
投票

好的,我现在想通了。

%SRC%LOGIN对意味着指定用户自己的pc地址源,这实际上不是我想要的。

我想要的实际上是%MYADDR%LOGIN对,它指定允许每个用户连接的ips。

所以,是的,这就是问题所在

© www.soinside.com 2019 - 2024. All rights reserved.