8

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.

Xilang
  • 1,513
  • 3
  • 18
  • 36
  • [Use port pings instead of ICMP to test Azure VM connectivity](http://blogs.msdn.com/b/mast/archive/2014/06/22/use-port-pings-instead-of-icmp-to-test-azure-vm-connectivity.aspx) – Masood Khaari Nov 12 '14 at 10:21

4 Answers4

12

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.

user94559
  • 59,196
  • 6
  • 103
  • 103
  • 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). – Nariman Nov 12 '12 at 15:39
  • No, I don't know. I would have expected this to work inside the data center. – user94559 Nov 12 '12 at 16:31
  • It's supported now in Azure. – Hajjat Oct 14 '17 at 00:43
4

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.

Matt Gartman
  • 867
  • 4
  • 9
1

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.

Zong
  • 6,160
  • 5
  • 32
  • 46
Shadja Chaudhari
  • 253
  • 1
  • 3
  • 6
  • Can you give detail instruction on how to use these 'commands' or tools? – Hà Link Nov 16 '17 at 13:12
  • This will explain how to use azure powershell command mentioned above "set-azurepublicip" https://learn.microsoft.com/en-us/powershell/module/servicemanagement/azure/set-azurepublicip?view=azuresmps-4.0.0 After public IP is assigned, the VM needs and update. Refer [https://learn.microsoft.com/en-us/powershell/module/servicemanagement/azure/update-azurevm?view=azuresmps-4.0.0] for Update-AzureVM – Shadja Chaudhari Oct 29 '18 at 10:52
1

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 :)

japi
  • 101
  • 1
  • 3