{"id":61813,"date":"2025-04-29T11:53:24","date_gmt":"2025-04-29T03:53:24","guid":{"rendered":"https:\/\/fwq.ai\/blog\/61813\/"},"modified":"2025-04-29T11:53:24","modified_gmt":"2025-04-29T03:53:24","slug":"linux%e6%80%8e%e4%b9%88%e6%a3%80%e6%b5%8b%e6%b5%81%e9%87%8f%e6%9d%a5%e8%87%aa%e5%93%aa%e9%87%8c-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/61813\/","title":{"rendered":"linux\u600e\u4e48\u68c0\u6d4b\u6d41\u91cf\u6765\u81ea\u54ea\u91cc"},"content":{"rendered":"<blockquote><p>\n  linux\u68c0\u6d4b\u6d41\u91cf\u7684\u6765\u6e90\u7684\u65b9\u6cd5\u6709\uff1a1\u3001iftop\uff0c\u5b9e\u65f6\u6d41\u91cf\u76d1\u6d4b\u5de5\u5177\uff0c\u53ef\u7528\u4e8e\u67e5\u770b\u7279\u5b9a\u7f51\u7edc\u63a5\u53e3\u7684\u6d41\u91cf\u6765\u6e90\u548c\u76ee\u7684\u5730\uff1b2\u3001nethogs\uff0c\u4e00\u4e2a\u4ee5\u8fdb\u7a0b\u4e3a\u5355\u4f4d\u663e\u793a\u7f51\u7edc\u6d41\u91cf\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u544a\u8bc9\u54ea\u4e9b\u8fdb\u7a0b\u6b63\u5728\u4f7f\u7528\u7f51\u7edc\u4ee5\u53ca\u5b83\u4eec\u7684\u6d41\u91cf\u6765\u6e90\uff1b3\u3001tcpdump\uff0c\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u7f51\u7edc\u6570\u636e\u5305\u6355\u83b7\u5de5\u5177\uff0c\u53ef\u4ee5\u5c06\u6355\u83b7\u5230\u7684\u7f51\u7edc\u6570\u636e\u5305\u4fdd\u5b58\u5230\u6587\u4ef6\uff0c\u5e76\u63d0\u4f9b\u591a\u79cd\u8fc7\u6ee4\u9009\u9879\u6765\u5206\u6790\u6d41\u91cf\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202307\/13\/2023071315140444209.jpg\" class=\"aligncenter\" title=\"linux\u600e\u4e48\u68c0\u6d4b\u6d41\u91cf\u6765\u81ea\u54ea\u91cc\u63d2\u56fe\" alt=\"linux\u600e\u4e48\u68c0\u6d4b\u6d41\u91cf\u6765\u81ea\u54ea\u91cc\u63d2\u56fe\" \/><\/p>\n<p>\u672c\u6559\u7a0b\u64cd\u4f5c\u7cfb\u7edf\uff1aLinux5.18.14\u7cfb\u7edf\u3001Dell G3\u7535\u8111\u3002<\/p>\n<p>\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u5de5\u5177\u6765\u68c0\u6d4b\u7f51\u7edc\u6d41\u91cf\u7684\u6765\u6e90\u3002\u4e0b\u9762\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u5de5\u5177\u548c\u76f8\u5e94\u7684\u64cd\u4f5c\uff1a<\/p>\n<p><strong>1\u3001iftop\uff1a<\/strong><\/p>\n<p>iftop\u662f\u4e00\u4e2a\u5b9e\u65f6\u6d41\u91cf\u76d1\u6d4b\u5de5\u5177\uff0c\u53ef\u7528\u4e8e\u67e5\u770b\u7279\u5b9a\u7f51\u7edc\u63a5\u53e3\u7684\u6d41\u91cf\u6765\u6e90\u548c\u76ee\u7684\u5730\u3002\u5b89\u88c5iftop\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u8fd0\u884c\u5b83\uff1a<\/p>\n<pre>&nbsp;&nbsp;sudo&nbsp;iftop&nbsp;-i&nbsp;&lt;interface&gt;&lt;\/interface&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d\uff0c \u662f\u8981\u76d1\u6d4b\u7684\u7f51\u7edc\u63a5\u53e3\uff0c\u5982eth0\u6216wlan0\u3002 <\/p>\n<p><strong>2\u3001nethogs\uff1a<\/strong><\/p>\n<p>nethogs\u662f\u4e00\u4e2a\u4ee5\u8fdb\u7a0b\u4e3a\u5355\u4f4d\u663e\u793a\u7f51\u7edc\u6d41\u91cf\u7684\u5de5\u5177\u3002\u5b83\u53ef\u4ee5\u544a\u8bc9\u60a8\u54ea\u4e9b\u8fdb\u7a0b\u6b63\u5728\u4f7f\u7528\u7f51\u7edc\u4ee5\u53ca\u5b83\u4eec\u7684\u6d41\u91cf\u6765\u6e90\u3002\u5b89\u88c5nethogs\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u8fd0\u884c\u5b83\uff1a<\/p>\n<pre>&nbsp;sudo&nbsp;nethogs&nbsp;&lt;interface&gt;&lt;\/interface&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p> \u662f\u8981\u76d1\u6d4b\u7684\u7f51\u7edc\u63a5\u53e3\uff0c\u5982eth0\u6216wlan0\u3002 <\/p>\n<p><strong>3\u3001tcpdump\uff1a<\/strong><\/p>\n<p>tcpdump\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u7f51\u7edc\u6570\u636e\u5305\u6355\u83b7\u5de5\u5177\u3002\u5b83\u53ef\u4ee5\u5c06\u6355\u83b7\u5230\u7684\u7f51\u7edc\u6570\u636e\u5305\u4fdd\u5b58\u5230\u6587\u4ef6\uff0c\u5e76\u63d0\u4f9b\u591a\u79cd\u8fc7\u6ee4\u9009\u9879\u6765\u5206\u6790\u6d41\u91cf\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\u547d\u4ee4\uff1a<\/p>\n<pre>&nbsp;&nbsp;sudo&nbsp;tcpdump&nbsp;-i&nbsp;&lt;interface&gt;&nbsp;-n&lt;\/interface&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p> \u662f\u8981\u76d1\u6d4b\u7684\u7f51\u7edc\u63a5\u53e3\uff0c\u5982eth0\u6216wlan0\u3002\u4f7f\u7528-n\u9009\u9879\u53ef\u4ee5\u663e\u793aIP\u5730\u5740\u800c\u4e0d\u8fdb\u884c\u9006\u5411DNS\u89e3\u6790\u3002 <\/p>\n<p>\u8fd9\u4e9b\u5de5\u5177\u90fd\u9700\u8981\u4ee5root\u6216sudo\u6743\u9650\u6765\u8fd0\u884c\uff0c\u4ee5\u4fbf\u8bbf\u95ee\u7f51\u7edc\u63a5\u53e3\u548c\u6355\u83b7\u6570\u636e\u5305\u3002\u8bf7\u6ce8\u610f\uff0c\u6b63\u786e\u4f7f\u7528\u8fd9\u4e9b\u5de5\u5177\u9700\u8981\u4e00\u5b9a\u7684\u7f51\u7edc\u77e5\u8bc6\u548c\u7406\u89e3\u3002\u4e3a\u4e86\u66f4\u8be6\u7ec6\u7684\u4f7f\u7528\u8bf4\u660e\uff0c\u8bf7\u53c2\u8003\u76f8\u5e94\u5de5\u5177\u7684\u6587\u6863\u6216\u4f7f\u7528\u5e2e\u52a9\u547d\u4ee4\uff08\u5982man iftop\u3001man nethogs\u548cman tcpdump\uff09\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u68c0\u6d4b\u6d41\u91cf\u6765\u81ea\u54ea\u91cc\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8FDCServers\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>linux\u68c0\u6d4b\u6d41\u91cf\u7684\u6765\u6e90\u7684\u65b9\u6cd5\u6709\uff1a1\u3001iftop\uff0c\u5b9e\u65f6\u6d41\u91cf\u76d1\u6d4b\u5de5\u5177\uff0c\u53ef\u7528\u4e8e\u67e5\u770b\u7279\u5b9a\u7f51\u7edc\u63a5\u53e3\u7684\u6d41\u91cf\u6765\u6e90\u548c\u76ee\u7684\u5730\uff1b2\u3001nethogs\uff0c\u4e00\u4e2a\u4ee5\u8fdb\u7a0b\u4e3a\u5355\u4f4d\u663e\u793a\u7f51\u7edc\u6d41\u91cf\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u544a\u8bc9\u54ea\u4e9b\u8fdb\u7a0b\u6b63\u5728\u4f7f\u7528\u7f51\u7edc\u4ee5\u53ca\u5b83\u4eec\u7684\u6d41\u91cf\u6765\u6e90\uff1b3\u3001tcpdump\uff0c\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u7f51\u7edc\u6570\u636e\u5305\u6355\u83b7\u5de5\u5177\uff0c\u53ef\u4ee5\u5c06\u6355\u83b7\u5230\u7684\u7f51\u7edc\u6570\u636e\u5305\u4fdd\u5b58\u5230\u6587\u4ef6\uff0c\u5e76\u63d0\u4f9b\u591a\u79cd\u8fc7\u6ee4\u9009\u9879\u6765\u5206\u6790\u6d41\u91cf\u3002 \u672c\u6559\u7a0b\u64cd\u4f5c\u7cfb\u7edf\uff1aLinux5.18.14\u7cfb\u7edf\u3001Dell G3\u7535\u8111\u3002 \u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u5de5\u5177\u6765\u68c0\u6d4b\u7f51\u7edc\u6d41\u91cf\u7684\u6765\u6e90\u3002\u4e0b\u9762\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u5de5\u5177\u548c\u76f8\u5e94\u7684\u64cd\u4f5c\uff1a 1\u3001iftop\uff1a iftop\u662f\u4e00\u4e2a\u5b9e\u65f6\u6d41\u91cf\u76d1\u6d4b\u5de5\u5177\uff0c\u53ef\u7528\u4e8e\u67e5\u770b\u7279\u5b9a\u7f51\u7edc\u63a5\u53e3\u7684\u6d41\u91cf\u6765\u6e90\u548c\u76ee\u7684\u5730\u3002\u5b89\u88c5iftop\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u8fd0\u884c\u5b83\uff1a &nbsp;&nbsp;sudo&nbsp;iftop&nbsp;-i&nbsp;&lt;interface&gt;&lt;\/interface&gt; \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d\uff0c \u662f\u8981\u76d1\u6d4b\u7684\u7f51\u7edc\u63a5\u53e3\uff0c\u5982eth0\u6216wlan0\u3002 2\u3001nethogs\uff1a nethogs\u662f\u4e00\u4e2a\u4ee5\u8fdb\u7a0b\u4e3a\u5355\u4f4d\u663e\u793a\u7f51\u7edc\u6d41\u91cf\u7684\u5de5\u5177\u3002\u5b83\u53ef\u4ee5\u544a\u8bc9\u60a8\u54ea\u4e9b\u8fdb\u7a0b\u6b63\u5728\u4f7f\u7528\u7f51\u7edc\u4ee5\u53ca\u5b83\u4eec\u7684\u6d41\u91cf\u6765\u6e90\u3002\u5b89\u88c5nethogs\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u8fd0\u884c\u5b83\uff1a &nbsp;sudo&nbsp;nethogs&nbsp;&lt;interface&gt;&lt;\/interface&gt; \u767b\u5f55\u540e\u590d\u5236 \u662f\u8981\u76d1\u6d4b\u7684\u7f51\u7edc\u63a5\u53e3\uff0c\u5982eth0\u6216wlan0\u3002 3\u3001tcpdump\uff1a tcpdump\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u7f51\u7edc\u6570\u636e\u5305\u6355\u83b7\u5de5\u5177\u3002\u5b83\u53ef\u4ee5\u5c06\u6355\u83b7\u5230\u7684\u7f51\u7edc\u6570\u636e\u5305\u4fdd\u5b58\u5230\u6587\u4ef6\uff0c\u5e76\u63d0\u4f9b\u591a\u79cd\u8fc7\u6ee4\u9009\u9879\u6765\u5206\u6790\u6d41\u91cf\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\u547d\u4ee4\uff1a &nbsp;&nbsp;sudo&nbsp;tcpdump&nbsp;-i&nbsp;&lt;interface&gt;&nbsp;-n&lt;\/interface&gt; \u767b\u5f55\u540e\u590d\u5236 \u662f\u8981\u76d1\u6d4b\u7684\u7f51\u7edc\u63a5\u53e3\uff0c\u5982eth0\u6216wlan0\u3002\u4f7f\u7528-n\u9009\u9879\u53ef\u4ee5\u663e\u793aIP\u5730\u5740\u800c\u4e0d\u8fdb\u884c\u9006\u5411DNS\u89e3\u6790\u3002 \u8fd9\u4e9b\u5de5\u5177\u90fd\u9700\u8981\u4ee5root\u6216sudo\u6743\u9650\u6765\u8fd0\u884c\uff0c\u4ee5\u4fbf\u8bbf\u95ee\u7f51\u7edc\u63a5\u53e3\u548c\u6355\u83b7\u6570\u636e\u5305\u3002\u8bf7\u6ce8\u610f\uff0c\u6b63\u786e\u4f7f\u7528\u8fd9\u4e9b\u5de5\u5177\u9700\u8981\u4e00\u5b9a\u7684\u7f51\u7edc\u77e5\u8bc6\u548c\u7406\u89e3\u3002\u4e3a\u4e86\u66f4\u8be6\u7ec6\u7684\u4f7f\u7528\u8bf4\u660e\uff0c\u8bf7\u53c2\u8003\u76f8\u5e94\u5de5\u5177\u7684\u6587\u6863\u6216\u4f7f\u7528\u5e2e\u52a9\u547d\u4ee4\uff08\u5982man iftop\u3001man nethogs\u548cman tcpdump\uff09\u3002 \u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u68c0\u6d4b\u6d41\u91cf\u6765\u81ea\u54ea\u91cc\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8FDCServers\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-61813","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/61813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=61813"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/61813\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=61813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=61813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=61813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}