【问题标题】:squid bind outgoing ipsquid绑定传出ip
【发布时间】:2018-12-03 13:48:12
【问题描述】:

我在同一台服务器上有很多 ips,我正在使用 squid 基本身份验证。

示例 - 我有两个 ips 和 2 个用户以及一个端口 3128。问题是任何用户都可以使用任何传出 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

其中 x.x.x.x 是服务器的 IP 地址。

在我拥有的 config.file 中

x.x.x.0(ipaddress1) user1
x.x.x.1(ipaddress2) user2

如何让一个用户连接到一个 ip?

【问题讨论】:

    标签: acl basic-authentication squid


    【解决方案1】:

    我找到了解决办法。

    我需要将 myportname 的 http_port 和 acl 更改为以下:

    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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-29
      • 1970-01-01
      • 2021-08-05
      • 1970-01-01
      • 1970-01-01
      • 2017-10-18
      相关资源
      最近更新 更多