{"id":349,"date":"2023-05-04T17:27:37","date_gmt":"2023-05-04T09:27:37","guid":{"rendered":"http:\/\/idc.birk.cn\/?p=349"},"modified":"2023-05-04T21:17:02","modified_gmt":"2023-05-04T13:17:02","slug":"linux%e5%91%bd%e4%bb%a4%e4%b9%8biftop%e6%b5%81%e9%87%8f%e7%bb%9f%e8%ae%a1","status":"publish","type":"post","link":"https:\/\/idc.birk.cn\/?p=349","title":{"rendered":"Linux\u547d\u4ee4\u4e4biftop\u6d41\u91cf\u7edf\u8ba1"},"content":{"rendered":"<div class=\"article-info art-share-layout m-share-layout clearfix\">iftop \u7528\u4e8e\u5728\u6307\u5b9a\u7684\u63a5\u53e3\u76d1\u63a7<u>\u7f51\u7edc<\/u>\u6d41\u91cf\uff0c\u5982\u679c\u6ca1\u6709\u6307\u5b9a\u63a5\u53e3(\u7f51\u5361)\uff0c\u5b83\u53ef\u4ee5\u5728\u7b2c\u4e00\u4e2a\u63a5\u53e3\uff0c\u6216\u8005\u641c\u7d22\u4e00\u4e2a\u770b\u8d77\u6765\u662f\u8fde\u63a5\u5916\u90e8\u7684\u63a5\u53e3\u3002\u7136\u540e\u6309\u4e3b\u673a\u6d3b\u52a8\u8fde\u63a5\u663e\u793a\u5f53\u524d\u5e26\u5bbd\u3002<\/div>\n<article class=\"amain\">\n<div class=\"main-wrap\">\n<div class=\"rticle-content simditor clearfix\">\n<div class=\"simditor-body clearfix\">\n<div class=\"vditor-reset\">\n<p>\u8981\u4f7f\u7528 iftop \u547d\u4ee4\u76d1\u63a7\u7f51\u7edc\u63a5\u53e3\u7684\u6d41\u91cf\uff0c\u4f60\u5fc5\u987b\u4ee5 root \u6216\u8005\u5177\u6709 sudo \u6743\u9650\u7684\u7528\u6237\u8fd0\u884c iftop \u547d\u4ee4\u3002<\/p>\n<div id=\"new-middle-berry\"><\/div>\n<p>\u5728\u672c<u>\u6559\u7a0b<\/u>\u4e2d\uff0c\u6211\u4eec\u5c06\u8bf4\u660e\u5982\u4f55\u00a0<u>Linux<\/u>\u00a0\u4f7f\u7528 iftop \u547d\u4ee4\u76d1\u63a7\u6307\u5b9a\u63a5\u53e3\u7684\u7f51\u7edc\u6d41\u91cf\uff0c\u67e5\u770b\u5f53\u524d\u5df2\u5efa\u7acb\u7684\u7f51\u7edc\u8fde\u63a5\u7684\u901f\u5ea6\u7b49\u3002<\/p>\n<h2>iftop \u547d\u4ee4<\/h2>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0ciftop \u4f1a\u89e3\u91ca\u4e0e\u5b83\u5728\u6570\u636e\u5305\u4e2d\u627e\u5230\u7684\u5730\u5740\u5173\u8054\u7684\u4e3b\u673a\u540d\u3002\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5927\u91cf\u7684\u6d41\u91cf\uff0c\u5e76\u53ef\u80fd\u5bfc\u81f4\u663e\u793a\u6df7\u4e71\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u4f7f\u7528 iftop \u547d\u4ee4\u7684 -n \u9009\u9879\uff0c\u7981\u7528\u4e3b\u673a\u540d\u7684\u89e3\u91ca\u3002\u5982\u679c\u5728\u6b63\u5728\u8fd0\u884c\u7684 iftop \u4f1a\u8bdd\u4e2d\u53ef\u4ee5\u6309 n \u952e\u6253\u5f00\u6216\u8005\u5173\u95ed\u4e3b\u673a\u540d\u7684 DNS \u89e3\u91ca\u3002<\/p>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0ciftop \u7edf\u8ba1\u901a\u8fc7\u8fc7\u6ee4\u5668\u7684\u6240\u6709 IP \u6570\u636e\u5305\uff0c\u5e76\u6839\u636e\u6570\u636e\u5305\u7a7f\u8fc7\u63a5\u53e3\u7684\u65b9\u5411\u786e\u5b9a\u6570\u636e\u5305\u7684\u65b9\u5411\u3002<\/p>\n<p>\u4f7f\u7528 -F \u9009\u9879\u53ef\u4ee5\u8ba9 iftop \u663e\u793a\u8fdb\u5165\u548c\u79bb\u5f00\u6307\u5b9a\u5b9a\u7f51\u7edc\u7684\u6570\u636e\u5305\u3002\u4f8b\u5982\uff0ciftop -F 10.0.0.0\/255.0.0.0 \u5c06\u5206\u6790\u6d41\u5165\u548c\u6d41\u51fa 10.* \u6bb5\u7f51\u7edc\u7684\u6570\u636e\u5305\u3002<\/p>\n<h2>iftop \u547d\u4ee4\u8be6\u89e3<\/h2>\n<pre><code class=\"hljs nginx vditor-linenumber\"><span class=\"hljs-attribute\">sudo<\/span> iftop\r\n<\/code><\/pre>\n<p>\u5f53\u4e0d\u6307\u5b9a\u4efb\u4f55\u9009\u9879\u4e0e\u53c2\u6570\u8fd0\u884c iftop \u65f6\uff0ciftop \u4f1a\u4f7f\u7528\u6574\u4e2a\u5c4f\u5e55\u663e\u793a\u7f51\u7edc\u7684\u5e26\u5bbd\u7528\u6cd5\uff0c\u663e\u793a\u5c4f\u9876\u90e8\u662f\u6761\u5f62\u56fe\u7684\u5bf9\u6570\u523b\u5ea6\u7684\u89c6\u89c9\u6307\u793a\u3002<\/p>\n<p>\u5c4f\u5e55\u7684\u4e3b\u8981\u90e8\u5206\u5217\u51fa\u5df2\u8fde\u63a5\u4e3b\u673a\u5728 2\u300110 \u548c 40 \u79d2\u65f6\u95f4\u95f4\u9694\u5185\u53d1\u9001\u548c\u63a5\u6536\u6570\u636e\u7684\u901f\u7387\u3002\u6570\u636e\u6d41\u7684\u65b9\u5411\u7531\u7bad\u5934 &lt;= \u548c =&gt; \u6307\u793a\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"hljs properties vditor-linenumber\"><span class=\"hljs-meta\">\u672c\u5730\u4e3b\u673a\u540d\u79f0<\/span>   <span class=\"hljs-string\">\u5df2\u8fde\u63a5\u7684\u8fdc\u7a0b\u4e3b\u673a        2s   10s  40s<\/span>\r\n<span class=\"hljs-attr\">myfreax<\/span>  =<span class=\"hljs-string\">&gt;  www.myfreax.com      1Kb  500b 100b<\/span>\r\n         <span class=\"hljs-meta\">&lt;<\/span>=                       <span class=\"hljs-string\">2Mb  2Mb  2Mb<\/span>\r\n<\/code><\/pre>\n<p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230 myfreax \u7684\u672c\u5730\u4e3b\u673a\u4e0e\u8fdc\u7a0b\u4e3b\u673a www.myfreax.com 2\u79d2\u524d\u53d1\u9001\u7684\u6570\u636e\u901f\u5ea6\u662f 1 kb\uff0c 10\u79d2\u524d\u662f 500 b\uff0c40\u79d2\u524d100 b\u3002<\/p>\n<blockquote><p>\u6ce8\u610f b \u7684\u5355\u4f4d\u4e0d\u662f\u5b57\u8282\uff0c\u662f bit\/s \u5355\u4f4d\u7684\u7f29\u5199\uff0c1 kb \u4e5f\u5c31\u662f 1 kbit\/s\uff0c2mb \u5c31\u662f 2 mbit\/s\u3002<\/p><\/blockquote>\n<p>\u540c\u6837\u4f60\u4e5f\u5c31\u7406\u89e3 myfreax \u4e3b\u673a\u4ece www.myfreax.com \u4e3b\u673a\u63a5\u6536\u6570\u636e\u7684\u901f\u5ea6\uff0c\u5728 2 \u79d2\uff0c10 \u79d2\u524d\uff0c40 \u79d2\u524d\u90fd\u662f 2mb\uff0c\u4e5f\u5c31\u662f\u901f\u5ea6\u6ca1\u6709\u4efb\u4f55\u53d8\u5316\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1407 mBox\"  title=\"iftop-interface\" src=\"\/wp-content\/uploads\/replace\/fd787d631340b92c6d66452ef0a4fc2e.jpeg\" alt=\"Linux\u547d\u4ee4\u4e4biftop\u6d41\u91cf\u7edf\u8ba1\" width=\"646\" height=\"341\" \/><\/p>\n<p>\u5c4f\u5e55\u7684\u5e95\u90e8\uff0c\u663e\u793a\u5404\u79cd\u603b\u8ba1\uff0c\u5305\u62ec\u8fc7\u53bb 40 \u79d2\u7684\u5cf0\u503c\u6d41\u91cf\u3001\u4f20\u8f93\u7684\u603b\u6d41\u91cf\uff08\u8fc7\u6ee4\u540e\uff09\u4ee5\u53ca 2 \u79d2\u300110 \u79d2\u548c 40 \u79d2\u7684\u5e73\u5747\u603b\u4f20\u8f93\u901f\u7387\u3002<\/p>\n<p>Tx \u8868\u793a\u53d1\u9001\uff0cRx \u8868\u793a\u63a5\u6536\uff0ccum \u8868\u793a\u7d2f\u8ba1\u503c\uff0cTotal \u8868\u793a\u53d1\u9001\u548c\u89e3\u91ca\u7684\u603b\u548c\uff0cRa<a href=\"https:\/\/www.elecfans.com\/tags\/te\/\" target=\"_blank\" rel=\"noopener\"><u>te<\/u><\/a>\u8868\u793a\u7f51\u7edc\u901f\u5ea6\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"hljs apache vditor-linenumber\"><span class=\"hljs-attribute\">TX<\/span>:    cum: <span class=\"hljs-number\">400<\/span>KB      peak\uff1a<span class=\"hljs-number\">34<\/span>.<span class=\"hljs-number\">8<\/span>Kb  Rattes: <span class=\"hljs-number\">21<\/span>kb <span class=\"hljs-number\">32<\/span>kb <span class=\"hljs-number\">6<\/span>.<span class=\"hljs-number\">6<\/span>kb\r\n<span class=\"hljs-attribute\">RX<\/span>:\t\t\t<span class=\"hljs-number\">900<\/span>KB\t\t\t <span class=\"hljs-number\">34<\/span>.<span class=\"hljs-number\">8<\/span>Kb\t         <span class=\"hljs-number\">3<\/span>kb <span class=\"hljs-number\">3<\/span>kb <span class=\"hljs-number\">8<\/span>kb\r\n<span class=\"hljs-attribute\">Total<\/span>:\t\t<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">30<\/span>MB\t\t     <span class=\"hljs-number\">34<\/span>.<span class=\"hljs-number\">8<\/span>Kb\t\t     <span class=\"hljs-number\">21<\/span>kb <span class=\"hljs-number\">32<\/span>kb <span class=\"hljs-number\">6<\/span>.<span class=\"hljs-number\">6<\/span>kb\r\n<\/code><\/pre>\n<p>\u5728\u4e0a\u9762\u7684\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u53d1\u9001\u7d2f\u8ba1\u503c\u662f 400KB\uff0c\u5cf0\u503c\u662f 34.8 KB\uff0c 2 \u79d2\u300110 \u79d2\u548c 40 \u79d2\u7684\u5e73\u5747\u603b\u4f20\u8f93\u901f\u7387\u5206\u522b\u662f 21kb 32kb 6.6kb\u3002<\/p>\n<p>\u63a5\u6536\u7684\u7d2f\u8ba1\u503c\u662f 900KB\uff0c\u5cf0\u503c\u662f 34.8 KB\uff0c 2 \u79d2\u300110 \u79d2\u548c 40 \u79d2\u7684\u5e73\u5747\u603b\u4f20\u8f93\u901f\u7387\u5206\u522b\u662f 3kb 3kb 68kb\u3002<\/p>\n<p><strong>\u5b9e\u4f8b<\/strong><\/p>\n<p>\u9ed8\u8ba4\u662f\u76d1\u63a7\u7b2c\u4e00\u5757\u7f51\u5361\u7684\u6d41\u91cf<\/p>\n<div class=\"cnblogs_code\">\n<pre>iftop<\/pre>\n<\/div>\n<p>\u76d1\u63a7eth1<\/p>\n<div class=\"cnblogs_code\">\n<pre>iftop -i eth1<\/pre>\n<\/div>\n<p>\u76f4\u63a5\u663e\u793aIP, \u4e0d\u8fdb\u884cDNS\u53cd\u89e3\u6790<\/p>\n<div class=\"cnblogs_code\">\n<pre>iftop -n<\/pre>\n<\/div>\n<p>\u76f4\u63a5\u663e\u793a\u8fde\u63a5\u57e0\u7f16\u53f7, \u4e0d\u663e\u793a\u670d\u52a1\u540d\u79f0:<\/p>\n<div class=\"cnblogs_code\">\n<pre>iftop -N<\/pre>\n<\/div>\n<p>\u663e\u793a\u67d0\u4e2a\u7f51\u6bb5\u8fdb\u51fa\u5c01\u5305\u6d41\u91cf<\/p>\n<div class=\"cnblogs_code\">\n<pre>iftop -F 192.168.1.0\/24 or 192.168.1.0\/255.255.255.0<\/pre>\n<\/div>\n<h2>\u5feb\u6377\u952e<\/h2>\n<p>\u5f53\u4f60\u8fdb\u5165 iftop \u4f1a\u8bdd\u65f6\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u5feb\u6377\u952e\uff0c\u5207\u6362 iftop \u7684\u663e\u793a\u65b9\u5f0f\u6216\u8005\u6309 f \u6dfb\u52a0\u8fc7\u6ee4\u5668\u3002<\/p>\n<ul>\n<li>h\uff1a\u663e\u793a\u5e2e\u52a9\u83dc\u5355<\/li>\n<li>n\uff1a\u5f00\u542f \/ \u5173\u95ed\u4e3b\u673a\u540d\u7684 DNS \u89e3\u6790\uff0c\u5982\u679c\u53ef\u4ee5 iftop \u53ef\u4ee5\u5c06 IP \u5730\u5740\u89e3\u91ca\u4e3a\u4e3b\u673a\u540d\u5219\u663e\u793a\u4e3b\u673a\u7684\u540d\u79f0\uff0c\u5426\u5219\u663e\u793a IP \u5730\u5740\u3002<\/li>\n<li><\/li>\n<li>N\uff1a\u5f00\u542f \/ \u5173\u95ed\u670d\u52a1\u540d\u79f0\u7684\u89e3\u91ca\uff0c\u4f8b\u5982\uff0c\u672c\u5730\u4e3b\u673a\u8fde\u63a5\u8fdc\u7a0b\u7684\u4e3b\u673a\u7684 443 \u7aef\u53e3\uff0ciftop \u5c06\u4f1a\u5728\u8fdc\u7a0b\u4e3b\u673a IP \u5730\u5740\u540e\u9762\u6dfb\u52a0\u670d\u52a1\u7684\u540d\u79f0 www.myfreax.com:https\u3002<\/li>\n<li><\/li>\n<li>p\uff1a\u5f00\u542f \/ \u5173\u95ed\u76ee\u6807\u548c\u6e90\u7aef\u53e3\u7684\u663e\u793a<\/li>\n<li>P\uff1a\u6682\u505c\u5237\u65b0\u5c4f\u5e55\uff0c\u6ce8\u610f\uff1a<\/li>\n<li>\u8fd9\u4ec5\u4ec5\u6682\u505c\u4e3b\u8981\u7a97\u53e3\u90e8\u5206\u7684\u5237\u65b0\uff0c\u5c4f\u5e55\u5e95\u90e8\u7684\u7edf\u8ba1\u503c\u4f9d\u7136\u81ea\u52a8\u5237\u65b0\u3002<\/li>\n<li>s\uff1a\u663e\u793a\u6216\u8005\u9690\u85cf\u6e90\u4e3b\u673a\u7684 IP \u6216\u4e3b\u673a\u540d\u3002<\/li>\n<li>S\uff1a\u663e\u793a \/ \u5173\u95ed\u6e90\u7aef\u53e3\u3002<\/li>\n<li>t\uff1a\u5207\u6362\u663e\u793a\u53d1\u9001\u548c\u63a5\u6536\u6d41\u91cf\u7684\u4e09\u79cd\u65b9\u5f0f\uff0c\u7b2c\u4e00\u79cd\u662f\u4ec5\u663e\u793a\u53d1\u9001\u7684\u6d41\u91cf\uff0c\u7b2c\u4e8c\u79cd\u662f\u4ec5\u663e\u793a\u63a5\u6536\u7684\u6d41\u91cf\uff0c\u540c\u65f6\u53d1\u9001\u548c\u63a5\u6536\u7684\u6d41\u91cf\uff0c\u4e5f\u5c31\u662f\u542f\u52a8\u65f6\u7684\u9ed8\u8ba4\u6a21\u5f0f\u3002<\/li>\n<li>T\uff1a\u663e\u793a \/ \u5173\u95ed\u53d1\u9001\u4e0e\u63a5\u6536\u6d41\u91cf\u7edf\u8ba1\uff0c\u8fd9\u5c06\u4f1a\u5728 2s 10s 40s \u901f\u7387\u4e4b\u524d\u6dfb\u52a0\u4e00\u5217\u663e\u793a\u7d2f\u8ba1\u503c\u3002<\/li>\n<li>q\uff1a\u9000\u51fa iftop<\/li>\n<\/ul>\n<h3>\u6392\u5e8f<\/h3>\n<ul>\n<li>j \/ k\uff1a\u5206\u522b\u662f\u5411\u4e0b\u548c\u5411\u4e0a\u6eda\u52a8\uff0c\u5f53\u5c4f\u5e55\u4e0d\u8db3\u4ee5\u663e\u793a\u6240\u6709\u8fde\u63a5\u65f6\u3002<\/li>\n<li>&lt;\uff1a\u901a\u8fc7\u6e90\u540d\u79f0\u7684\u6392\u5e8f\u3002<\/li>\n<li>\n<blockquote><p>\uff1a\u901a\u8fc7\u76ee\u6807\u540d\u79f0\u6392\u5e8f\u3002<\/p><\/blockquote>\n<\/li>\n<li>1\/2\/3\uff1a\u901a\u8fc7\u7b2c\u4e00\uff0c\u7b2c\u4e8c\uff0c\u7b2c\u4e09\u5217\u8fdb\u884c\u6392\u5e8f\u3002<\/li>\n<li>o\uff1a\u51bb\u7ed3\u6392\u5e8f\u65b9\u5f0f\uff0c\u7531\u4e8e iftop \u662f\u4e0d\u65ad\u6eda\u52a8\u6240\u6709\u8fde\u63a5\uff0c\u5173\u95ed iftop \u6eda\u52a8\u8fde\u63a5\uff0c\u53ef\u4ee5\u6309 o \u952e\u3002<\/li>\n<\/ul>\n<h2>\u8fc7\u6ee4\u5668<\/h2>\n<p>iftop \u652f\u6301\u4e00\u4e9b\u8fc7\u6ee4\u5668\u6765\u8fc7\u6ee4\u663e\u793a\u7684\u5185\u5bb9\u3002\u8981\u4f7f\u7528\u57fa\u4e8e iftop \u7684\u8fc7\u6ee4\u5668\uff0c\u53ef\u4ee5\u5728 iftop \u547d\u4ee4\u7684 -f \u9009\u9879\u4e4b\u540e\u8ddf\u4e00\u4e2a\u8fc7\u6ee4\u5668\u8868\u8fbe\u5f0f\uff0c\u4e5f\u53ef\u4ee5\u5728 iftop \u4f1a\u8bdd\u4e2d\u4f7f\u7528 f \u952e\u8bbe\u7f6e\u8fc7\u6ee4\u5668\u3002<\/p>\n<p>iftop \u4f7f\u7528 pcap-filter \u4f5c\u4e3a\u6570\u636e\u5305\u7684\u8fc7\u6ee4\u5668\uff0c\u4f60\u53ef\u4ee5\u6839\u636e pcap-filter \u8fc7\u6ee4\u5668\u8bed\u6cd5\uff0c\u7f16\u5199 iftop \u8fc7\u6ee4\u5668\u8868\u8fbe\u5f0f\u3002<\/p>\n<p>\u503c\u5f97\u4e00\u63d0\u7684\u5728 iftop \u4f1a\u8bdd\u6309 f \u952e\u8f93\u5165\u7684\u8fc7\u6ee4\u5668\u8868\u8fbe\u5f0f\u4e5f\u53ef\u7528\u4e8e\u5728 -f \u9009\u9879\u540e\u9762\u8bbe\u7f6e\u7684\u8868\u8fbe\u5f0f\u3002\u4e5f\u5c31\u662f\u8bf4\u8bed\u6cd5\u4e0a\u6ca1\u6709\u5dee\u522b\u3002<\/p>\n<pre><code class=\"hljs nginx vditor-linenumber\"><span class=\"hljs-attribute\">Net<\/span> filter&gt; src host <span class=\"hljs-number\">192.168.1.100<\/span>\r\n<span class=\"hljs-comment\">#eq<\/span>\r\niftop -f '<span class=\"hljs-string\">src host 192.168.1.100'<\/span>\r\n<\/code><\/pre>\n<h2>\u57fa\u4e8e IP \u5730\u5740\u8fc7\u6ee4<\/h2>\n<p>\u8981\u4f7f\u7528\u57fa\u4e8e IP \u5730\u5740\u7684\u8fc7\u6ee4\u5668\uff0c\u53ef\u4ee5\u5728 iftop \u547d\u4ee4\u540e\u8ddf\u4e00\u4e2a\u57fa\u4e8e IP \u7684\u8fc7\u6ee4\u5668\u8868\u8fbe\u5f0f\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre><code class=\"hljs nginx vditor-linenumber\"><span class=\"hljs-attribute\">iftop<\/span> -f '<span class=\"hljs-string\">src host 192.168.1.100'<\/span>\r\n<\/code><\/pre>\n<p>\u4e0a\u9762\u7684\u547d\u4ee4\u5c06\u4ec5\u663e\u793a\u6765\u81ea IP \u5730\u5740\u4e3a 192.168.1.100 \u7684\u4e3b\u673a\u7684\u6d41\u91cf\uff0csrc host \u8bed\u6cd5\u8868\u793a\u8bbe\u7f6e\u6765\u6e90\u4e3b\u673a\u3002<\/p>\n<p>\u8981\u4f7f iftop \u4ec5\u663e\u793a\u76ee\u6807\u5730\u5740\u4e3a 8.8.8.8 \u7684\u6d41\u91cf\uff0c\u8bf7\u8fd0\u884c\u547d\u4ee4\u00a0<code>iftop -f \"dst host 8.8.8.8\"<\/code>\uff1a<\/p>\n<pre><code class=\"hljs nginx vditor-linenumber\"><span class=\"hljs-attribute\">iftop<\/span> -f '<span class=\"hljs-string\">dst host 8.8.8.8'<\/span>\r\n<\/code><\/pre>\n<p>\u9664\u4e86\u6307\u5b9a\u8bbe\u7f6e\u76ee\u6807\u548c\u6e90\u8fc7\u6ee4\u4e4b\u5916\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528 CIDR \u683c\u5f0f\u7684 IP \u5730\u5740\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"hljs nginx vditor-linenumber\"><span class=\"hljs-attribute\">iftop<\/span> -f '<span class=\"hljs-string\">src net 192.168.0.0\/16'<\/span>\r\n<\/code><\/pre>\n<p>\u4e0a\u9762\u7684\u547d\u4ee4\u5c06\u663e\u793a\u6e90\u5730\u5740\u5728 192.168.0.0\/16 \u7f51\u6bb5\u4e3b\u673a\u7684\u6d41\u91cf\u3002<\/p>\n<h2>\u57fa\u4e8e\u7aef\u53e3\u8fc7\u6ee4<\/h2>\n<p>iftop \u53ef\u4ee5\u901a\u8fc7\u57fa\u4e8e\u7aef\u53e3\u7684\u8fc7\u6ee4\u5668\u6765\u76d1\u63a7\u6307\u5b9a\u7aef\u53e3\u7684\u7f51\u7edc\u6d41\u91cf\u3002\u8981\u4f7f\u7528\u57fa\u4e8e\u7aef\u53e3\u7684\u8fc7\u6ee4\u5668\uff0c\u53ef\u4ee5\u5728 iftop \u547d\u4ee4\u540e\u9762\u52a0\u4e0a\u4e00\u4e2a\u7aef\u53e3\u8fc7\u6ee4\u5668\u8868\u8fbe\u5f0f\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre><code class=\"hljs nginx vditor-linenumber\"><span class=\"hljs-attribute\">iftop<\/span> -f '<span class=\"hljs-string\">port 80'<\/span>\r\n<\/code><\/pre>\n<p>iftop -f \"port 80\" \u547d\u4ee4\u53ea\u663e\u793a\u7aef\u53e3 80 \u7684\u7f51\u7edc\u6d41\u91cf\uff0c\u5373 HTTP \u6d41\u91cf\u3002\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528\u9017\u53f7\u5c06\u591a\u4e2a\u7aef\u53e3\u53f7\u8fde\u63a5\u5728\u4e00\u8d77\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"hljs nginx vditor-linenumber\"><span class=\"hljs-attribute\">iftop<\/span> -f '<span class=\"hljs-string\">port 80,443'<\/span>\r\n<\/code><\/pre>\n<p>iftop -f \"port 80,443\" \u547d\u4ee4\u4ec5\u663e\u793a\u7aef\u53e3 80 \u6216 443 \u7684\u7f51\u7edc\u6d41\u91cf\uff0c\u5373 HTTP \u6216 HTTPS \u6d41\u91cf\u3002\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528\u8fd0\u7b97\u7b26 NOT \u6392\u9664\u7279\u5b9a\u7684\u7aef\u53e3\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"hljs nginx vditor-linenumber\"><span class=\"hljs-attribute\">iftop<\/span> -f '<span class=\"hljs-string\">not port 22'<\/span>\r\n<\/code><\/pre>\n<p>iftop -f 'not port 22' \u547d\u4ee4\u5c06\u663e\u793a\u9664 SSH\uff08\u7aef\u53e3\u53f722\uff09\u4e4b\u5916\u7684\u6240\u6709\u6d41\u91cf\u3002<\/p>\n<h2>\u57fa\u4e8e IP \u5730\u5740\u548c\u7aef\u53e3\u7684\u8fc7\u6ee4\u5668<\/h2>\n<p>\u60a8\u8fd8\u53ef\u4ee5\u7ed3\u5408 IP \u5730\u5740\u548c\u7aef\u53e3\u6765\u8fc7\u6ee4\u7f51\u7edc\u6d41\u91cf\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"hljs nginx vditor-linenumber\"><span class=\"hljs-attribute\">iftop<\/span> -f <span class=\"hljs-string\">\"src host 192.168.1.100 and dst port 80\"<\/span>\r\n<\/code><\/pre>\n<p>iftop -f 'src host 192.168.1.100 and dst port 80' \u547d\u4ee4\u4ec5\u663e\u793a\u6765\u81ea IP \u5730\u5740 192.168.1.100 \u5e76\u4e14\u76ee\u6807\u7aef\u53e3\u4e3a 80 \u7684\u6d41\u91cf\u3002<\/p>\n<p>iftop -f\u7684\u4f7f\u7528\u53ef\u4ee5\u53c2\u8003bpg\u9ad8\u7ea7\u8bed\u6cd5<\/p>\n<h2>\u7ed3\u8bba<\/h2>\n<p>iftop \u547d\u4ee4\u662f\u4e00\u6b3e\u5f3a\u5927\u7684\u7f51\u7edc\u6d41\u91cf\u76d1\u63a7\u5de5\u5177\uff0c\u53ef\u4ee5\u5b9e\u65f6\u76d1\u63a7\u7f51\u7edc\u8fde\u63a5\u548c\u6d41\u91cf\uff0c\u5e2e\u52a9\u7ba1\u7406\u5458\u53ca\u65f6\u53d1\u73b0\u548c\u89e3\u51b3\u7f51\u7edc\u95ee\u9898\u3002<\/p>\n<p>\u540c\u65f6\uff0ciftop \u547d\u4ee4\u4e5f\u652f\u6301\u591a\u79cd\u8fc7\u6ee4\u5668\u548c\u4ea4\u4e92\u5f0f\u64cd\u4f5c\uff0c\u4f7f\u5176\u66f4\u52a0\u7075\u6d3b\u548c\u6613\u7528\u3002\u5728\u4f7f\u7528iftop\u547d\u4ee4\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u5b89\u5168\u548c\u8d44\u6e90\u6d88\u8017\u7b49\u95ee\u9898\uff0c\u5e76\u6839\u636e\u9700\u8981\u9009\u62e9\u6700\u9002\u5408\u7684\u5de5\u5177\u8fdb\u884c\u7f51\u7edc\u6d41\u91cf\u76d1\u63a7\u3002<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/article>\n","protected":false},"excerpt":{"rendered":"<p>iftop \u7528\u4e8e\u5728\u6307\u5b9a\u7684\u63a5\u53e3\u76d1\u63a7\u7f51\u7edc\u6d41\u91cf\uff0c\u5982\u679c\u6ca1\u6709\u6307\u5b9a\u63a5\u53e3(\u7f51\u5361)\uff0c\u5b83\u53ef\u4ee5\u5728\u7b2c\u4e00\u4e2a\u63a5\u53e3\uff0c\u6216\u8005\u641c\u7d22\u4e00\u4e2a\u770b\u8d77\u6765\u662f\u8fde\u63a5\u5916\u90e8\u7684\u63a5\u53e3\u3002\u7136\u540e\u6309\u4e3b\u673a\u6d3b\u52a8\u8fde\u63a5\u663e\u793a\u5f53\u524d\u5e26\u5bbd\u3002 \u8981\u4f7f\u7528 iftop \u547d\u4ee4\u76d1\u63a7\u7f51\u7edc\u63a5\u53e3\u7684\u6d41\u91cf\uff0c\u4f60\u5fc5\u987b\u4ee5 root \u6216\u8005\u5177\u6709 sudo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"topic":[37],"class_list":["post-349","post","type-post","status-publish","format-standard","hentry","category-linux","topic-linux"],"_links":{"self":[{"href":"https:\/\/idc.birk.cn\/index.php?rest_route=\/wp\/v2\/posts\/349","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.birk.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.birk.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.birk.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.birk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=349"}],"version-history":[{"count":5,"href":"https:\/\/idc.birk.cn\/index.php?rest_route=\/wp\/v2\/posts\/349\/revisions"}],"predecessor-version":[{"id":368,"href":"https:\/\/idc.birk.cn\/index.php?rest_route=\/wp\/v2\/posts\/349\/revisions\/368"}],"wp:attachment":[{"href":"https:\/\/idc.birk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.birk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.birk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=349"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/idc.birk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftopic&post=349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}