Question

I'm attempting to run squid as a proxy server on my OS X Server 3.0 installation. I have 3 IPs assigned to the machine. I've tried a couple of different options as seen below to get multiple outgoing IPs to work. What I would like to happen is if a request comes to 1.2.3.187 then the outgoing address is 1.2.3.187. So on and so forth with the 3 IPs I have. Here are the 2 configurations I have tried.

-----Configuration 1------

http_port 50.20.213.187:3129 name=3129 http_port 50.20.213.189:3130 name=3130

acl tasty3129 myportname 3129 src 127.0.0.1/8 http_access allow tasty3129 tcp_outgoing_address 1.2.3.187 tasty3129

acl tasty3130 myportname 3130 src 127.0.0.1/8 http_access allow tasty3130 tcp_outgoing_address 1.2.3.189 tasty3130

--In the above I'm not sure what src should actually be--- If I have source as localhost or the ip of my computer that I'm testing from ipchicken tells me that my IP is the base IP of the machine .186.

----Configuration 2---------

acl ip1 myip 1.2.3.186 acl ip2 myip 1.2.3.187 acl ip3 myip 1.2.3.189 tcp_outgoing_address 1.2.3.186 ip1 tcp_outgoing_address 1.2.3.187 ip2 tcp_outgoing_address 1.2.3.189 ip3

---In config 2 if I use .186 as my proxy (the base machine address) it works like a charm via proxy settings thru another computer's firefox or if I do something like curl --proxy 1.2.3.186:3128 --trace - www.whatsmyip.us

However if I try to replace .186 with .187 I get a weird index of html page via a browser or via terminal with curl I get a message that says: Connection #0 to host 1.2.3.187 left intact

I'm new to this so I'm probably missing something so basic it's laughable. But if anyone out there has an idea of what I could be doing wrong, I would greatly appreciate it. I haven't been able to find a guide for the mac that's complete but I assume in network I would need an ethernet interface for each IP. (Which I have) Not sure what other settings need to be setup there though. Proxy Settings? If so what should the settings be?

Thanks in advance

Was it helpful?

Solution

Okay, I found a solution that works for me. This may not be the proper way to do it, but it is working. So here's the information

I'm running OS X Server 3.0 on Mavericks First Under network settings I have 3 network interfaces 1.2.3.186 1.2.3.187 1.2.3.189

The .186 interface is the primary and active service. For all 3 of these network interfaces I click the advanced button, navigate to the proxies tab and enter the .186 address as the address and 3128 as the port.

Now, I opened the Server Admin control panel, (the app called server) and created a website EDIT Initially I thought you needed an site for each IP as that's what I had setup but upon further testing and exploring I have found that I only need one site set to any IP on port 80.

Under DHCP in the Server Admin tool, make sure the correct IP range is chosen to support your IPS

Now this is the squid config setup I ended up going with acl ip1 myip 1.2.3.186/32 acl ip2 myip 1.2.3.187/32 acl ip3 myip 1.2.3.189/32

tcp_outgoing_address 1.2.3.189 ip1 tcp_outgoing_address 1.2.3.187 ip2 tcp_outgoing_address 1.2.3.189 ip3

If you make changes to squid while it's running, be sure to restart it.

It's now working perfectly for me, finally. If someone has the "right" way or a smarter way to do this, please let me know. Thanks!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top