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 ?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With