LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-17-2019, 01:17 PM   #1
micolocobr2
LQ Newbie
 
Registered: Aug 2019
Location: Brazil
Distribution: Ubuntu
Posts: 4

Rep: Reputation: Disabled
Squid leaks host IP on first conection


Hi folks,

I have a Vbox runing squid 3.5.24 with 125 address in interfaces.

Im routing specific IPs to some users and protecting it with htpasswd.
Eg there are users using 2 dedicated IPs and the routing is like this:

http_port 141.191.72.201:4223 name=201
acl ip201 myportname 201
tcp_outgoing_address 141.191.72.201 ip201

http_port 161.191.72.202:4223 name=202
acl ip202 myportname 202
tcp_outgoing_address 161.191.72.202 ip202

The strange bug is that just in the fist conection through any of these IPs, myip.com shows the outgoing IP of my server instead of one of those IPs above.
For any other conection through the same IPs after the first, myip.com shows the correct outgoing IP.

Any clue of why?
I thought maybe it could be something related with authentication...

I have more than 10 Vboxes with exact same problem runing ubuntu 16.
 
Old 08-17-2019, 07:36 PM   #2
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
if the 2nd connection comes from a different IP, does it still show the wrong IP?

sounds like a possible timing bug. if the 2nd connection works OK even if it comes from a different IP, then a workaround would be to trigger a connection through it right after it starts. that could also be a nice way to verify it is up (if that script doesn't get a response, it could report a problem).
 
Old 08-17-2019, 08:35 PM   #3
micolocobr2
LQ Newbie
 
Registered: Aug 2019
Location: Brazil
Distribution: Ubuntu
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks a lot for your time Skaperen.

The problem in deed is only in the first time connection.
In the this first connection squid is really leaking the client's IP.
This is a big problem for the kind of customers I have.

You said "workaround would be to trigger a connection through it right after it starts"

Any sugestion about how to do it?
 
Old 08-17-2019, 08:55 PM   #4
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
so it leaks per client. if you restart it today and a client comes back from overseas next week and uses it then, it will still leak their IP once even though other users have used this for thousands of requests?

where you say "with 125 address in interfaces" is "125" part of an address or a count of addresses?

i'd set up some kind of port forwarding to obscure client IP addresses if your authentication is not based on IP (a bad design).
 
Old 08-17-2019, 09:08 PM   #5
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
you would have a script to restart it and a script to trigger a connection. the script to restart it would then run the trigger script. you also want the trigger script to run when the system boots up.

the trigger script should sleep a minute or two to let squid get going. then it would run "curl" or a program like that to access a safe web page, like your own.
 
Old 08-18-2019, 11:07 PM   #6
micolocobr2
LQ Newbie
 
Registered: Aug 2019
Location: Brazil
Distribution: Ubuntu
Posts: 4

Original Poster
Rep: Reputation: Disabled
"if you restart it today and a client comes back from overseas next week and uses it then, it will still leak their IP once even though other users have used this for thousands of requests?"

Actually it is a bit hard to replicate the problem now.
If I test with scrapebox's proxy manager all IPs of my 10 Vboxes each one with around 125 IPs in squid, I will have around 4% of "the proxy leaks your ip" message.

I have managed to increase this just reading a lot about squid.conf best practices and implementing some code.
But I cant get rid of this 4%.

I also implemented web caching and I have plans to get rid of this htpasswd and change authentication for source IP based authentication as you have suggested.
 
Old 08-18-2019, 11:09 PM   #7
micolocobr2
LQ Newbie
 
Registered: Aug 2019
Location: Brazil
Distribution: Ubuntu
Posts: 4

Original Poster
Rep: Reputation: Disabled
"you would have a script to restart it and a script to trigger a connection. the script to restart it would then run the trigger script. you also want the trigger script to run when the system boots up"

My concert about this workaround is timing.
I run this IPs as proxies and response time is a key to success.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to copy file from remote host to local host then delete from remote host legendmac Linux - Newbie 13 05-27-2015 03:47 PM
Forwarding ping packets from one 1st host to 2nd host via 2rd host sachee Linux - Networking 1 09-25-2011 01:51 PM
try install host ; bind9-host uninstalled , how to undo sudo apt-get install host? shojaru Linux - Newbie 0 06-11-2009 12:45 AM
Fedora Core 6 doesn't detect the wireless conection as a wireless conection...? santiagosilva Linux - Wireless Networking 33 02-04-2007 08:07 AM
Memory Leaks and Processes in Linux... Sonny Programming 10 03-04-2002 05:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration