可以在没有外部 IP 的情况下连接到 Compute Engine 吗?

Connection to Compute Engine with No External IP Possible?

我不确定 Google Compute Engine 是否有奇怪的行为。我有一个没有外部 IP 的虚拟机。 现在,在我点击 ssh 按钮的地方我仍然可以连接到它并且我看到了日志:

External IP address was not found; defaulting to using IAP tunneling.

虽然我还没有配置任何 IAP。那怎么可能呢?那么 IAP 隧道是否始终开启?

如果您没有为 VM 实例设置外部 IP 地址,如您在 this documentation, you will have to set any of this 3 methods to connect to your Instance: 1.- Creating a VPN, 2.- Using a Bastion Host, 3.- Using Identity and Aware Proxy

中所见

必须常见的是使用IAP或VPN,Bastion host方法比较复杂和昂贵。

Identity Aware Proxy 是一项托管的 Google 云服务。此服务始终 运行。访问通过 IAM 角色进行控制。 CLI 正在连接到 IAP 端点,请求创建 TCP 隧道,然后通过此隧道将流量转发到您的实例。