为什么我不能ping我的Google Compute Engine实例的外部IP地址? [英] why can't I ping the external IP address of my Google Compute Engine instance?
问题描述
我创建了一个Google Compute Engine实例,但是无法ping它的外部IP地址(173.255.118.164).
I created a Google Compute Engine instance but can not ping its external IP address (173.255.118.164).
我可以通过gcutil ssh进入实例,但无法从家用计算机ping通外部地址.
I can ssh into the instance via gcutil, but I can not ping the external address from my home computer.
对于Amazon EC2,这很简单并且可以正常工作.
With Amazon EC2, this is straightforward and just works.
Google怎么了?
What's up with Google ?
推荐答案
默认情况下,除SSH外,所有传入流量都被阻止.要启用ICMP(ping),可以通过运行以下命令来创建防火墙规则:
By default, all incoming traffic is blocked except for SSH. To enable ICMP (ping), you can create a firewall rule by running:
$ gcutil addfirewall allow-ping --allowed=icmp
这将允许您ping默认网络上的所有实例.也可以在云控制台->计算引擎->网络用户界面中创建防火墙规则.
This will allow you to ping all of your instances on the default network. Firewall rules can also be created in the Cloud Console --> Compute Engine --> Networks UI.
您还可以创建仅适用于实例组等的规则.有关网络和防火墙的文档中的详细信息.
You can also create rules which only apply to groups of instances, etc. Details in the documentation for Networks and Firewalls.
相同步骤适用于允许其他类型的流量.如果要允许HTTP通信,例如:
The same steps apply for allowing other kinds of traffic. If you want to allow HTTP traffic, for example:
$ gcutil addfirewall http --allowed=tcp:80
这篇关于为什么我不能ping我的Google Compute Engine实例的外部IP地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!