0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Test-NetConnectionでAzure VMへの疎通確認

Posted at

検証1:成功パターン

1.Azure VMのNSGのinbound規則でClient IPから3389 port通信を許可します。
(補足:VMのNSGはいつも二つ付いています。NicのNSGとSubnetのNSG。それ両方を穴あけする必要があります。)

2.Test-NetConnectionで疎通確認がTure

PS C:\WINDOWS\system32> Test-NetConnection 20.18.X.X -Port 3389 ComputerName : 20.18.X.X
RemoteAddress : 20.18.X.X
RemotePort : 3389
InterfaceAlias : Wi-Fi
SourceAddress : 192.168.0.3
TcpTestSucceeded : True

3.RDPで接続してみたが、成功です。
image.png

ちなみに、好奇心でこのAzure VMからさらにAzure Application Gateway にTest-NetConnectionで疎通確認してみました。同じAzure内部のリソースで何か違うでしょう。
でも結果は同じです。App GW側のNSGが許可していないので、Azure上のVMでもfalseになります。これは予想された挙動です。
image.png

検証2:失敗パターン

1.Azure VMのNSGのinbound規則でClient IPから3389 port通信の許可規則を削除します。

2.Test-NetConnectionで疎通確認がFalse
PS C:\WINDOWS\system32> Test-NetConnection 20.18.X.X -Port 3389 ComputerName : 20.18.X.X
RemoteAddress : 20.18.X.X
RemotePort : 3389
InterfaceAlias : Wi-Fi
SourceAddress : 192.168.0.3
PingSucceeded : False
PingReplyDetails (RTT) : 0 ms
TcpTestSucceeded : False

3.RDPで接続してみたが、それも失敗です。

発見:
失敗のパターンでNSG許可しない前提ですが、
AppGWの場合は、TcpTestSucceeded : Falseですが、PingSucceeded : Tureですね。
Azure VMの場合は、両方Falseになります。なぜでしょう。

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?