无法从外部IP访问GCP VM实例

时间:2020-09-24 14:34:16

标签: google-cloud-platform

我一直在使用GCP VM实例进行REST API服务(Python烧瓶)。

已为其分配了外部IP,并且工作正常。

但是我得到报告说它不能通过外部IP访问。

从另一个VM实例通过内部IP访问正常。

我需要检查什么?

enter image description here

1 个答案:

答案 0 :(得分:0)

您应该检查防火墙规则,这可能是您需要为此操作创建一个新规则:

您可以使用以下命令创建规则:

routerLink="../"

输出应类似于:

gcloud compute --project=my-project firewall-rules create rule-for-test --direction=INGRESS --priority=1000 --network=default --action=ALLOW --rules=tcp:[PORT] --source-ranges=0.0.0.0/0

另外,请检查此documentation以获取更多信息。