How can I enable pings on my VMs?

The terminal ‘ping’ command is often used to see whether or not a server at a given IP address is running and responsive. This is accomplished by sending data packets using the IP/ICMP protocol between your computer and the destination server (which then mirrors them back again).

Most clouds, however, block inbound ICMP packets as a security measure. If you would like to be able to ping your VMs, you need to edit the VM’s external firewall to allow receiving of ICMP type 8 packets.

What follows is an example of how to do so on Microsoft Azure, though the process will look very similar regardless of what cloud you are using:

  • Click the name of the VM you want to allow ICMP traffic to:

  • Click the ‘Networking’ item on the left menu:

  • Click the blue ‘Add inbound port rule’ button:

  • In the pane that slides in on the right, select ‘ICMP’ from protocol and click ‘Add’ to allow all ICMP traffic:

  • Replace the “*” in both the ‘Source port ranges’ and ‘Destination port ranges’ fields with the value 8. You can also skip this step, to allow all ICMP traffic to reach your VM.