How to enable Ping(ICMP) on Azure

28,732

Solution 1

I don't believe you can do this. Traffic leaving the data center goes through the load balancer, and the load balancer only routes TCP-based traffic.

Solution 2

I know this question is very old, but I stumbled upon it while facing the same issue and there is an actual solution for it now in Azure.

When setting up your Virtual machine you can assign it an "Instance IP address". Once that has been configured, you can enabled ICMP in and out in the local firewall. You will then be able to ping out of your Azure VM and also use tools like traceroute.

Solution 3

I had a similar problem. Needed to assign public IP to Azure VM in order to enable ICMP. I used set-azurepublicip and update-azurevm and resolved the issue.

Solution 4

I also had problems to do traceroutes from my azure VM and to ping it. Just wanted to let you know, that after you have a public IP assigned to the VM (which is in many cases the default), you also need to add ICMP Rules to your network security groups (NSG) (if you have any, which you should).

If you have a NSG on the vnet and a NSG on the VM network interface, you should create 4 rules that allow ICMP (vnet-in, vnet-out, vm-in, vm-out). Selecting "Any" as protocol, will not work. The default rule for internet access seems to be not sufficient. You need to select ICMP. "Any" seems to be only UDP+TCP. I set the source and destination port to "*" (not sure if it even has any effect if ICMP is selected).

After that and a little wait (~1-2 min), I could ping and trace in every direction :)

Share:
28,732
Xilang
Author by

Xilang

Updated on July 09, 2022

Comments

  • Xilang
    Xilang almost 2 years

    In Windows Azure role, I cannot ping out

    D:\Users\foglight>ping www.google.com
    
    Pinging www.l.google.com [209.85.143.104] with 32 bytes of data:
    Request timed out.
    Request timed out.
    Request timed out.
    Request timed out.
    
    Ping statistics for 209.85.143.104:
     Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
    

    I google it and found some one suggest run below command, but even after run it, I still can not ping out

    netsh advfirewall firewall add rule name="ICMPv6" dir=in action=allow enable=yes protocol=icmpv6
    

    Please someone tell me the reason and how to walkaround.

  • Nariman
    Nariman over 11 years
    Steve, any idea why ping doesn't work across instances of the same role once ICMP is enabled? We would like to use the multicast zen discovery option for an Elastic Search cluster (currently using unicast with instance IPs manually specified in configuration).
  • user94559
    user94559 over 11 years
    No, I don't know. I would have expected this to work inside the data center.
  • knocte
    knocte about 8 years
    is this with the classic VMs or with the new portal?
  • Hajjat
    Hajjat over 6 years
    It's supported now in Azure.
  • Hà Link
    Hà Link over 6 years
    Can you give detail instruction on how to use these 'commands' or tools?
  • Shadja Chaudhari
    Shadja Chaudhari over 5 years
    This will explain how to use azure powershell command mentioned above "set-azurepublicip" docs.microsoft.com/en-us/powershell/module/servicemanagement‌​/… After public IP is assigned, the VM needs and update. Refer [docs.microsoft.com/en-us/powershell/module/servicemanagemen‌​t/… for Update-AzureVM