4
6

More than 3 years have passed since last update.

Windows PCから疎通確認

Posted at

Windows PCから疎通確認

Windows PCからAWSのインスタンスの接続確認したかったので探してみたら、
PowerShellで良さげなコマンドを発見したので。今後も使いそうなのでメモ。

Test-NetConnectionコマンド

Test-NetConnection IPAddress [-Traceroute] [-Port ] [-InformationLevel <"Detailed"|"Quiet">]

-Tracerouteオプション

宛先までの経路を確認する。
TraceRoute に経路情報が表示される。

PS C:\Users\xxxxxx> Test-NetConnection 10.194.8.234 -traceroute


ComputerName           : 10.194.8.234
RemoteAddress          : 10.194.8.234
InterfaceAlias         : Wi-Fi
SourceAddress          : 192.168.2.134
PingSucceeded          : True
PingReplyDetails (RTT) : 18 ms
TraceRoute             : 192.168.2.1
                         10.194.8.234

-Portオプション

指定したポート番号へ接続できるかを確認する。
TcpTestSucceeded に確認結果が表示される。

PS C:\Users\xxxxxx> Test-NetConnection 10.194.8.234 -Port 80

ComputerName     : 10.194.8.234
RemoteAddress    : 10.194.8.234
RemotePort       : 80
InterfaceAlias   : Wi-Fi
SourceAddress    : 192.168.2.134
TcpTestSucceeded : True

-InformationLevelオプション

結果の出力レベルを指定する。

詳細結果を表示

PS C:\Users\xxxxxx> Test-NetConnection 10.194.8.234 -Port 80 -InformationLevel Detailed


ComputerName            : 10.194.8.234
RemoteAddress           : 10.194.8.234
RemotePort              : 80
NameResolutionResults   : 10.194.8.234
MatchingIPsecRules      :
NetworkIsolationContext : Internet
IsAdmin                 : False
InterfaceAlias          : Wi-Fi
SourceAddress           : 192.168.2.134
NetRoute (NextHop)      : 192.168.2.1
TcpTestSucceeded        : True

ポートの接続可否のみ表示

PS C:\Users\xxxxxx> Test-NetConnection 10.194.8.234 -Port 80 -InformationLevel Quiet
True

参考元

4
6
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
4
6