β

netstat查看网络establish并发完成情况及Linux网络状态工具ss命令使用详解。

uln tln参数含义:
u:udp
t:tcp
-l, --listening            display listening server sockets
-n, --numeric              don't resolve names

netstat 查看tcp/udp端口命令:
[root@newcomment_php_bj_sjs_10_71_182_148 newcomment.cntv.cn]# netstat -uln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
udp        0      0 0.0.0.0:111                 0.0.0.0:*
udp        0      0 0.0.0.0:808                 0.0.0.0:*
udp        0      0 127.0.0.1:837               0.0.0.0:*
udp        0      0 0.0.0.0:17617               0.0.0.0:*
udp        0      0 0.0.0.0:2392                0.0.0.0:*
[root@newcomment_php_bj_sjs_10_71_182_148 newcomment.cntv.cn]# netstat -tln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:34945               0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:10050               0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:32740               0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:15770             0.0.0.0:*                   LISTEN


常用基础:netstat -atlunp|grep 80

netstat -s|grep estab
12 connections established
28467 packets rejects in established connections because of timestamp

————————————————————————————————————
Linux网络状态工具ss命令使用详解:
http://www.cnphp6.com/archives/66361




man ss
ss -o state fin-wait-1 ’( sport = :http or sport = :https )’ dst 193.233.7/24
List  all  the tcp sockets in state FIN-WAIT-1 for our apache to network 193.233.7/24 and
look at their timers.


发表评论