A friend of mine needed my help to configure squid server to use multiple IP addresses based on the squid’s IP being used as proxy server. I told him that he can configure the squid server using following squid acls and tcp_outgoing_address directives.
acl ip1 myip 192.168.1.2
acl ip2 myip 192.168.1.3
acl ip3 myip 192.168.1.4
tcp_outgoing_address 192.168.1.2 ip1
tcp_outgoing_address 192.168.1.3 ip2
tcp_outgoing_address 192.168.1.4 ip3
The acl lines tell squid to match myip which means if someone uses the IP 192.168.1.2 as their proxy server they will match the acl ip1 and so on..
Update: But his problem was not solved by this, because he had to configure squid for 500+ IPs and doing this by hand is not worth it when you have so many languages out there. So I wrote a small perl script for him to generate squid acl and tcp_outgoing_address directives for all IPs.
Tags: caching, Linux, Open Source, outgoing IP, perl, proxy server, squid
May 26, 2008 at 7:03 am |
[…] Azaad Source it is all about freedom… « Setup squid proxy server to use multiple outgoing IP addresses […]
July 15, 2008 at 10:43 pm |
i was looking for this, but i didn’t know the parameter “myip” 🙂
thanks!
August 1, 2008 at 6:41 am |
I am happy I was of help for someone.
September 10, 2008 at 2:06 am |
Will this work if I want my proxy server to allow access to multiple external IP addresses?
September 10, 2008 at 10:48 am |
@Adam
no, the above configuration is to allow use of multiple IPs on your proxy server as outgoing IPs.
September 27, 2008 at 5:10 am |
I have a list of IP addresses(outbound) which I need the proxy server randomly assign the users who enter to the proxy. Is this possible?
April 29, 2009 at 7:53 am |
Thanks for your tiny! Now I succefully conquer the problem squid with multi-IP.
March 8, 2010 at 3:25 pm |
Hey,
I know this entry is dated – but anyway, I was wondering, when you configure Squid to do this, does that mean it’ll advertise multiple IPs at the same time to a server.
E.g., in our logs I saw: “127.0.0.1, 127.0.0.2, 127.0.0.3”, where usually I saw “127.0.0.1” (these are examples, of course).
And then, if this is it – why do people need to advertise multiple IPs at the same time? I always thought that you assign a pool and it will “randomly” pick one instead.
Cheers,
Till
October 8, 2010 at 8:27 pm |
>> perl script for him to generate squid acl and tcp_outgoing_address directives for all IPs.
link is dead, any way to get the script?
December 9, 2010 at 9:24 pm |
thanks, i just knew that there is “myip” parameter
November 16, 2011 at 4:55 pm |
Welcome we’re Hacksomeone and we could jump at the chance to present you some unique hacks! Hacksomeone is a day by day redesigned web space who hunt the web down you! We’re not enjoy most hacksites sharp at one sort of hack. We actually hunt all aro…
[…]Setup squid proxy server to use multiple outgoing IP addresses « Azaad Source[…]…
December 2, 2011 at 5:35 am |
I know the thread is old – but, thank you…
Solved my issue…
…
February 12, 2012 at 3:37 am |
thanks for the script
but can you customize it to be working under centos ?
i tried to change the em0 to eth0:0 for example but it only show that interface address and not doing it to all
? thanks a lot
April 17, 2012 at 8:21 am |
Proxy Sites…
[…]Setup squid proxy server to use multiple outgoing IP addresses « Azaad Source[…]…