Search code examples
google-cloud-datalabgoogle-cloud-shell

Is it possible to set a static external IP address in Cloud Shell?


I'm using Cloud Shell within Google Cloud Console to connect to my Google Cloud Datalab GCE VM using these instructions. I have a firewall on my Google Cloud Datalab GCE VM that restricts SSH access to certain IP addresses only. The problem I have is that the cloud shell IP address changes frequently. Is it possible to set a static external IP address for Cloud Shell, or is there a list of IP ranges that will be used for cloud shell machines? I'm open to other suggestions about how to connect via ssh to a GCE VM with restricted firewall within cloud shell as well.


Solution

    1. Yes you can set static external IP of your VM. Please follow following link of google documentation for same.

      https://cloud.google.com/compute/docs/configure-ip-addresses

    Go to Section "Reserving a new static external IP address".

    I have tried it previously an 6 months back it works smoothly.

    1. Even if VM change IP external so often . Solution :-It should be better to have a Domain Name for that VM. i.e. even if IP changes beneath it ( Dynamic DNS server) would handle it. Search for Dynamic DNS it would helpful.

    But in your no. 2 won't be valid as your firewall would block it anyways.