我有centOS 7的Google云计算引擎。它位于Asia-southeast1(SG)。但是,我检查了位于加利福尼亚山景城的外部IP。
I have google cloud compute engine which is centOS 7. It was located in asia-southeast1 (SG). However, I checked the external IP it was on the Mountain View, CA.
是否可以将其可更改的IP更改为新加坡?
Is it possible to change the IP where it can be located to Singapore?
谢谢, Edmhar
Thanks, Edmhar
推荐答案可以。此时,您需要: 1在需要的区域中保留一个新IP。 2停止您的VM。 3将新IP分配给您的VM。 4重新启动您的VM
Sure. At this moment you need to: 1 Reserve a new IP in the wanted region. 2 Stop your VM. 3 Assign the new IP to your VM. 4 Re-Start your VM
通过控制台进行操作比较容易,但是会花费更多时间。如果您决定使用gcloud。您需要删除访问权限并分配新的访问权限。
It is easier to do it through the console, but will take more time. If you decide to do it with gcloud. You need to delete the access and Assign the new one.
删除访问权限 gcloud计算实例描述[INSTANCE_NAME]
Delete access gcloud compute instances describe [INSTANCE_NAME]
gcloud计算实例delete-access-config [INSTANCE_NAME] \ --access-config-name [ACCESS_CONFIG_NAME]
gcloud compute instances delete-access-config [INSTANCE_NAME] \ --access-config-name "[ACCESS_CONFIG_NAME]"
定义保留新的IP(在此指定实际IP xxxx,而不是其名称)
Define the new IP reserved ( here you specify the actual IP x.x.x.x, not its name)
gcloud计算实例add-access-config [INSTANCE_NAME] \ - -access-config-name [ACCESS_CONFIG_NAME] --address [IP_ADDRESS]
gcloud compute instances add-access-config [INSTANCE_NAME] \ --access-config-name "[ACCESS_CONFIG_NAME]" --address [IP_ADDRESS]
将IP分配给VM
gcloud计算实例add-access-config [INSTANCE_NAME] \ --access-config-name [ACCESS_CONFIG_NAME]
gcloud compute instances add-access-config [INSTANCE_NAME] \ --access-config-name "[ACCESS_CONFIG_NAME]"
官方文档也一步一步来。 cloud.google/compute/docs/配置IP地址
The official documentation has also the step by step. cloud.google/compute/docs/configure-ip-addresses
更多推荐
Google Cloud Engine
发布评论