sockstat.md 1.2 KB

sockstat

์˜คํ”ˆ๋œ ์ธํ„ฐ๋„ท ๋˜๋Š” UNIX ๋„๋ฉ”์ธ ์†Œ์ผ“์„ ๋‚˜์—ดํ•ฉ๋‹ˆ๋‹ค. ๋” ๋งŽ์€ ์ •๋ณด: https://man.freebsd.org/cgi/man.cgi?sockstat.

  • ์–ด๋–ค ์‚ฌ์šฉ์ž/ํ”„๋กœ์„ธ์Šค๊ฐ€ ์–ด๋–ค ํฌํŠธ์—์„œ [l]isteningํ•˜๋Š”์ง€ ๋ณด๊ธฐ:

sockstat -l

  • ํŠน์ • [p]ort์—์„œ ์‚ฌ์šฉ ์ค‘์ธ IPv[4]/IPv[6] ์†Œ์ผ“ ์ •๋ณด ๋ณด๊ธฐ, ํŠน์ • [P]rotocol ์‚ฌ์šฉ:

sockstat -{{4|6}} -l -P {{tcp|udp|sctp|divert}} -p {{port1,port2...}}

  • [c]onnected ์†Œ์ผ“๋„ ํ‘œ์‹œ, ์ˆซ์žํ˜•์‹์˜ UID๋ฅผ ์‚ฌ์šฉ์ž ์ด๋ฆ„์œผ๋กœ ํ•ด์„ํ•˜์ง€ ์•Š๊ณ  [w]ider ํ•„๋“œ ํฌ๊ธฐ ์‚ฌ์šฉ:

sockstat -cnw

  • ํŠน์ • [j]ail ID ๋˜๋Š” ์ด๋ฆ„์— ์†ํ•˜๋Š” ์†Œ์ผ“๋งŒ [v]erbose ๋ชจ๋“œ๋กœ ํ‘œ์‹œ:

sockstat -jv

  • ํ”„๋กœํ† ์ฝœ [s]tate ๋ฐ ์›๊ฒฉ [U]DP ์บก์Šํ™” ํฌํŠธ ๋ฒˆํ˜ธ ํ‘œ์‹œ (ํ˜„์žฌ SCTP ๋ฐ TCP์—๋งŒ ๊ตฌํ˜„๋จ):

sockstat -sU

  • [C]ongestion control ๋ชจ๋“ˆ ๋ฐ ํ”„๋กœํ† ์ฝœ [S]tack ํ‘œ์‹œ (ํ˜„์žฌ TCP์—๋งŒ ๊ตฌํ˜„๋จ):

sockstat -CS

  • ๋กœ์ปฌ ๋ฐ ์™ธ๋ถ€ ์ฃผ์†Œ๊ฐ€ ๋ฃจํ”„๋ฐฑ ๋„คํŠธ์›Œํฌ ์ ‘๋‘์–ด 127.0.0.0/8์ด ์•„๋‹ˆ๊ฑฐ๋‚˜ IPv6 ๋ฃจํ”„๋ฐฑ ์ฃผ์†Œ ::1์„ ํฌํ•จํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ์—๋งŒ ์ธํ„ฐ๋„ท ์†Œ์ผ“ ํ‘œ์‹œ:

sockstat -L

  • ํ—ค๋”๋ฅผ ํ‘œ์‹œํ•˜์ง€ ์•Š์Œ ([q]uiet ๋ชจ๋“œ), [u]nix ์†Œ์ผ“ ํ‘œ์‹œํ•˜๊ณ  inp_gencnt ํ‘œ์‹œ:

sockstat -qui