Advanced · Load balancing · 20 of 32

Load balancer backends marked down

Problem

Clients time out on lb-app at 10.1.1.10.

Your job
  • Get vm-client reaching lb-app on 443
Without breaking
  • Keep SSH from vm-client to the backends blockedbroken

lb-app, at 10.1.1.10, spreads HTTPS from clients across vm-web1 and vm-web2. Clients like vm-client time out. nsg-web allows clients on 443 and denies everything else. Find out what the load balancer thinks of its backends, and fix it.

You'll learn
Health probes
  1. Connect to vm-client.

    ssh vm-client
    What's this?

    Opens a shell on vm-client, 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.

  2. Try the frontend. Type exit when done.

    nc -zv 10.1.1.10 443
    What's this?

    netcat, a standard Linux tool. Tries to open a TCP connection and reports whether it worked.

    • -z only check whether the port answers. Send no data
    • -v print the result in words
    • 10.1.1.10 where to connect
    • 443 the port to try
  3. Look at the probe.

    az network lb probe list -g rg-lab --lb-name lb-app -o table
    What's this?

    Works with a load balancer health probe. It checks each backend on a port, and only backends that pass get new connections.

    • -g the resource group the resources live in
  4. Look at what filters the backends.

    az network nic list-effective-nsg -g rg-lab --name vm-web1-nic
    What'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.

    • -g the resource group the resources live in
    • --name the name of the thing to look at or change
  5. Let the probe in, ahead of Deny-All-Inbound.

    az network nsg rule create -g rg-lab --nsg-name nsg-web --name Allow-LB-Probe --priority 300 --direction Inbound --access Allow --protocol Tcp --source-address-prefixes AzureLoadBalancer --destination-port-ranges 443
    What's this?

    Adds or changes one rule in a network security group (NSG). Rules are checked from the lowest priority number up, and the first match decides.

    • -g the resource group the resources live in
    • --nsg-name the network security group the rule is in
    • --name the name of the thing to look at or change
    • --priority where the rule sits in the order. Lower numbers are checked first
    • --direction Inbound for traffic coming in to the VM, Outbound for traffic leaving it
    • --access Allow or Deny
    • --protocol TCP or UDP
    • --source-address-prefixes which source addresses the rule matches
    • --destination-port-ranges which ports the rule matches
    • --source-address-prefixes AzureLoadBalancer the service tag for 168.63.129.16
  6. Answer the question below.

    Health probe
    A load balancer's regular check on each backend. Only backends that pass get new connections.
Sources on Microsoft Learn (2)
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
  • NICVM 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.
Resource grouprg-labvnet-app: tap to inspectVirtual networkvnet-app10.1.0.0/16subnet-web: tap to inspectsubnet-web10.1.1.0/24 · 251 usablensg-webvm-web1 10.1.1.4: tap to inspectNICvm-web110.1.1.4vm-web2 10.1.1.5: tap to inspectNICvm-web210.1.1.5lb-app-fe 10.1.1.10: tap to inspectLBlb-app-fe10.1.1.10subnet-client: tap to inspectsubnet-client10.1.2.0/24 · 251 usablevm-client 10.1.2.4: tap to inspectNICvm-client10.1.2.4:443 ✗
  • vm-client → lb-app-fe:443should work: not working
Goals 0/3
Cloud Shell · bashVMsrg-lab · eastus2
cloudshell:~$