When you create a VM instance, it is automatically assigned an ephemeral external IP address. If you don’t want an ephemeral external IP address, you can explicitly assign a static external IP address to the instance instead.
-
In the GCP Console, go to the VM Instances page.
-
Click Create instance.
-
On the Create a new instance page, fill in the properties for your instance.
-
Expand the Management, security, disks, networking, sole tenancy section.
-
Click Networking.
-
Under Network interfaces, click on the default network interface to edit it.
-
Under the External IP section, select the static external IP address that you reserved from the drop-down menu.
-
Click Done to finish modifying the default network interface.
-
Click Create to create the instance.