{"id":79,"date":"2024-04-21T16:47:52","date_gmt":"2024-04-21T07:47:52","guid":{"rendered":"http:\/\/park1v.mooo.com\/?p=79"},"modified":"2024-04-24T22:23:29","modified_gmt":"2024-04-24T13:23:29","slug":"linux-netstat","status":"publish","type":"post","link":"https:\/\/park1v.mooo.com\/index.php\/2024\/04\/21\/linux-netstat\/","title":{"rendered":"LINUX netstat"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">netstat \uba85\ub839\uc5b4\ub294 \ub124\ud2b8\uc6cc\ud06c \uc5f0\uacb0 \uc0c1\ud0dc, \ub77c\uc6b0\ud305 \ud14c\uc774\ube14, \uc778\ud130\ud398\uc774\uc2a4 \uc0c1\ud0dc \ub4f1\uc744 \ubcf4\uc5ec\uc8fc\ub294 \uba85\ub839\uc5b4\uc785\ub2c8\ub2e4.\u00a0<br>&#8220;Active Internet connections&#8221;(\uc778\ud130\ub137 \uc5f0\uacb0\uc0c1\ud0dc) \ubd80\ubd84\uacfc &#8220;Active UNIX domain sockets&#8221;(\ub3c4\uba54\uc778 \uc18c\ucf13 \uc5f0\uacb0 \uc0c1\ud0dc)\uc73c\ub85c \ub098\ub258\uc5b4\uc838\uc11c \ud45c\uc2dc\ub418\uba70<br>netstat -na \uc635\uc158\uc744 \uc785\ub825\ud560 \uacbd\uc6b0, \ud604\uc7ac \uc2dc\uc2a4\ud15c\uc758 \ubaa8\ub4e0 \ub124\ud2b8\uc6cc\ud06c \uc5f0\uacb0 \ubaa9\ub85d\uc744 \ud45c\uc2dc\ud574 \uc90d\ub2c8\ub2e4.<\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#d6eeee\"><strong>\uc8fc\uc694 \uc635\uc158<br><\/strong>-n : \ud638\uc2a4\ud2b8\uba85, \ud3ec\ud2b8\uba85\uc744 lookup\ud558\uc9c0 \uc54a\uace0 \uadf8\ub300\ub85c IP, Port\ubc88\ud638\ub85c \ubcf4\uc5ec\uc900\ub2e4.<br>-a : \ubaa8\ub4e0 \ub124\ud2b8\uc6cd \uc0c1\ud0dc\ub97c \ubcf4\uc5ec\uc900\ub2e4.<br>-l : LINTEN \uc0c1\ud0dc\uc778 \uc11c\ube44\uc2a4 \ud3ec\ud2b8\ub97c \ubcf4\uc5ec\uc900\ub2e4.<br>-t : TCP \ud504\ub85c\ud1a0\ucf5c\ub9cc \ubcf4\uc5ec\uc900\ub2e4.<br>-u : UDP \ud504\ub85c\ud1a0\ucf5c\ub9cc \ubcf4\uc5ec\uc900\ub2e4.<br>-p : \ud574\ub2f9 \ud3ec\ud2b8\ub97c \uc0ac\uc6a9\ud558\ub294 \ud504\ub85c\uadf8\ub7a8\uacfc \ud504\ub85c\uc138\uc2a4ID(PID)\ub97c \ubcf4\uc5ec\uc900\ub2e4.<br>-r : \ub77c\uc6b0\ud305 \ud14c\uc774\ube14 \ucd9c\ub825<br>-s : \ud504\ub85c\ud1a0\ucf5c\ubcc4(IP, ICMP, TCP, UDP \ub4f1)\ub85c \ud1b5\uacc4\ub97c \ubcf4\uc5ec\uc900\ub2e4<br>-c : 1\ucd08 \ub2e8\uc704\ub85c \uacb0\uacfc\uac12\uc744 \uc5f0\uc18d\uc801\uc73c\ub85c \ubcf4\uc5ec\uc900\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"box-sizing: border-box; font-weight: bolder; color: rgb(6, 54, 60); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space-collapse: collapse;\">Active Internet connections \ud56d\ubaa9<\/span><span style=\"color: rgb(6, 54, 60); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space-collapse: collapse; background-color: rgb(222, 241, 244);\">\u00a0\u00a0 &#8211; \ud504\ub85c\ud1a0\ucf5c, \uc218\uc2e0\ud050\uc640 \uc1a1\uc2e0\ud050 \uadf8\ub9ac\uace0 \uac01\uac01\uc758 IP, Port \uc815\ubcf4\ub97c \ud45c\uc2dc\ud55c\ub2e4.<\/span><span style=\"color: rgb(6, 54, 60); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space-collapse: collapse; background-color: rgb(222, 241, 244);\">\u00a0\u00a0 &#8211; TCP\uc758 \uacbd\uc6b0 State \uc815\ubcf4\ub3c4 \ud45c\uc2dc\ub418\uac8c \ub41c\ub2e4.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"box-sizing: border-box; font-weight: bolder; color: rgb(6, 54, 60); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space-collapse: collapse;\">Active Internet connections \ud56d\ubaa9\uc758 TCP state<\/span><\/p>\n\n\n\n<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-36d0a666 wp-block-group-is-layout-flex\">\n<p class=\"wp-block-paragraph\"><span style=\"color: rgb(6, 54, 60); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space-collapse: collapse; background-color: rgb(222, 241, 244);\">LISTEN : \uc11c\ubc84\uc758 \ub370\ubaac\uc774 \ub5a0\uc11c \uc811\uc18d \uc694\uccad\uc744 \uae30\ub2e4\ub9ac\ub294 \uc0c1\ud0dc<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"color: rgb(6, 54, 60); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space-collapse: collapse; background-color: rgb(222, 241, 244);\">SYS-SENT : \ub85c\uceec\uc758 \ud074\ub77c\uc774\uc5b8\ud2b8 \uc5b4\ud50c\ub9ac\ucf00\uc774\uc158\uc774 \uc6d0\uaca9 \ud638\uc2a4\ud2b8\uc5d0 \uc5f0\uacb0\uc744 \uc694\uccad\ud55c \uc0c1\ud0dc<\/span><span style=\"color: rgb(6, 54, 60); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space-collapse: collapse; background-color: rgb(222, 241, 244);\">\u00a0\u00a0 SYN_RECEIVED : \uc11c\ubc84\uac00 \uc6d0\uaca9 \ud074\ub77c\uc774\uc5b8\ud2b8\ub85c\ubd80\ud130 \uc811\uc18d \uc694\uad6c\ub97c \ubc1b\uc544 \ud074\ub77c\uc774\uc5b8\ud2b8\uc5d0\uac8c \uc751\ub2f5\uc744 \ud558\uc600\uc9c0\ub9cc<\/span><span style=\"color: rgb(6, 54, 60); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space-collapse: collapse; background-color: rgb(222, 241, 244);\">\u00a0\uc544\uc9c1 \ud074\ub77c\uc774\uc5b8\ud2b8\uc5d0\uac8c \ud655\uc778 \uba54\uc2dc\uc9c0\ub294 \ubc1b\uc9c0 \uc54a\uc740 \uc0c1\ud0dc<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"color: rgb(6, 54, 60); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space-collapse: collapse; background-color: rgb(222, 241, 244);\">ESTABLISHED : 3 Way-Handshaking \uc774 \uc644\ub8cc\ub41c \ud6c4 \uc11c\ub85c \uc5f0\uacb0\ub41c \uc0c1\ud0dc<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"color: rgb(6, 54, 60); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space-collapse: collapse; background-color: rgb(222, 241, 244);\">FIN-WAIT1,2\u00a0 \u00a0 \u00a0 \u00a0: \uc11c\ubc84\uc5d0\uc11c \uc5f0\uacb0\uc744 \uc885\ub8cc\ud558\uae30 \uc704\ud574 \ud074\ub77c\uc774\uc5b8\ud2b8\uc5d0\uac8c \uc885\uacb0\uc744<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"color: rgb(6, 54, 60); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space-collapse: collapse; background-color: rgb(222, 241, 244);\">CLOSE-WAIT\u00a0 \u00a0 \u00a0 \u00a0 \uc694\uccad\ud558\uace0 \ud68c\uc2e0\uc744 \ubc1b\uc544 \uc885\ub8cc\ud558\ub294 \uacfc\uc815\uc758 \uc0c1\ud0dc<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"color: rgb(6, 54, 60); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space-collapse: collapse; background-color: rgb(222, 241, 244);\">CLOSING : \ud754\ud558\uc9c0 \uc54a\uc9c0\ub9cc \uc8fc\ub85c \ud655\uc778 \uba54\uc2dc\uc9c0\uac00 \uc804\uc1a1\ub3c4\uc911 \ubd84\uc2e4\ub41c \uc0c1\ud0dc<\/span><span style=\"color: rgb(6, 54, 60); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space-collapse: collapse; background-color: rgb(222, 241, 244);\">\u00a0\u00a0<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"color: rgb(6, 54, 60); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space-collapse: collapse; background-color: rgb(222, 241, 244);\"> TIME-WAIT\u00a0 \u00a0 \u00a0 \u00a0 \u00a0: \uc5f0\uacb0\uc740 \uc885\ub8cc\ub418\uc5c8\uc9c0\ub9cc \ubd84\uc2e4\ub418\uc5c8\uc744\uc9c0 \ubaa8\ub97c \ub290\ub9b0 \uc138\uadf8\uba3c\ud2b8\ub97c \uc704\ud574 \ub2f9\ubd84\uac04 \uc18c\ucf13\uc744 \uc5f4\uc5b4\ub450\uace0 \uc788\ub294 \uc0c1\ud0dc<\/span><span style=\"color: rgb(6, 54, 60); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space-collapse: collapse; background-color: rgb(222, 241, 244);\">\u00a0\u00a0 <\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"color: rgb(6, 54, 60); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space-collapse: collapse; background-color: rgb(222, 241, 244);\">CLOSED\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 : \uc644\uc804\ud788 \uc885\ub8cc<\/span><\/p>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Active UNIX domain sockets \ud56d\ubaa9<\/strong><br>&nbsp;&nbsp; &#8211; \ud504\ub85c\ud1a0\ucf5c\uc774 unix\ub85c \ud45c\uc2dc\ub418\uba70, RefCnt\ub85c \ud574\ub2f9 \uc18c\ucf13\uc744 \ud504\ub85c\uc138\uc2a4\uac00 \ucc38\uc870\ud55c \ud69f\uc218\ub97c \ud45c\uc2dc\ud55c\ub2e4.<br>&nbsp;&nbsp; &#8211; Flags\ub294 \uc77c\ubc18\uc801\uc73c\ub85c ACC\uc0c1\ud0dc\ub85c \ud45c\uc2dc\ub418\ub294\ub370 ACC\ub294 \uc18c\ucf13\uc774 \uc5f0\uacb0\uc774 \ub418\uc5b4 \uc788\uc9c0 \uc54a\ub294 \uc0c1\ud0dc\ub97c \ub098\ud0c0\ub0b4\uba70, \uc18c\ucf13\uc774 \uc5f0\uacb0\uc774 \ub418\uc5b4 \uc788\ub294 \uacbd\uc6b0 \uacf5\ubc31\uc73c\ub85c \ud45c\uc2dc\ub41c\ub2e4.<br>&nbsp;&nbsp; &#8211; Type\uc740 \ubcf4\ud1b5 \u201cDGRAM(Datagram)\u201d\uacfc \u201cSTREAM\u201d\uc73c\ub85c \ud45c\uc2dc\ub41c\ub2e4.<br>&nbsp;&nbsp; &#8211; State\uc640 I-node, \uc18c\ucf13 \ud30c\uc77c\uc758 \uc808\ub300 \uacbd\ub85c\ub97c \ud45c\uc2dc\ud574 \uc900\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>&nbsp;Active UNIX domain sockets \ud56d\ubaa9\uc758 \ub3c4\uba54\uc778\uc18c\ucf13 \uc5f0\uacb0 \uc0c1\ud0dc<\/strong><br>&nbsp;&nbsp; FREE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : \uc18c\ucf13\uc774 \ud560\ub2f9\ub418\uc9c0 \uc54a\uc558\uc74c<br>&nbsp;&nbsp; LISTENING&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : \uc18c\ucf13\uc774 \uc5f0\uacb0 \uc694\uccad\uc744 \uae30\ub2e4\ub9ac\ub294 \uc911<br>&nbsp;&nbsp; CONNECTING&nbsp; &nbsp; &nbsp; &nbsp;: \uc18c\ucf13 \uc5f0\uacb0\uc774 \ud65c\uc131\ud654\ub418\uc5b4 \uc9d0&nbsp;<br>&nbsp;&nbsp; CONNECTED&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: \uc18c\ucf13\uc774 \uc5f0\uacb0\ub418\uc5b4 \uc788\uc74c<br>&nbsp;&nbsp; DISCONNECTING&nbsp; : \uc18c\ucf13 \uc5f0\uacb0\uc774 \uc885\ub8cc\ub428&nbsp;<br>&nbsp;&nbsp; \uacf5\ubc31&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: \uc18c\ucf13\uc774 \uc5b4\ub5a0\ud55c \ud504\ub85c\uc138\uc2a4\uc640\ub3c4 \uc5f0\uacb0\ub418\uc5b4 \uc788\uc9c0 \uc54a\uc74c<br>&nbsp;&nbsp; UNKNOWN&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: \uc774 \uc0c1\ud0dc\ub294 \ubc1c\uc0dd\ud558\uc9c0 \uc54a\ub294\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u00a0\uc720\uc6a9\ud55c netstat \uc0ac\uc6a9\uc608<\/strong><br>\u00a0\u00a0 netstat -na &#8211;ip\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 : tcp\/udp\uc758 \uc138\uc158 \ubaa9\ub85d \ud45c\uc2dc<br>\u00a0\u00a0 netstat -na | grep ESTABLISHED | wc -l\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0: \ud65c\uc131\ud654\ub41c \uc138\uc158\uc218 \ud655\uc778<br>\u00a0\u00a0 netstat -nap | grep :80 | grep ESTABLISHED | wc -l\u00a0 \u00a0: 80\ud3ec\ud2b8 \ub3d9\uc2dc \uc811\uc18d\uc790\uc218<br>\u00a0\u00a0 netstat -nltp\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 : LISTEN \uc911\uc778 \ud3ec\ud2b8 \uc815\ubcf4 \ud45c\uc2dc<br>\u00a0\u00a0 netstat -r\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0: \uc11c\ubc84\uc758 \ub77c\uc6b0\ud305 \ud14c\uc774\ube14 \ucd9c\ub825<\/p>\n","protected":false},"excerpt":{"rendered":"<p>netstat \uba85\ub839\uc5b4\ub294 \ub124\ud2b8\uc6cc\ud06c \uc5f0\uacb0 \uc0c1\ud0dc, \ub77c\uc6b0\ud305 \ud14c\uc774\ube14, \uc778\ud130\ud398\uc774\uc2a4 \uc0c1\ud0dc \ub4f1\uc744 \ubcf4\uc5ec\uc8fc\ub294 \uba85\ub839\uc5b4\uc785\ub2c8\ub2e4.\u00a0&#8220;Active Internet connections&#8221;(\uc778\ud130\ub137 \uc5f0\uacb0\uc0c1\ud0dc) \ubd80\ubd84\uacfc &#8220;Active UNIX domain sockets&#8221;(\ub3c4\uba54\uc778 \uc18c\ucf13 \uc5f0\uacb0 \uc0c1\ud0dc)\uc73c\ub85c \ub098\ub258\uc5b4\uc838\uc11c \ud45c\uc2dc\ub418\uba70netstat -na \uc635\uc158\uc744 \uc785\ub825\ud560 \uacbd\uc6b0, \ud604\uc7ac \uc2dc\uc2a4\ud15c\uc758 \ubaa8\ub4e0 \ub124\ud2b8\uc6cc\ud06c \uc5f0\uacb0 \ubaa9\ub85d\uc744 \ud45c\uc2dc\ud574 \uc90d\ub2c8\ub2e4. \uc8fc\uc694 \uc635\uc158-n : \ud638\uc2a4\ud2b8\uba85, \ud3ec\ud2b8\uba85\uc744 lookup\ud558\uc9c0 \uc54a\uace0 \uadf8\ub300\ub85c IP, Port\ubc88\ud638\ub85c \ubcf4\uc5ec\uc900\ub2e4.-a : \ubaa8\ub4e0 \ub124\ud2b8\uc6cd \uc0c1\ud0dc\ub97c \ubcf4\uc5ec\uc900\ub2e4.-l : LINTEN [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-79","post","type-post","status-publish","format-standard","hentry","category-all-articles"],"_links":{"self":[{"href":"https:\/\/park1v.mooo.com\/index.php\/wp-json\/wp\/v2\/posts\/79","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/park1v.mooo.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/park1v.mooo.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/park1v.mooo.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/park1v.mooo.com\/index.php\/wp-json\/wp\/v2\/comments?post=79"}],"version-history":[{"count":3,"href":"https:\/\/park1v.mooo.com\/index.php\/wp-json\/wp\/v2\/posts\/79\/revisions"}],"predecessor-version":[{"id":83,"href":"https:\/\/park1v.mooo.com\/index.php\/wp-json\/wp\/v2\/posts\/79\/revisions\/83"}],"wp:attachment":[{"href":"https:\/\/park1v.mooo.com\/index.php\/wp-json\/wp\/v2\/media?parent=79"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/park1v.mooo.com\/index.php\/wp-json\/wp\/v2\/categories?post=79"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/park1v.mooo.com\/index.php\/wp-json\/wp\/v2\/tags?post=79"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}