0

I have created an instance on Google Compute Engine and setup a web application in it. But the issue is that the web app picks internal IP address instead of the external which causes the app to malfunction.

Is there a solution to this issue that does require rewriting the code? It'd be just easier if the internal IP is just disabled.

Stuggi
  • 3,506
  • 4
  • 19
  • 36
bill
  • 1
  • Try Configuring external IP in your appconfig files. – Santosh Garole Apr 15 '20 at 18:03
  • no i haven't. i will try to restart the instance and hopefully it works. i think it-s defintly beacayse the php function which is supposed to grab the external IP confuses it with the internal IP. i-ll try to restart the IP and see if it works Thank you again. – bill Apr 16 '20 at 16:55

1 Answers1

1

You can verify the firewall and assure you to have the port open to the internet (0.0.0.0/0) if you want it public. Its explained on the documentation but the big picture is:

  1. You create a firewall rule and define a network tag.
  2. Appply the network tag to your GCE instance by editing it.
  3. Configure your App to use the external IP instead 127.0.0.1 in config file.
  4. I also recomment to use a static external IP.

If you plan to don't use your internal IP at all, you can simply delete it but keep in mind that internal IP can be usefull as backend communication between your instances (external database or any other VMs).

Bruno
  • 145
  • 6
  • Mr. Bruno thank you so much for answering taking the time to answer my question. i'd prefer to not use internal IP at all. and i do wish to delete it if it's possible at all. i believe this [article](https://cloud.google.com/compute/docs/ip-addresses/reserve-static-internal-ip-address#deleting_a_static_internal_ip_address) is about removing the "static IP" for the internal IP. but the latter will be retained. i don't think it is an issue with the firewall as the app generally function except for some situations where i click a link it grabs the internal instead of external. – bill Apr 15 '20 at 17:16
  • ``` Your instance continues to use the static IP address until the instance is deleted or restarted. After that occurs, the IP address is returned to the subnet's default pool of available internal IP addresses. ``` Have you tried to restart your VM instance ? – Bruno Apr 16 '20 at 12:16