I have followed some youtube and also stackoverflow thread to open a port in GCP.
The firewall rule is defined and bind to my VM but yet it's not accessible from browser.
Then i checked my angular app, the server also run with 'ng serve' command.
more details:
sudo netstat -pantu
Turned on logging and it
{
"insertId": "jzt0cnftr4835",
"jsonPayload": {
"connection": {
"dest_ip": "10.128.0.2",
"dest_port": 4201,
"src_port": 49222,
"protocol": 6,
"src_ip": "147.158.87.171"
},
"vpc": {
"vpc_name": "default",
"subnetwork_name": "default",
"project_id": "cloud-xp"
},
"disposition": "ALLOWED",
"remote_location": {
"city": "Johor Bahru",
"continent": "Asia",
"country": "mys",
"region": "Johor"
},
"rule_details": {
"direction": "INGRESS",
"action": "ALLOW",
"ip_port_info": [
{
"port_range": [
"4201"
],
"ip_protocol": "TCP"
}
],
"source_range": [
"0.0.0.0/0"
],
"priority": 1000,
"reference": "network:default/firewall:angular-apps"
},
"instance": {
"project_id": "cloud-xp",
"vm_name": "wordpress-1-vm",
"region": "us-central1",
"zone": "us-central1-f"
}
},
"resource": {
"type": "gce_subnetwork",
"labels": {
"project_id": "cloud-xp",
"subnetwork_id": "7656824026900524897",
"location": "us-central1-f",
"subnetwork_name": "default"
}
},
"timestamp": "2020-05-18T03:58:12.619210139Z",
"logName": "projects/cloud-xp/logs/compute.googleapis.com%2Ffirewall",
"receiveTimestamp": "2020-05-18T03:58:16.927671108Z"
}