1

I have been playing with a few different pieces of forward proxy software, primarily CCProxy and Squid Proxy/Cache. What I have is a dedicated server with a single NIC with multiple IPs assigned to it. One IP is static and the rest are dynamic. The static IP acts as a primary address, which is how I access my proxy server, the others are dynamic ip addresses for web scraping and other tasks. I have created a proxy in CCProxy and it allows you to link a user to a specific outbound ip address, this is really useful for what I am doing, allowing me to assign different tasks to different IPs.

So what I was wondering if this was possible to do in Squid Proxy?

I love how customisable Squid is but I really could do with this feature.

Thanks in advance, Joe

0

1 Answer 1

2

The option to do this is tcp_outgoing_address:

Allows you to map requests to different outgoing IP addresses based on the username or source address of the user making the request.

"outgoing IP address" really means "source IP". Now you can choose an acl to distinguish your user by any available mean, client's IP (acl ... src ...), simple proxy authentication (auth_param + basic_ncsa_auth) etc.

Example adapted from documentation, using source IP as selector, where the squid server would be owning various IPs in the 192.0.2.0/24 LAN with its primary IP 192.0.2.1. Adding this to the typical sample squid.conf:

acl allowed_clients src 198.51.100.0/24
http_access allow allowed_clients

acl dedicated_client1 src 198.51.100.174
tcp_outgoing_address 192.0.2.174 dedicated_client1
tcp_outgoing_address 192.0.2.10 allowed_clients
tcp_outgoing_address 192.0.2.5

will allow clients from allowed_clients, and have them use outgoing IP 192.0.2.10, except for client from 198.51.100.174 which will get 192.0.2.174. Any other client configured elsewhere than in this example would use 192.0.2.5 and the server's primary IP will never be used.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .