Find a VM's NIC and private IP
Your tasks
- Inspect vm-web2's network interface
A developer asks what private IP address vm-web2 has and which subnet of vnet-app it lives in. VMs don't hold IPs directly. Their network interface (NIC) does, and vm-web2's is called vm-web2-nic. Find both answers from the NIC.
You'll learn
Network interfaces
List the IP configurations on vm-web2's NIC.
az network nic ip-config list -g rg-lab --nic-name vm-web2-nic -o tableWhat's this?
Shows a network interface's IP configuration: its private IP and subnet.
-gthe resource group the resources live in
--nic-name vm-web2-nicthe network interface to inspect
Or pull one field out of the full NIC with --query.
az network nic show -g rg-lab --name vm-web2-nic --query "ipConfigurations[0].privateIPAddress"What's this?
Shows a VM's network interface: its IP address and what is attached to it.
-gthe resource group the resources live in--namethe name of the thing to look at or change
Answer the questions below.
0/0 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.
Goals 0/3
Cloud Shell · bashVMsrg-lab · eastus2
cloudshell:~$