Get List Of Connections By Ip
Hey guys,
Would anyone know how to get a list of ip addresses that connect to the server, summarize and sort it to ip addresses by connection for a given time period?
eg. I want the list for July '15
123.124.125.126 - 2431 Connections
111.110.100.10 - 1234 Connections
90.57.28.87 - 542 Connections
....
Any ideas?
-
Hello :) You may find this command helpful: netstat -ntu | awk ' $5 ~ /^[0-9]/ {print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
However, note you can't list the connection by time period because the data is not stored. Thank you.0
Please sign in to leave a comment.
Comments
1 comment