how to find out the clients connects to the proxy server in redhat linux
If the Squid is listening on port, let's say 3128, you can list all connected IP addresses to this port by using command like netstat
in the server.
For example:
netstat -na | grep :3128
will display something like below:
tcp 0 0 0.0.0.0:3128 0.0.0.0:* LISTEN
tcp 1 0 10.12.0.1:3128 10.12.3.60:53736 CLOSE_WAIT
tcp 1 0 10.12.0.1:3128 10.12.4.24:60545 CLOSE_WAIT
tcp 1 0 10.12.0.1:3128 10.12.4.13:50484 ESTABLISHED
tcp 1 0 10.12.0.1:3128 10.12.3.55:52669 ESTABLISHED
You can ignore the first line, that displays the default listening of squid service. For the rest of rows, 4th row is the local server ip and 5th row lists the remote endpoint (the clients connecting to proxy). On the 6th column you can see the tcp connection status. The ESTABLISHED
signifies a currently active connection.
You can only list the estbalished connection with this:
netstat -na | grep :3128 | grep ESTABLISHED
You may use the command without the -n
option, to display hostname, instead of ip addresses.
netstat -a | grep :3128 | grep ESTABLISHED
Related videos on Youtube
Alfred Babu
Updated on September 18, 2022Comments
-
Alfred Babu over 1 year
Is there any way to find out the client machines connected to the particular proxy server in redhat linux , i am using redhat linux version 6 and squid configured in it
-
user1700494 over 8 yearsDid you check in squd logs?
-
-
Alfred Babu over 8 yearsI tried that but the ip is not resolving to the hostname
-
Diamond over 8 yearsThen probably it's a problem related to dns settings. Netstat uses the local dns to resolve the hostnames. Check on that.