QuestionQ172

VerifiedImplement and manage virtual networking

Scenario

You have an Azure subscription that contains the following resources:

  • A virtual network that has a subnet named Subnet1
  • Two network security groups (NSGs) named NSG-VM1 and NSG-Subnet1
  • A virtual machine named VM1 that has the required Windows Server configurations to allow Remote Desktop connections

NSG-Subnet1 has only the default inbound security rules.

NSG-VM1 has the default inbound security rules and the following custom inbound security rule:

  • Priority: 100
  • Source: Any
  • Source port range: *
  • Destination: *
  • Destination port range: 3389
  • Protocol: UDP
  • Action: Allow

VM1 has a public IP address and is connected to Subnet1. NSG-VM1 is associated with the network interface of VM1. NSG-Subnet1 is associated with Subnet1.

You need to be able to establish Remote Desktop connections from the internet to VM1.

Solution: You add an inbound security rule to NSG-Subnet1 that allows connections from the Any source to the * destination on port range 3389 by using the TCP protocol. You remove NSG-VM1 from the network interface of VM1.

Does this satisfy the goal?

Explanation

Remote Desktop access to an Azure VM from the internet requires inbound TCP 3389 to be allowed. When an NSG is associated to both a subnet and a NIC, inbound traffic must be permitted by both; if the NIC NSG is removed, only the subnet NSG is evaluated for that path. Adding a subnet-level allow rule for TCP 3389 and removing the NIC-level NSG eliminates the existing NIC rule set that allowed only UDP 3389, so the VM can receive RDP traffic from the internet.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!