注:この質問は、同じシナリオを提示する一連の質問の一部です。シリーズの各質問には、述べられた目標を達成する可能性のある独自の解決策が含まれています。一部の質問セットには複数の正しい解決策がある場合がありますが、他の質問セットには正しい解決策がない場合があります。
このセクションの質問に回答した後は、その質問に戻ることはできません。その結果、これらの質問はレビュー画面に表示されません。
次のリソースを含むAzureサブスクリプションがあります。
* Subnet1という名前のサブネットを持つ仮想ネットワーク
* NSG-VM1およびNSG-Subnet1という名前の2つのネットワークセキュリティグループ(NSG)
*リモートデスクトップ接続を許可するために必要なWindowsServer構成を持つVM1という名前の仮想マシンNSG-Subnet1には、デフォルトのインバウンドセキュリティルールのみがあります。
NSG-VM1には、デフォルトのインバウンドセキュリティルールと次のカスタムインバウンドセキュリティルールがあります。
*優先度:100
*出典:任意
*送信元ポート範囲:*
*目的地:*
*宛先ポート範囲:3389
*プロトコル:UDP
*アクション:許可
VM1はSubnet1に接続します。 NSG1-VM1は、VM1のネットワークインターフェイスに関連付けられています。
NSG-Subnet1はSubnet1に関連付けられています。
インターネットからVM1へのリモートデスクトップ接続を確立できる必要があります。
解決策:NSG-VM1のカスタムルールを変更して、インターネットをソースとして使用し、TCPをプロトコルとして使用します。
これは目標を達成していますか?
正解:B
NSGs deny all inbound traffic except from virtual network or load balancers. For inbound traffic, Azure processes the rules in a network security group associated to a subnet first, and then the rules in a network security group associated to the network interface.
By default NSG rule to allow traffic through RDP port 3389 is not created automatically during the creation of VM , unless you change the setting during creation. Subnets usually do not have any NSG associated unless you go out of the way to do so, which this scenario does. when you create that extra NSG, it won't have an RDP rule by default, thus blocking inbound connections.
Request first goes to NSG -subnet1 and as there is no allow rule for RDP so it will block the request by default.Since the Subnet NSG (the one with the default rules) is evaluated first, it blocks the inbound RDP connection.
Reference:
https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/troubleshoot-rdp-connection
https://docs.microsoft.com/en-us/azure/virtual-network/security-overview#default-security-rules