Cloud Networking is all about automation and agility. The tools and troubleshooting methodology from on-prem networking is not always applicable. Here are some useful commands and tips for troubleshooting in Azure Networking.
Ping/ICMP may not work (e.g. if you're testing reachability of a Standard Public IP or workload behind a Standard Load Balancer). Instead for Windows VMs:
- Powershell command "test-netconnection": e.g. test-netconnection 10.0.0.4 -Port 3389
- PSPING: download PSPING For Linux VMs:
- tcpping: download as part of tcptraceroute package (sudo apt-get install tcptraceroute)
- Netmon and Wireshark on Windows VMs will be very helpful
- tcpdump
Web Server: It is often helpful just to install a web server on the VM to test HTTP/HTTPs.
-
On Windows Server, install IIS Set-AzVMExtension
-ResourceGroupName myResourceGroup
-ExtensionName IIS-VMName myVM
-Publisher Microsoft.Compute-ExtensionType CustomScriptExtension
-TypeHandlerVersion 1.4-SettingString '{"commandToExecute":"powershell Add-WindowsFeature Web-Server; powershell Add-Content -Path \"C:\\inetpub\\wwwroot\\Default.htm\" -Value $($env:computername)"}'
-Location myLocation (replace myResourceGroup, myVM and myLocation) To test, connect to: http://myVM -
On Linux, install NGINX (sudo apt install nginx) To test, connect to: http://nginxIP
And remember to allow ICMP which by default is not enabled on Windows machines.