鱿鱼绑定传出IP [英] squid bind outgoing ip
本文介绍了鱿鱼绑定传出IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在同一台服务器上有很多ip,并且正在使用鱿鱼基本身份验证。
I have many ips on same server and I am using squid basic authentication.
示例-我有两个ip和2个用户以及一个单一端口3128。问题是什么用户可以使用任何传出的ips。
Example - I have two ips and 2 users and one single port 3128. The issue is any user can use any outgoing ips.
以下是我的鱿鱼配置:
acl http proto http
acl port_80 port 80
acl port_443 port 443
acl CONNECT method CONNECT
auth_param basic program /usr/bin/python /path/to/authenticationscript
auth_param basic realm Please enter username and password
auth_param basic credentialsttl 1 second
acl AuthUsers proxy_auth REQUIRED
external_acl_type userip %SRC %LOGIN /usr/lib/squid/ext_file_userip_acl -f /path/to/config.file
acl userip external userip
http_access allow userip
http_access deny all
http_port 3128 name=0
acl ip1 myportname 0
tcp_outgoing_address x.x.x.0 ip1
acl ip2 myportname 1
tcp_outgoing_address x.x.x.1 ip2
其中xxxx是服务器的ipaddress。
where x.x.x.x is the ipaddress of the server.
我有config.file
In the config.file I am having
x.x.x.0(ipaddress1) user1
x.x.x.1(ipaddress2) user2
如何让一个用户连接到一个IP?
How can I let one user to connect to one ip?
推荐答案
我找到了解决方案。
我需要将myportname的http_port和acl更改为以下内容:
I need to change the http_port and acl of myportname to below:
http_port 3128
acl ip1 myip x.x.x.0
tcp_outgoing_address x.x.x.0 ip1
acl ip2 myip x.x.x.1
tcp_outgoing_address x.x.x.1 ip2
这篇关于鱿鱼绑定传出IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文