1. Identify the maximum number of IP connections with a connection status of establish and seal it off.
# netstat-antlp|grep ' estab ' |awk ' {print $ {} ' |awk-f: ' {print '} ' |sort |uniq-c|sort-rn-k 1
2. Count the number of IP connections with establish connection status
# netstat-antlp|grep ' estab ' |awk ' {print $ {} ' |awk-f: ' {print '} ' |sort |uniq-c|sort-rn
3. Identify the IP with the most Syn_rec connection status and seal it off.
# netstat-antlp|grep ' Syn_rec ' |awk ' {print $ {} ' |awk-f: ' {print '} ' |sort |uniq-c|sort-rn-k 1
4. Count the number of IP connections with Syn_rec connection status
# netstat-antlp|grep ' Syn_rec ' |awk ' {print $ {} ' |awk-f: ' {print '} ' |sort |uniq-c|sort-rn
Normally this value is small, preferably less than 5
5. Count connections for TCP connection status
# NETSTAT-ANTLP |awk '/^tcp/{s[$NF]++}end{for (A in S) print A,s[a]} '
This article is from the "Hanyun.fang" blog, make sure to keep this source http://hanyun.blog.51cto.com/1060170/1600839
awk Statistics Connection Status