Attach an NSG to a single NIC
Your tasks
- Attach nsg-admin to vm-admin's NIC, not to subnet-app
- Block vm-app from reaching vm-admin on 443
vm-admin (10.1.1.5) shares subnet-app with vm-app (10.1.1.4), which serves HTTPS to everyone in the VNet. Only subnet-ops, where vm-ops lives, should reach vm-admin, and only on SSH (22). nsg-admin already has those rules. Attach it to vm-admin's NIC, vm-admin-nic, not the subnet, so vm-app isn't affected.
You'll learn
NSGs on a network interface
Attach nsg-admin to vm-admin's NIC.
az network nic update -g rg-lab --name vm-admin-nic --network-security-group nsg-adminWhat's this?
Changes a VM's network interface, such as its NSG or IP forwarding.
-gthe resource group the resources live in--namethe name of the thing to look at or change
--name vm-admin-nicthe network interface, not the VM--network-security-group nsg-adminthe NSG to associate
List everything that now filters vm-admin.
az network nic list-effective-nsg -g rg-lab --name vm-admin-nicWhat's this?
Shows every security rule applied to a VM's network interface, from the subnet's NSG and the NIC's NSG, in the order they're checked.
-gthe resource group the resources live in--namethe name of the thing to look at or change
Answer the question below.
0/1 changes
Network map
?
- Resource group, the outer dashed frame
- Virtual network, with its address space top right
- Subnet, with range and usable IPs (5 reserved)
- Network security group. A small shield on a VM's NIC means the NIC has one too
- Route table on the subnet
- VM Appliance Private endpoint
- Peering Connected Initiated or access off
- Goal working Goal broken, X marks where it stops
- Private DNS zone, dotted lines go to linked VNets
- Orange pulse: what your last command changed. Drag to pan, Ctrl and scroll to zoom.
vm-ops → vm-admin:22should work: workingvm-app → vm-admin:443should stay blocked: open, but it should be blocked
Goals 0/5
Cloud Shell · bashVMsrg-lab · eastus2
cloudshell:~$