I have installed Squid Proxy on a server which has 4 IP addresses.eg

  • 192.123.0.10
  • 192.123.0.11
  • 192.123.0.12
  • 192.123.0.13

192.123.0.10 is the main IP. I want to be able to either:

Set my browser proxy to point to 1 of the four ip's listed and have squid use that correspondining IP as it's outgoing ip address

OR

Set my browser proxy to point to 1 of the four ip's listed and have squid randonmly choose from the outgoing ip from the list

Any ideas?


EDIT for clarification:

As an example. Lets say I set my browser to point to 192.123.0.10, any website I visit should see my IP address as 192.123.0.10. This works. Then if I change my browser to point to 192.123.0.11, any website I visit should see my IP address as 192.123.0.11, but instead it sees the first IP 192.123.0.10. The same goes for 192.123.0.12 and 192.123.0.13.

link|improve this question

50% accept rate
I don't fully understand your "use that correspondining IP as it's outgoing ip address" bit, could you clarify please. What are you actually trying to achieve? – Chopper3 Jun 24 '10 at 12:39
@Chopper - I have updated the question with a clarification. – user33121 Jun 24 '10 at 12:58
feedback

migrated from stackoverflow.com Jun 24 '10 at 12:31

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 1 down vote accepted

Found a way of doing it. In the squid config I setup 4 http_port values with an acl for each port:

acl portA myport 8080
acl portB myport 8081
acl portC myport 8082
acl portD myport 8083
http_port 8080
http_port 8081
http_port 8082
http_port 8083

and then I redirect the outgoing ip address according to the port it came in on:

tcp_outgoing_address 192.123.0.10 portA
tcp_outgoing_address 192.123.0.11 portB
tcp_outgoing_address 192.123.0.12 portC
tcp_outgoing_address 192.123.0.13 portD

Then before I make a request to a certian web page I change the port in the browser proxy settings and the the IP address they see changes.

Only issue is that it seems to have a cache on it. I need to wait a few minutes after I change the proxy port before it reflects the new ip address.

link|improve this answer
feedback

Ok, understand, basically you need to put in a reverse proxy in front of your outgoing proxy ports, creating a four-member VIP with something like sticky round-robin sharing out these IPs between 'clients'.

link|improve this answer
So I need an additional server with squid installed? – user33121 Jun 24 '10 at 13:18
feedback

Your Answer

 
or
required, but never shown

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