Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Unable to connect from external IP to googlecloud

Hello,

I cannot reach Google VM with IP 34.101.94.130 from my server. 

Traceroute from Google VM stop on Google network.

Traceroute from my server to Google VM, can't reach Google network.

Is there any block or firewall on GCP?

Thanks!

1 3 2,017
3 REPLIES 3

Hi @skyknight 

Welcome on the Google Cloud Community. 

1. How you want to reach out this server ? Over RDP ? SSH ? HTTP ? HTTPS ?
2. I'm assuming that this is external IP assigned to GCE VM. Right ?
4. Did you've checked firewall rules created for VPC, where this Google VM is created? 
5. Most probably GCE VM don't have inbound ( ingress ) FW rule, which allows to connect or reach out VM like ( inbound for ssh:22, RDP:3389, HTTP:80, HTTPS:443)

6. If this is not case with FW rules at VPC, most probably you have OS-level FW, like iptables or firewalld. 

cheers,
DamianS

Hi @skyknight ,

Your question lacks some information but let me provide a general approach on how to fix your issue with network connectivity between your server and Google VM.

First, check if there are any firewall rules that allow SSH access to the VM by running the following command in the Google Cloud Shell:

gcloud compute firewall-rules list | grep "tcp:22"

 If there are no firewall rules that allow SSH access, create one by running :

gcloud compute firewall-rules create default-ssh --allow tcp:22

 Next, check if there is a default route to the Internet:

gcloud compute instances describe VM_NAME --zone ZONE | grep -A 2 'defaultGatewayHwAddress'

 If there is no default gateway, create one by running the following command:

gcloud compute routes create default-internet-route --network DEFAULT_NETWORK --destination-range 0.0.0.0/0 --next-hop-gateway default-internet-gateway

 If there is a default gateway, you can try to ping the VM from the Google Cloud Shell to check if there is a network connectivity issue:

gcloud compute ssh VM_NAME --zone ZONE --command 'ping -c 4 8.8.8.8'

 If you can't ping the VM, there might be a network connectivity issue between the Google Cloud VPC and your server. In this case, you can try to create a VPC peering connection between your VPC and your server's network.

Let me know if this will work. If in case you will have issues with the commands that I have provided, you can review the following documentation below:

https://cloud.google.com/sdk/gcloud/reference/compute/firewall-rules
https://cloud.google.com/sdk/gcloud/reference/compute/instances/describe
https://cloud.google.com/sdk/gcloud/reference/compute/routes/create
https://cloud.google.com/sdk/gcloud/reference/compute/ssh

hello,what should I do if I cannot ping the gateway, such as 10.146.0.1?