netstat再解读
C:UsersAdministrator>netstat -nb 活动连接 协议 本地地址 外部地址 状态 TCP 127.0.0.1:3306 127.0.0.1:4112 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4113 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4114 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4115 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4116 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4117 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4118 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4119 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4120 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4121 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4122 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4123 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4124 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4125 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4126 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4127 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4128 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4129 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4130 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4131 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4132 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4133 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4134 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4135 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4136 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4137 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4138 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4139 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4140 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:3306 127.0.0.1:4142 ESTABLISHED [mysqld.exe] TCP 127.0.0.1:4108 127.0.0.1:4109 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4109 127.0.0.1:4108 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4112 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4113 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4114 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4115 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4116 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4117 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4118 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4119 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4120 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4121 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4122 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4123 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4124 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4125 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4126 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4127 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4128 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4129 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4130 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4131 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4132 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4133 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4134 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4135 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4136 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4137 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4138 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4139 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4140 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 127.0.0.1:4142 127.0.0.1:3306 ESTABLISHED [javaw.exe] TCP 192.168.4.123:2069 64.233.189.188:5228 ESTABLISHED [chrome.exe] TCP 192.168.4.123:2912 163.177.90.147:80 ESTABLISHED [QQ.exe] TCP 192.168.4.123:2948 58.250.11.114:80 CLOSE_WAIT [QQ.exe] TCP 192.168.4.123:3154 209.135.140.128:443 CLOSE_WAIT [javaw.exe] TCP 192.168.4.123:3179 112.90.78.141:8080 ESTABLISHED [QQBrowser.exe] TCP 192.168.4.123:4224 163.177.93.234:80 CLOSE_WAIT [TsService.exe] TCP 192.168.4.123:4231 202.89.233.103:80 ESTABLISHED [chrome.exe] TCP 192.168.4.123:4237 163.177.68.215:80 CLOSE_WAIT [QQ.exe] TCP 192.168.4.123:4238 163.177.93.234:80 ESTABLISHED [QQBrowser.exe] TCP 192.168.4.123:4239 163.177.93.236:80 ESTABLISHED [QQBrowser.exe] TCP 192.168.4.123:4241 163.177.73.177:80 ESTABLISHED [QQBrowser.exe]
可见, mysql都是 3306端口,但是与本地的java程序建立了很多的连接。。。
另外,chrome/QQBrowser/qq也打开了几个本地端口,
这些都是tcp连接,因为默认是TCP
第一行是协议,第二行是本地地址,—— ip + 端口,ip一般为 127.0.0.1或本机的局域网ip之一,区别? 另外也有ipv6的格式出现: 0:0:0:0::xxxxx等,而绝不可能出现其他ip,另外需要 注意观察主要的服务端口: http web服务器 80,8080,mysql 3306,ftp/sftp( 23 ,22) , oracle 数据库 1521 ,邮件端口(POP3 收邮件 110 995 IMAP 收邮件 143 993 SMTP 发邮件 25)等即可。
第三行是远程端口—— 这个远程地址,是相对而言的,实际上也可以是本地ip+端口,因为,我们存储需要本地客户端访问本机服务器的情况。 比如 本地java 访问本地 mysql 等等
第四行是连接状态,主要有:
LISTEN:侦听来自远方的TCP端口的连接请求
SYN-SENT:再发送连接请求后等待匹配的连接请求
SYN-RECEIVED:再收到和发送一个连接请求后等待对方对连接请求的确认
ESTABLISHED:代表一个打开的连接
FIN-WAIT-1:等待远程TCP连接中断请求,或先前的连接中断请求的确认
FIN-WAIT-2:从远程TCP等待连接中断请求
CLOSE-WAIT:等待从本地用户发来的连接中断请求
CLOSING:等待远程TCP对连接中断的确认
LAST-ACK:等待原来的发向远程TCP的连接中断请求的确认
TIME-WAIT:等待足够的时间以确保远程TCP接收到连接中断请求的确认
CLOSED:没有任何连接状态
参数解析:
a all
n non name, but digit
b show name below
o pid