netstat command for popular IP addresses OK in CentOS 6, fails in CentOS 7
0
votes
0
answers
446
views
In CentOS 6 w/ OpenVZ 2.6.32, this command outputs IPs with the highest number of connections against port 22, e.g:
[root@legovz ~]# netstat -antu | grep :22 | grep -v LISTEN | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
2 217.20.114.121
3 0.0.0.0
3 58.242.82.6
[root@legovz~]#
Under CentOS 7, w/ OpenVZ 7, the output is always as follows, despite the fact I know there is lots of traffic on port 22:
[root@ovz7 ~]# netstat -antu | grep :22 | grep -v LISTEN | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
1 0.0.0.0
[root@ovz7 ~]#
What I need to do differently, to achieve the same result with CentOS 7.? If I can't, why?
Asked by jones8u5kf
(9 rep)
Apr 9, 2019, 05:22 PM
Last activity: Apr 9, 2019, 06:19 PM
Last activity: Apr 9, 2019, 06:19 PM