chk.buddi
chk.buddi

Reputation: 603

Cannot connect through external IP in Google cloud Compute engine instance

I created compute engine instance in GCP to deploy my web app.It works fine inside the instance (localhost:8080). However, using the external Ip address, I'm unable to access it even though I have allowed for 0.0.0.0/0 for all instances by the firewall rule.I added both port tcp:8080 and tcp :8444 but It does not allow to connect even 'Telnet'.

Connecting To 35.185.98.244...Could not open connection to the host, on port 8444: Connect failed

Connecting To 35.185.98.244...Could not open connection to the host, on port 8080: Connect failed

Anybody can help me to solve this issue?

my git url: https://github.com/ChkBuk/myexamples/tree/master/SyneBiz

Upvotes: 1

Views: 10077

Answers (1)

Mahmoud Sharif
Mahmoud Sharif

Reputation: 1103

  1. Take a look at the Firewall Rule in the GCP. Make sure that you allow ingress traffic for the port 80 (since you are accessing it from the browser). The ports 8080 and 8444 are local ports accessed internally. These ports are not exposed to the public. You have to make sure that there is a forwarding rule that redirects the traffic from port 8080/8444 to port 80.

  2. Eventually, try to test the URL connection and the ports within the compute engine instance, or outside the GCP. Below are some examples:

    $ curl http://[external-IP-vm-address]:80

    $ telnet localhost 80

    $ nmap <external-ip-vm-address>

    $ netstat -plant

    There are other network tests that you could perform. You may consult this discussion thread from Stackexchange.

  3. Lastly, it could be that the ports 8080 and 8444 are already being used by other processes. For this reason, you are unable to connect to them.

    Try the following troubleshooting steps.Type:

    $ netstat -tulpn

    This command above will display a list of all processes running on their respective ports. If the port 8080/8444 are there, take a look at the existing process running on it. You may then kill that process. For more information on troubleshooting the processes running on port 8444 and 8080, you may consult this article.

Upvotes: 2

Related Questions