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.