简体   繁体   中英

Cannot access Google Cloud Compute Instance External IP

I have set up an Google Cloud Compute Instance:

  • Machine type
    • n1-standard-1 (1 vCPU, 3.75 GB memory)
  • CPU platform
    • Intel Haswell
  • Zone
    • us-east1-c

I can ssh in using the external address.

I have installed the vncserver and can access it on port 5901 from localhost as well as the internal IP.

I am trying to access it from the static, external IP address but it is not working.

I have configured the firewall to open to port to 0.0.0.0/0 , but it is not reachable.

Can anyone help?

------after further investigation from the tips from the two answers (thanks, both,): I have a partial answer:

The Google Cloud Compute instance was set, by default, to not allow HTTP traffic. I reset the configuration to allow HTTP traffic. I then tried the troubleshooting tip to run a small HTTP service in python. I was able to get a ressponse from the service over the inte.net.

The summary of the current situation is as follows:

  • The external IP address can be reached
  • It is enabled and working for SSH
  • It is enabled and working for HTTP
  • It does not seem to allow traffic from vncserver

Any idea how to configure the compute instance to allow for vncserver traffic?

If you already verified that Google Firewall or your VM are not blocking packets, you must make sure that VNC service is configured to listen on the external IP address .

You can always use a utility like nmap outside Google project to reveal information on the port status.

enable http/https traffic form the firewall as per the need. it will work!!

The Google Cloud Compute instance was set, by default, to not allow HTTP traffic. I reset the configuration to allow HTTP traffic. I then tried the troubleshooting tip to run a small HTTP service in python. I was able to get a response from the service over the internet.

As such, the original question is answered, I can access Google Cloud Compute Instance External IP. My wider issue is still not solved, but I will post a new, more specific question about this issue

Create an entry in your local ssh config file as below with mentioned local forward port. In my case its an example of yarn's IP, which I want to access in browser.

Host hadoop
     HostName <External-IP>
     User <Local-machine-username>
     IdentityFile ~/.ssh/<private-key-for-above-user>
     LocalForward 8089 <Internal-IP>:8088

In addition to having the firewall rules to allow HTTP traffic in both Google Cloud Platform and within the OS of the instance, make sure you install a web server such as Apache or Nginx.

After installing the web server, you connect to the instance using SSH and verify you do not get a failed connection with the following command:

$ sudo wget http://localhost

If the connection is positive, it means that you can access your external URL:

http://<IP-EXTERNAL-VM>

TLDR: make sure you are requesting http not https

In my case i was following the link from my CE instance's External Ip property which takes you directly to the https version and i didn't set up https, so that was causing the 'site not found' error.

Usually there are two main things to check.

1. Port

By default, only port 80, 443 and ICMP are exposed. If your server is running on a different port, create a record for the same.

2. Firewall

Make sure you are allowing http and https traffic based on your need. oua re

对我来说,问题是我将防火墙规则的流量设置为“出口”而不是“入口”。

If anyone already initiated 'https' just disable it and check again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM