LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-22-2008, 04:33 AM   #1
JasperB
LQ Newbie
 
Registered: Apr 2008
Posts: 7

Rep: Reputation: 0
Squid Networking Client IP


I've done plenty of googling readnig of articles but I cannot get my squid setup to log the client ip's.

I'm not sure if it's even possible with my setup. The squid logs all show :

Code:
 172.16.108.1 TCP_MISS/200 7330 CONNECT urs.microsoft.com:443 - DIRECT/213.199.170.73 -
So the gateway ip of 172.16.108.1 and not the actual clients. My log generator can only show "one" user.

Anyway here is a quick diagram of the network :


Clients (10.0.1.0-200, Microsoft WinXP, Win2003 domain)

Proxy Server : 172.16.108.200 (172x range is internal servers only in protected network)

ADSL Modem (DHCP activated) --> 192.168.1.254


Right, now the proxy server is a vmware machine located on host with 6 network cards. 3 of the network cards are linked directly only to this proxy server (dedicated)

Eth0 : 172.16.108.200 (proxy/squid address on port 8080)
Eth1 : 192.168.1.35 (dhcp lease from adsl modem / gateway)
eth2: 10.0.1.233 (client ip range


My routing tables
Code:
proxy:~# route -n
Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
172.16.108.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
10.0.1.0        0.0.0.0         255.255.255.0   U     0      0        0 eth2
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 eth1
Everything is working perfectly except for the client logging. I figured it had something to do with the different ip range that the clients were in.

To test this I made a new client in the 172.x range, this one appeared in my logging with the correct ip.

But the clients cannot be put in this range . Is there a work-around for this issue? Maybe with the correct routing tables or third party software? Different loggin tool perhaps?

Or can I have the clients send there ip's with a request towards the proxy server? Or is my only option to set the proxy server in the 10.x range?

For testing I did add eth2 (10.x) to the proxy server, it didn't make any difference.
 
Old 04-22-2008, 04:46 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well in a conventional setup the IP of the client is what hits the box, so there's nothing else required. if you are natting the traffic (possibly as part of a transparent proxy) then this information can be lost. I'd be looking outside of squid for why this is happening. do a tcpdump on the squid box and just ping it from a client and see what source IP is hitting you. I'd guess it's also going to not be the real clients IP address - I reckon your gateway is doing an illogical source nat on traffic through it.

Last edited by acid_kewpie; 04-22-2008 at 04:47 AM.
 
Old 04-22-2008, 05:18 AM   #3
JasperB
LQ Newbie
 
Registered: Apr 2008
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
well in a conventional setup the IP of the client is what hits the box, so there's nothing else required. if you are natting the traffic (possibly as part of a transparent proxy) then this information can be lost. I'd be looking outside of squid for why this is happening. do a tcpdump on the squid box and just ping it from a client and see what source IP is hitting you. I'd guess it's also going to not be the real clients IP address - I reckon your gateway is doing an illogical source nat on traffic through it.

I figured it was something like that. Any clue if we need to fix this in our gateway (GNAT firewall)? And what options we need to look for?

Or even better a work around? Can configure certain routes on the proxy server to do a reverse lookup ?

Or is my best option to place the proxy server in the same ip range as the clients? Then it wouldn't need the gateway right?

Here is ping tcpdump :

Code:
12:06:14.996704 IP 172.16.108.1 > proxy: ICMP echo request, id 1024, seq 

12:06:14.996736 IP proxy > 172.16.108.1: ICMP echo reply, id 1024, seq
 
Old 04-22-2008, 05:25 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well i've no idea what this gateway device is but it's absolutely at fault. with those two internal networks you should not be doing any nat at all. you would only change the source IP when you are heading out from the private network to the interweb.
 
Old 04-22-2008, 07:55 AM   #5
JasperB
LQ Newbie
 
Registered: Apr 2008
Posts: 7

Original Poster
Rep: Reputation: 0
Hehe, well I went ahead and placed the proxy server in the actual ip range.

Now I need to find a nice logging tool to get current kb/sec speeds being downloaden/uploaden + data/logs per user.

Any suggestions?
 
  


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
client hostname logging in squid vchawla Linux - Security 3 11-16-2007 03:26 AM
Squid and Home Networking fedix Linux - Networking 3 10-01-2007 12:43 PM
Client ip in squid access log pavangogineni Linux - Networking 4 10-24-2006 04:52 AM
Squid + Client PC with dreamweaver on m3zzr Linux - Software 1 10-03-2004 11:47 AM
Squid Client for Windows donkeyspunk Linux - Networking 3 12-21-2003 10:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:33 AM.

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