前書き
記事内では個人的な都合で
転送元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
これで別端末からでもアクセスできるようになるはず。