[root@lb02 ~]# netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 52 10.0.0.6:22 10.0.0.1:53808 ESTABLISHED
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 ::1:25 :::* LISTEN
[root@lb02 ~]# netstat -nat |awk '{print $6}'|sort|uniq -c|sort -rn
4 LISTEN
1 Foreign
1 ESTABLISHED
1 established)