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?

同一LANの別端末からWLS2内のサーバーにアクセスしたい

Last updated at Posted at 2025-10-16

前書き

記事内では個人的な都合で
転送元IPを0.0.0.0
転送元ポートを8080
としている。

また、以下のコマンドはPowerShellを管理者実行で入力している。

1

localhost → WSLへの転送
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=8080 connectaddress=WLS側のIP connectport=WLS側のポート
確認
netsh interface portproxy show all
削除(いらなくなったら)
netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=8080

2

Windowsのファイアウォールのポートを開ける
netsh advfirewall firewall add rule name=PortProxy8080 dir=in action=allow protocol=TCP localport=8080
確認
netsh advfirewall firewall show rule name=PortProxy8080
削除(いらなくなったら)
netsh advfirewall firewall delete rule name=PortProxy8080

3

これで別端末からでもアクセスできるようになるはず。

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?