1
votes

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

1
Did you use the same tag for the firewall rule and your instance? What software are your running? Show its configuration for binding to 0.0.0.0/8080 and 0.0.0.0/8444John Hanley
@JohnHanley I set ‘ All instances in the network ‘ as Targets and I have deployed spring-boot application. I ran on cod using java -jar my app. jar’ commandchk.buddi
@JohnHanley In certain tutorial, it says we need to add firewall for 8444 port as it related to Client-Server communicationchk.buddi
I will assume that your firewall is correct then. This means that your software is probably binding to localhost instead of 0.0.0.0. Since I cannot see your code, I can only guess.John Hanley
@JohnHanley you can access my code using following git link. github.com/ChkBuk/myexamples/tree/master/SyneBiz Do I need any code change?chk.buddi

1 Answers

1
votes
  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.