0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

windowsでポート開放する手順

Posted at

powershellをひらく

開放したいポート番号(今回は3000)が使用しているものを表示

netstat -ano | findstr :3000

実行結果(値を記事用に加工してます)

TCP         0.0.0.0:3000           0.0.0.0:0              LISTENING       12345
TCP         [::]:3000              [::]:0                 LISTENING       12345
TCP         [::1]:3000             [::1]:54321            ESTABLISHED     12345
TCP         [::1]:3000             [::1]:56789            TIME_WAIT       0
TCP         [::1]:54321            [::1]:3000             ESTABLISHED     67890

LISTENING状態で使用しているプロセスが該当
※LISTENING状態はアプリケーションがそのポートで接続を受け付けている状態を意味するらしい

TCP         0.0.0.0:3000           0.0.0.0:0              LISTENING       12345
TCP         [::]:3000              [::]:0                 LISTENING       12345

12345が何のアプリケーションで使用しているか確認

tasklist /FI "PID eq 12345"

実行結果

イメージ名                     PID セッション名     セッション# メモリ使用量
========================= ======== ================ =========== ============
node.exe                     12345 Console                    2     21,576 K

問題なければプロセスを停止

taskkill /PID 12345 /F

ポート3000が開放されたことを確認する
LISTENINGのプロセスが表示されなかったらOK

netstat -ano | findstr :3000
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?