4
votes

I created a Google Compute Engine instance but can not ping its external IP address (173.255.118.164).

I can ssh into the instance via gcutil, but I can not ping the external address from my home computer.

With Amazon EC2, this is straightforward and just works.

What's up with Google ?

1

1 Answers

23
votes

By default, all incoming traffic is blocked except for SSH. To enable ICMP (ping), you can create a firewall rule by running:

$ gcloud compute firewall-rules create allow-ping --direction=INGRESS --network=default --action=ALLOW --rules=icmp --source-ranges=0.0.0.0/0

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.

The same steps apply for allowing other kinds of traffic. If you want to allow HTTP traffic, for example:

$ gcloud compute firewall-rules create allow-http --direction=INGRESS --network=default --action=ALLOW --rules=tcp:80 --source-ranges=0.0.0.0/0