{"id":943,"date":"2019-04-23T22:07:45","date_gmt":"2019-04-23T14:07:45","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=943"},"modified":"2019-04-24T21:00:14","modified_gmt":"2019-04-24T13:00:14","slug":"ss","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/ss","title":{"rendered":"ss\u547d\u4ee4 – \u663e\u793a\u6d3b\u52a8\u5957\u63a5\u5b57\u4fe1\u606f"},"content":{"rendered":"\n

ss\u662fSocket Statistics\u7684\u7f29\u5199\u3002ss\u547d\u4ee4\u7528\u6765\u663e\u793a\u5904\u4e8e\u6d3b\u52a8\u72b6\u6001\u7684\u5957\u63a5\u5b57\u4fe1\u606f\u3002\u5b83\u53ef\u4ee5\u663e\u793a\u548cnetstat\u7c7b\u4f3c\u7684\u5185\u5bb9\u3002\u4f46ss\u7684\u4f18\u52bf\u5728\u4e8e\u5b83\u80fd\u591f\u663e\u793a\u66f4\u591a\u66f4\u8be6\u7ec6\u7684\u6709\u5173TCP\u548c\u8fde\u63a5\u72b6\u6001\u7684\u4fe1\u606f\uff0c\u800c\u4e14\u6bd4netstat\u66f4\u5feb\u901f\u66f4\u9ad8\u6548\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>ss [\u53c2\u6570]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n
-n<\/td>\u4e0d\u89e3\u6790\u670d\u52a1\u540d\u79f0\uff0c\u5df2\u6570\u5b57\u65b9\u5f0f\u663e\u793a<\/td><\/tr>
-a<\/td>\u663e\u793a\u6240\u6709\u5957\u63a5\u5b57<\/td><\/tr>
-l <\/td>\u663e\u793a\u5904\u4e8e\u76d1\u542c\u72b6\u6001\u7684\u5957\u63a5\u5b57<\/td><\/tr>
-o <\/td>\u663e\u793a\u8ba1\u65f6\u5668\u4fe1\u606f<\/td><\/tr>
-e<\/td>\u663e\u793a\u8be6\u7ec6\u7684\u5957\u63a5\u5b57\u4fe1\u606f<\/td><\/tr>
-m<\/td>\u663e\u793a\u5957\u63a5\u5b57\u7684\u5185\u5b58\u4f7f\u7528\u60c5\u51b5<\/td><\/tr>
-p<\/td>\u663e\u793a\u4f7f\u7528\u5957\u63a5\u5b57\u7684\u8fdb\u7a0b<\/td><\/tr>
-i<\/td>\u663e\u793a\u5185\u90e8\u7684TCP\u4fe1\u606f<\/td><\/tr>
-s<\/td>\u663e\u793a\u5957\u63a5\u5b57\u4f7f\u7528\u6982\u51b5<\/td><\/tr>
-4<\/td>\u4ec5\u663e\u793aipv4\u7684\u5957\u63a5\u5b57<\/td><\/tr>
-6<\/td>\u4ec5\u663e\u793aipv6\u7684\u5957\u63a5\u5b57<\/td><\/tr>
-0<\/td>\u663e\u793aPACKET\u5957\u63a5\u5b57<\/td><\/tr>
-t<\/td>\u53ea\u663e\u793aTCP\u5957\u63a5\u5b57<\/td><\/tr>
-u<\/td>\u53ea\u663e\u793aUDP\u5957\u63a5\u5b57<\/td><\/tr>
-d<\/td>\u53ea\u663e\u793aDCCP\u5957\u63a5\u5b57<\/td><\/tr>
-w<\/td>\u53ea\u663e\u793aRAW\u5957\u63a5\u5b57<\/td><\/tr>
-x<\/td>\u53ea\u663e\u793a Unix\u5957\u63a5\u5b57<\/td><\/tr>
-D
<\/td>
\u5c06\u539f\u59cbTCP\u5957\u63a5\u5b57\u4fe1\u606f\u8f6c\u50a8\u5230\u6587\u4ef6<\/td><\/tr><\/tbody><\/table>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u663e\u793aTCP\u5957\u63a5\u5b57\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# ss -t -a 
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 0.0.0.0:ssh 0.0.0.0:*
ESTAB 0 52 192.168.60.19:ssh 192.168.30.21:59321
LISTEN 0 128 *:websm *:*
LISTEN 0 128 [::]:ssh [::]:* <\/pre>\n\n\n\n

\u663e\u793aUDP\u5957\u63a5\u5b57\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# ss -u -a
State Recv-Q Send-Q Local Address:Port Peer Address:Port
UNCONN 0 0 0.0.0.0:bootpc 0.0.0.0:*
UNCONN 0 0 127.0.0.1:323 0.0.0.0:*
UNCONN 0 0 [::1]:323 [::]:* <\/pre>\n\n\n\n

\u663e\u793a\u5957\u63a5\u5b57\u4f7f\u7528\u6982\u51b5\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# ss -s
Total: 185
TCP: 4 (estab 1, closed 0, orphaned 0, timewait 0)
Transport Total IP IPv6
RAW 1 0 1
UDP 3 2 1
TCP 4 2 2
INET 8 4 4
FRAG 0 0 0 <\/pre>\n","protected":false},"excerpt":{"rendered":"

ss\u662fSocket Statistics\u7684\u7f29\u5199\u3002ss\u547d\u4ee4\u7528\u6765\u663e\u793a\u5904\u4e8e\u6d3b\u52a8\u72b6\u6001\u7684\u5957\u63a5\u5b57\u4fe1\u606f\u3002\u5b83\u53ef\u4ee5\u663e\u793a\u548cnets […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/943"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=943"}],"version-history":[{"count":16,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/943\/revisions"}],"predecessor-version":[{"id":1223,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/943\/revisions\/1223"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}