云 shell 找不到 Windows 实例
Cloud shell cannot find Windows instance
我在 GCP 上创建了 Windows 2012 实例,我正在尝试从云端访问它 shell。但是我得到了错误:
ping: instance.zone.c.project.internal: Name or service not known
运行 ping 内部 IP 也没有响应。
我已经根据 guideline 确保服务器名称是正确的:
curl "http://metadata.google.internal/computeMetadata/v1/instance/hostname" -H "Metadata-Flavor: Google"
我允许 HTTP 和 HTTPs,但它使用默认的防火墙配置(无论如何,它不会影响服务器发现)。计算机可通过 RDP 访问,它是 运行,并且响应 ping 到其临时外部 IP 而不是内部 IP。我已经确保云 shell 在同一个项目上并重置它(没有帮助)。
谢谢,
阿萨夫
编辑:我创建了 Linux 机器,我可以使用名称从中 ping 通它,所以它似乎是 Cloud shell
的问题
Google 文档 Compute Engine > Doc > Internal DNS 包含此问题的答案。
Virtual Private Cloud networks on Google Cloud have an internal DNS
service that lets instances in the same network access each other by
using internal DNS names.
Internal DNS names cannot be used to
connect to the external IP addresses of an instance.
Internal DNS names can only be resolved from other VMs that are in the same project
and that use the same VPC or legacy network. You cannot use internal
DNS to contact instances that are in other networks, even if they are
in the same project.
云 Shell 实例位于单独的网络中。您可以通过在 Cloud Shell 命令提示符中输入 ip -4 addr show
来确保这一点。因此它通过外部 IP 连接到 VM 实例。
这就是云 Shell 实例无法通过其内部 DNS 名称 instance.zone.c.project.internal
访问实例以及 ping 实例的内部 IP 地址的原因。
您创建的 Linux VM 与 Windows VM 位于同一网络中。因此,它们可以通过内部 IP 和内部 DNS 名称相互 ping 通。
我在 GCP 上创建了 Windows 2012 实例,我正在尝试从云端访问它 shell。但是我得到了错误:
ping: instance.zone.c.project.internal: Name or service not known
运行 ping 内部 IP 也没有响应。
我已经根据 guideline 确保服务器名称是正确的:
curl "http://metadata.google.internal/computeMetadata/v1/instance/hostname" -H "Metadata-Flavor: Google"
我允许 HTTP 和 HTTPs,但它使用默认的防火墙配置(无论如何,它不会影响服务器发现)。计算机可通过 RDP 访问,它是 运行,并且响应 ping 到其临时外部 IP 而不是内部 IP。我已经确保云 shell 在同一个项目上并重置它(没有帮助)。
谢谢,
阿萨夫
编辑:我创建了 Linux 机器,我可以使用名称从中 ping 通它,所以它似乎是 Cloud shell
的问题Google 文档 Compute Engine > Doc > Internal DNS 包含此问题的答案。
Virtual Private Cloud networks on Google Cloud have an internal DNS service that lets instances in the same network access each other by using internal DNS names.
Internal DNS names cannot be used to connect to the external IP addresses of an instance.
Internal DNS names can only be resolved from other VMs that are in the same project and that use the same VPC or legacy network. You cannot use internal DNS to contact instances that are in other networks, even if they are in the same project.
云 Shell 实例位于单独的网络中。您可以通过在 Cloud Shell 命令提示符中输入 ip -4 addr show
来确保这一点。因此它通过外部 IP 连接到 VM 实例。
这就是云 Shell 实例无法通过其内部 DNS 名称 instance.zone.c.project.internal
访问实例以及 ping 实例的内部 IP 地址的原因。
您创建的 Linux VM 与 Windows VM 位于同一网络中。因此,它们可以通过内部 IP 和内部 DNS 名称相互 ping 通。