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


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 LAN with its primary IP Adding this to the typical sample squid.conf:

acl allowed_clients src
http_access allow allowed_clients

acl dedicated_client1 src
tcp_outgoing_address dedicated_client1
tcp_outgoing_address allowed_clients

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.