Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access localhost on Google Cloud instance using External IP

There are many similar questions to this on SO, but none of the solutions I saw really solved my issue completely. I'm doing test runs for a website framework hosted on the Google Cloud Platform.

By default, the website is hosted on http://localhost:2800 And I know the external IP of the instance I'm running it on. How can I access the hosted website through a browser on my local machine? Do I use virtual hosts / port forwarding etc.?

like image 991
fwx Avatar asked Jan 04 '23 14:01

fwx


1 Answers

go to your VPC firewall

https://console.cloud.google.com/networking/firewalls

and create a firewall rule to allow traffic on your desired tcp port

Create a Firewall Rule for SQL Server Configure a firewall rule to allow traffic on port 1433 so other clients can connect to the newly created SQL Server instance over the public internet:

In the Developers Console main menu, go to the Firewall rules section.

OPEN THE FIREWALL RULES

Click the Add firewall rule button.

Name the new firewall rule allow-tcp-1433.

Set Source Filter to IP Ranges.

For Source IP Ranges enter 0.0.0.0/0. This value allows access by all IP addresses.

Warning: This configuration leaves your SQL Server instance open to traffic from everyone, everywhere. It is used only for demonstration purposes. In production environments, restrict access to only those IP addresses that need access. For Allowed protocols and ports enter tcp:1433. Click the Create button to create the firewall rule.

like image 56
S.Frank Richarrd Avatar answered Mar 17 '23 05:03

S.Frank Richarrd