You have an Azure virtual network named `VNet1` that contains a subnet named `Subnet1`. A virtual machine named `VM1` is deployed to `Subnet1`. The network interface (NIC) of `VM1` is associated with a Network Security Group (NSG) named `NSG-NIC`. `Subnet1` is associated with an NSG named `NSG-Subnet`.
`NSG-Subnet` contains the following inbound security rule:
| Rule Name | Priority | Source | Destination | Port | Action |
|---|---|---|---|---|---|
| Deny-Internet | Internet | Any | * | Deny |
`NSG-NIC` contains the following inbound security rule:
| Rule Name | Priority | Source | Destination | Port | Action |
|---|---|---|---|---|---|
| Deny-All-Internet | Internet | Any | * | Deny |
You need to allow HTTP traffic (port ) from the Internet to `VM1`.
Which two rules should you add? (Choose two.)
- A rule in `NSG-Subnet` with a priority of that allows inbound traffic from the Internet to any destination on port .Answer
- A rule in `NSG-NIC` with a priority of that allows inbound traffic from the Internet to any destination on port .Answer
- CA rule in `NSG-Subnet` with a priority of that allows inbound traffic from the Internet to any destination on port .
- DA rule in `NSG-NIC` with a priority of that allows inbound traffic from the Internet to any destination on port .
- EA rule in `NSG-Subnet` with a priority of that allows outbound traffic to the Internet on port .
Answer
Configure a rule in NSG-Subnet with a priority of 100 that allows inbound traffic from the Internet to any destination on port 80, and configure a rule in NSG-NIC with a priority of 100 that allows inbound traffic from the Internet to any destination on port 80.
Inbound traffic from the Internet destined for a virtual machine is evaluated sequentially by the subnet-level NSG first, and then by the NIC-level NSG. Since both NSG-Subnet and NSG-NIC contain explicit rules that deny all inbound Internet traffic, an allow rule must be added to both NSGs. In Azure NSGs, rules with lower priority numbers are processed first. Therefore, the rule in NSG-Subnet must have a priority lower than 150 (such as 100), and the rule in NSG-NIC must have a priority lower than 200 (such as 100) to override the existing deny rules.
Step-by-Step Solution
Key Concept
Azure Network Security Group dual-level evaluation and rule priority mechanics.