Google Cloud Engine - Change External IP address from CA to SG

梦想与她 提交于 2019-12-11 07:39:55

问题


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.

Is it possible to change the IP where it can be located to Singapore?

Thanks, Edmhar


回答1:


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

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.

Delete access gcloud compute instances describe [INSTANCE_NAME]

gcloud compute instances delete-access-config [INSTANCE_NAME] \ --access-config-name "[ACCESS_CONFIG_NAME]"

Define the new IP reserved ( here you specify the actual IP x.x.x.x, not its name)

gcloud compute instances add-access-config [INSTANCE_NAME] \ --access-config-name "[ACCESS_CONFIG_NAME]" --address [IP_ADDRESS]

Assign the IP to the VM

gcloud compute instances add-access-config [INSTANCE_NAME] \ --access-config-name "[ACCESS_CONFIG_NAME]"

The official documentation has also the step by step. https://cloud.google.com/compute/docs/configure-ip-addresses



来源:https://stackoverflow.com/questions/45430812/google-cloud-engine-change-external-ip-address-from-ca-to-sg

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!