Home arrow Networking Tips
Networking Tips
Show IPs that access your Web server, sorted by number of connections PDF
Tuesday, 17 April 2012
If we want to see which IPs use our Web server and we want to sort the list ordered by number of connections from every IP, in order to identify IPs that stress our server we can run the following command:

  netstat -an | grep ".80" | awk '{print $5}' | sed 's/.[^.]*$//' | sort | uniq -c | sort -rn

or (grep just IPs):

  netstat -an | grep ".80" | awk '{print $5}' | sed 's/.[^.]*$//' | sort | uniq -c | sort -rn | egrep '([[:digit:]]{1,3}\.){3}[[:digit:]]{1,3}'

Last Updated ( Wednesday, 18 April 2012 )
 

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?