2014-10-22 75 views
2

我在azure上创建了2个ubuntu虚拟机,我可以使用“ssh [email protected]”从另一台计算机登录到另一台计算机,但ping另一台虚拟机时,响应。与卷曲相同的东西。ping无法在azure上运行ubuntu虚拟机

ping xyz.cloudapp.net 
curl xyz.cloudapp.net 

使用虚拟机的内部IP地址修改/ etc/hosts文件也不起作用。

谢谢,

回答

3

ICMP(Ping)在Azure中被阻塞,因此设计时会失败。您可以根据您设置网络的方式以及尝试ping的方式来使其工作。详情请参阅https://social.msdn.microsoft.com/Forums/en-US/0669112c-a6dd-4290-bcde-9ce7b9d60d80/how-do-i-enable-pinging-a-vm

•从Azure的VM平外部地址 - 作为Azure不不起作用 允许出站ICMP

•平Azure的VM从外部地址 - 不工作作为Azure不 允许入站ICMP

•Azure的虚拟机之间的平使用内部IP(DIP) - 的作品,但来宾操作系统 防火墙必须配置为允许它作为默认ICMP被阻止 由客人。

•Azure的VM之间和内部部署通过Azure的连接 (点至点的IPSec VPN隧道)或虚拟网络网关 (站点到站点的IPSec VPN隧道)平 - 作品,但客户机操作系统的防火墙必须为 配置为允许默认ICMP被来宾阻止。

为了允许ICMP在Windows VM上,从提升的命令提示,运行:

的netsh advfirewall防火墙添加规则名称= “ICMPv6的” DIR =在动作允许= 启用=是协议=的ICMPv6的netsh advfirewall防火墙添加规则 名= “ICMPV4” DIR =行动=允许启用= YES协议= icmpv4

+0

但是为什么?为什么有人会阻止ping? :-( – 2016-02-13 15:32:32

0

您可以尝试在端口号hping3 ping主机,

sudo apt-get install hping3 
[email protected]:~# sudo hping3 -S -p 80 google.com 
HPING google.com (eth0 216.58.196.174): S set, 40 headers + 0 data bytes 
len=44 ip=216.58.196.174 ttl=53 id=20026 sport=80 flags=SA seq=0 win=42900 rtt=32.8 ms 
len=44 ip=216.58.196.174 ttl=53 id=34969 sport=80 flags=SA seq=1 win=42900 rtt=36.6 ms 
len=44 ip=216.58.196.174 ttl=53 id=14912 sport=80 flags=SA seq=2 win=42900 rtt=32.6 ms 
len=44 ip=216.58.196.174 ttl=53 id=60826 sport=80 flags=SA seq=3 win=42900 rtt=32.5 ms 
len=44 ip=216.58.196.174 ttl=53 id=5138 sport=80 flags=SA seq=4 win=42900 rtt=32.3 ms 
^C 
--- google.com hping statistic --- 
5 packets transmitted, 5 packets received, 0% packet loss 
round-trip min/avg/max = 32.3/33.4/36.6 ms 
[email protected]:~# 
+0

此外,我们可以从外部检查 'root @ mail:/ home/hrishi#sudo hping3 -S -p 80 1we1.cloudapp.net HPING 1we1.cloudapp.net(eth0 23.97.74.251):S set ,40个头部+0个数据字节 len = 46 ip = 23.97.74.251 ttl = 50 DF id = 0 sport = 80 flags = SA seq = 0 win = 29200 rtt = 111.9 ms len = 46 ip = 23.97.74.251 ttl = 50 DF id = 0 sport = 80 flags = SA seq = 1 win = 29200 rtt = 112.7 ms ^ C --- 1we1.cloudapp.net hping statistic --- 2个数据包传输,2个数据包接收,0%数据包损失 往返最小/平均/最大= 111.9/112.3/112.7毫秒 root @ mail:/ home/hrishi#' – Hrishi 2015-06-27 20:41:29

相关问题