Use the hub's VPN gateway from a spoke
- Get vm-spoke1 reaching srv-onprem on 443
The hub's VPN gateway, vgw-hub, connects Azure to the on-premises site. vm-spoke1 needs srv-onprem, a server on-premises, on 443. Let the spoke use the hub's gateway instead of building its own.
Look at vm-spoke1's routes. Nothing points on-premises yet.
az network nic show-effective-route-table -g rg-lab --name vm-spoke1-nic -o tableWhat's this?
Lists every route that applies to a VM's network interface: system routes, gateway routes and your route tables, and which are active.
-gthe resource group the resources live in--namethe name of the thing to look at or change
Let the hub's gateway serve its peers.
az network vnet peering update -g rg-lab --vnet-name vnet-hub --name hub-to-spoke1 --allow-gateway-transit trueWhat's this?
Connects two virtual networks, or changes what the connection allows. A peering needs a link from each side.
-gthe resource group the resources live in--vnet-namethe virtual network--namethe name of the thing to look at or change
--allow-gateway-transit trueon the hub's side of the peering
Let the spoke use it.
az network vnet peering update -g rg-lab --vnet-name vnet-spoke1 --name spoke1-to-hub --use-remote-gateways trueWhat's this?
Connects two virtual networks, or changes what the connection allows. A peering needs a link from each side.
-gthe resource group the resources live in--vnet-namethe virtual network--namethe name of the thing to look at or change
--use-remote-gateways trueon the spoke's side, after the hub allows transit
Look at the routes again.
az network nic show-effective-route-table -g rg-lab --name vm-spoke1-nic -o tableWhat's this?
Lists every route that applies to a VM's network interface: system routes, gateway routes and your route tables, and which are active.
-gthe resource group the resources live in--namethe name of the thing to look at or change
Connect to vm-spoke1.
ssh vm-spoke1What's this?
Opens a shell on vm-spoke1, so the next commands run on that VM. In this lab it's a shortcut. In real Azure you'd connect through something like Azure Bastion, or SSH to an address you can reach.
Test srv-onprem on 443. Type exit when done.
nc -zv 192.168.10.5 443What's this?
netcat, a standard Linux tool. Tries to open a TCP connection and reports whether it worked.
-zonly check whether the port answers. Send no data-vprint the result in words192.168.10.5where to connect443the port to try
Answer the question below.
?
- 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-spoke1 → srv-onprem:443should work: not working