Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 690
  • Last Modified:

squid proxy

hello,
I have squid proxy and I also have 5 ips
I have edited the .conf file so I can
use the ips like this

http_port ip1:port1
http_port ip2:port2
http_port ip3:port3
http_port ip4:port4
http_port ip5:port5

when I connect to the ip and port it always
gives me the main IP.. how can I fix it?
0
Sabrin
Asked:
Sabrin
  • 9
  • 8
1 Solution
 
TintinCommented:
What gives you the main IP address?  Do you mean the source address of the request?
0
 
SabrinAuthor Commented:
ip2location.com shows me only the main ip
0
 
ravenplCommented:
You mean the squid connects to remotes using always one IP?
Use 'tcp_outgoing_address' configuration directive to change it.
0
Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
SabrinAuthor Commented:
yes that what im using, like this

tcp_outgoing_address ip1
tcp_outgoing_address ip2
0
 
ravenplCommented:
tcp_outgoing_address can't be used that way - will always use first match. That's it - the tcp_outgoing_address can bind one outgoing address for some ACLs, another for others ACLs. From the manual, which You propably already seen
#  TAG: tcp_outgoing_address
#       Allows you to map requests to different outgoing IP addresses
#       based on the username or sourceaddress of the user making
#       the request.
#
#       tcp_outgoing_address ipaddr [[!]aclname] ...
#
#       Example where requests from 10.0.0.0/24 will be forwareded
#       with source address 10.1.0.1, 10.0.2.0/24 forwarded with
#       source address 10.1.0.2 and the rest will be forwarded with
#       source address 10.1.0.3.
#
#       acl normal_service_net src 10.0.0.0/255.255.255.0
#       acl good_service_net src 10.0.1.0/255.255.255.0
#       tcp_outgoing_address 10.0.0.1 normal_service_net
#       tcp_outgoing_address 10.0.0.2 good_service_net
#       tcp_outgoing_address 10.0.0.3
#
#       Processing proceeds in the order specified, and stops at first fully
#       matching line.
0
 
SabrinAuthor Commented:
I saw that but i dont understand! how it should be ?
0
 
ravenplCommented:
An how You want it to behave?
0
 
SabrinAuthor Commented:
lets say these are my ips and the ports i want to use them
86.65.25.101:3120
86.65.25.102:3121
86.65.25.103:3122
how can I do that ?


0
 
ravenplCommented:
Do You want the squid should pick random source IP while connectiong to remote http server?
If so, I think You have to do it with linux's iptables rather than from squid itself
0
 
SabrinAuthor Commented:
dude, I only want to use 1 ip per port!
If I connect to 86.65.25.101:3120
and I go to ip2location.com I want to see 86.65.25.101
same thing with 86.65.25.102:3121 and 86.65.25.103:3122
thats it!
0
 
ravenplCommented:
dude, why it took You so long to be clear! (or maybe I have problems - possible as english is not my native)

acl from_ip1 myip 86.65.25.101
acl from_ip2 myip 86.65.25.102
tcp_outgoing_address 86.65.25.101 from_ip1
tcp_outgoing_address 86.65.25.102 from_ip2
tcp_outgoing_address 86.65.25.101 # always leave there some defaults...

Note - You can't control source port on outgoing tcp connection. It will be choosen randomly by system.
0
 
SabrinAuthor Commented:
what if I just open port 3120 from firewall and I connect to
the 5 ips I have will ip2location be able to show that IP ?
If so how can I do it?
0
 
ravenplCommented:
I'm sorry - I don't get You.
You have to open firewall for each IP:port the squid listens. Apart from that You should allow any ESTABLISHED connection to the squid box. And finally You should allow any outgoing connection from the squid box.

The config I provided tells squid to initiate remote connection from same localIP, as it received the proxy request on.
In other words: if client connects to squid at 86.65.25.102:3128, squid will(if required) connect to remote www server from 86.65.25.102
0
 
SabrinAuthor Commented:
ok but I have 5 ip addresses not just 2
0
 
ravenplCommented:
dude, make it for all five addresses - should be easy to folow the pattern...
0
 
SabrinAuthor Commented:
ok correct me if im worng!

acl from_ip1 myip 86.65.25.101
acl from_ip2 myip 86.65.25.102
acl from_ip1 myip 86.65.25.103
acl from_ip2 myip 86.65.25.104
acl from_ip1 myip 86.65.25.105

tcp_outgoing_address 86.65.25.101 from_ip1
tcp_outgoing_address 86.65.25.102 from_ip2
tcp_outgoing_address 86.65.25.103 from_ip1
tcp_outgoing_address 86.65.25.104 from_ip2
tcp_outgoing_address 86.65.25.105 from_ip1

tcp_outgoing_address 86.65.25.101
tcp_outgoing_address 86.65.25.102
tcp_outgoing_address 86.65.25.103
tcp_outgoing_address 86.65.25.104
tcp_outgoing_address 86.65.25.105
0
 
ravenplCommented:
You wrong.

acl from_ip1 myip 86.65.25.101
acl from_ip2 myip 86.65.25.102
acl from_ip1 myip 86.65.25.103
acl from_ip2 myip 86.65.25.104
acl from_ip1 myip 86.65.25.105

tcp_outgoing_address 86.65.25.101 from_ip1
tcp_outgoing_address 86.65.25.102 from_ip2
tcp_outgoing_address 86.65.25.103 from_ip1
tcp_outgoing_address 86.65.25.104 from_ip2
tcp_outgoing_address 86.65.25.105 from_ip1
tcp_outgoing_address 86.65.25.101 # default one - eg. if connected from localhost
0
 
ravenplCommented:
And I'm wrong as well.

acl from_ip1 myip 86.65.25.101
acl from_ip2 myip 86.65.25.102
acl from_ip3 myip 86.65.25.103
acl from_ip4 myip 86.65.25.104
acl from_ip5 myip 86.65.25.105

tcp_outgoing_address 86.65.25.101 from_ip1
tcp_outgoing_address 86.65.25.102 from_ip2
tcp_outgoing_address 86.65.25.103 from_ip3
tcp_outgoing_address 86.65.25.104 from_ip4
tcp_outgoing_address 86.65.25.105 from_ip5
tcp_outgoing_address 86.65.25.101 # default one - eg. if connected from localhost
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

  • 9
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now