I built a web app, that runs and listens on port 5000 using .netcore (default app in VS). I created a VM instance on GCP, and allowed http and https traffic in the configuration. I ran the app, and used the exteral ip(which I succeeded to ping) to access it from the browser: http://:5000
But I got no response, this should have opened the site. I added a firewall rule to allow traffic but still didn't help: I'm sure many people encountered this, any help?
The firewall is dropping your traffic. You should open port 5000, not http(port 80) or https(port 443).
I have the same opinion as @Iñigo, it could be the firewall.
You can create the rule with the following command:
gcloud compute --project=my-project firewall-rules create rule-for-netcore --direction=INGRESS --priority=1000 --network=default --action=ALLOW --rules=tcp:5000 --source-ranges=0.0.0.0/0
The output should be something like:
Creating firewall...⠹Created [https://www.googleapis.com/compute/v1/projects/my-project...l/firewalls/rule-for-netcore].
Creating firewall...done.
NAME NETWORK DIRECTION PRIORITY ALLOW DENY DISABLED
rule-for-netcore default INGRESS 1000 tcp:5000 False
Also you need to open the port in your windows firewall:
At the end you would see the rule like this:
You can consult the following link for more information.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.