■検証目的:Application Gateway にNSG上で通信を拒否/許可する際、Powershell commandのTest-NetConnectionではその結果を検証できますか。
■検証結果:Test-NetConnectionを用いて、NSG上で通信を拒否/許可することを検証できます。これから通信テスト上でTest-NetConnectionを使ってOKですね。
■検証詳細:
検証①:AppGWのNSG上でMyClientIPからの通信を許可します。
以下の通りです。
1.Client IPからAppGWへのアクセスは成功です。
2.Test-NetConnecitonの結果も予想通り、Tureになります。
Test-NetConnection 20.243.xx.xx -port 80
ComputerName : 20.243.xx.xx
RemoteAddress : 20.243.xx.xx
RemotePort : 80
InterfaceAlias : Wi-Fi
SourceAddress : 192.168.0.3
TcpTestSucceeded : True
検証②:AppGWのNSG上でIPを許可しないです。以下の通りです。
まず、NSG上でわざわざ拒否します。
該当IPからアクセスできないことを確認
Test-NetConnecitonの結果も予想通り、Falseになります。
Test-NetConnection 20.243.xx.xx -port 80
警告: TCP connect to (20.243.xx.xx : 80) failed
ComputerName : 20.243.xx.xx
RemoteAddress : 20.243.xx.xx
RemotePort : 80
InterfaceAlias : Wi-Fi
SourceAddress : 192.168.0.3
PingSucceeded : True
PingReplyDetails (RTT) : 8 ms
TcpTestSucceeded : False