Я создаю небольшой прокси-сервер с моими 8 IP-адресами, которые у меня есть, но если я дам одному пользователю доступ к большему количеству IP-адресов, независимо от того, какой из них он использует в качестве прокси, сервер Squid будет использовать первый, соответствующий правилу.
Как видно из моего конфигурационного файла squid, пользователь Манфред имеет доступ ко всем IP-адресам, но какой бы IP я ни выбрал, squid использует только первый в списке: x.213.223.188
Есть идеи, как заставить squid использовать требуемый прокси для этого пользователя?
http_port 8888
visible_hostname funky
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid_passwd
acl ncsa_users proxy_auth REQUIRED
auth_param basic children 5
auth_param basic realm Anonymous proxy
auth_param basic credentialsttl 1 hours
acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
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 Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
acl user41 proxy_auth manfred
acl user42 proxy_auth manfred
acl user43 proxy_auth manfred
acl user44 proxy_auth manfred
acl user45 proxy_auth manfred
acl user46 proxy_auth ciokan manfred
acl user47 proxy_auth manfred
acl user48 proxy_auth manfred
tcp_outgoing_address x.213.223.188 user41
tcp_outgoing_address x.213.223.189 user42
tcp_outgoing_address x.213.223.190 user43
tcp_outgoing_address x.213.223.191 user44
tcp_outgoing_address x.37.196.188 user45
tcp_outgoing_address x.37.196.189 user46
tcp_outgoing_address x.37.196.190 user47
tcp_outgoing_address x.37.196.191 user48
# No local caching
maximum_object_size 0 KB
minimum_object_size 0 KB
# No local log
cache_access_log /dev/null
cache_store_log /dev/null
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny !ncsa_users
http_access allow ncsa_users
http_access allow user41
http_access allow user42
http_access allow user43
http_access allow user44
http_access allow user45
http_access allow user46
http_access allow user47
http_access allow user48
http_access allow all
hosts_file /etc/hosts
coredump_dir /var/spool/squid
Попробуйте что-нибудь вроде:
acl user41 proxy_auth manfred
acl user41 myip x.213.223.188
acl user42 proxy_auth manfred
acl user42 myip x.213.223.189
и оставьте tcp_outgoing_adress как есть.
РЕДАКТИРОВАТЬ: ах да, может вместо этого что-то вроде
acl ip_1 myip x.213.223.188
tcp_outgoing_address x.213.223.188 ip_1
acl ip_2 myip x.213.223.189
tcp_outgoing_address x.213.223.189 ip_2
и оставьте acls proxy_auth в покое:
acl user_manfred proxy_auth manfred
затем
http_access allow user_manfred ip_1
http_access allow user_manfred ip_2