How to enable Ping(ICMP) on Azure

久未见 提交于 2019-12-01 01:40:20

问题


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.


回答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.




回答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.




回答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.




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



来源:https://stackoverflow.com/questions/9783628/how-to-enable-pingicmp-on-azure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!