Whenever we create a new VM (virtual machine) Instance on Google Cloud Platform, an external IP address gets assigned on our VM Instance automatically and that IP address sets as an Ephemeral IP address by default. This IP address we need to save on our Cloud DNS section and the problem is, the IP address changes every time whenever our virtual machine stopped or restarted. That’s why we need to reserve a Static IP address instated of default ephemeral IP address to save our website from technical errors.
In this tutorial, you will learn how to reserve and configure a static IP address on VM instance of Google Cloud P
So, Let’s get Started!
Steps to Reserving a Static IP Address on GCP
Reserving an Existing IP Address
Visit Google Cloud Console dashboard and click on the Navigation Menu, then under the Networking section, select VPC Network and then click on External IP address from the drop-down. Now on this page, you will see your website External IP address located, and if you want to configure Static IP reservation for this existing IP address then click the down arrow under the Type column and select Static option. A new box will be open, and there you need to write down Name (in lower case and without spaces) and Description (Optional) for your external IP address. Now click on RESERVE button to finish Static IP Reserving Configuration on GCP.
Reserving a New IP Address
After login Google Cloud Console, click on the Navigation Menu > Networking > VPC Network > External IP address. Now on this page, you will see your website External IP address, and if you want to reserve a new Static IP address for your VM Instance instead of using the existing one then click on the RESERVE STATIC ADDRESS button. A new page will be displayed, and there you need to provide the following information -Name: Enter a name to Reserve a static address. A name must start with a lowercase letter, numbers, or hyphens, and cannot end with a hyphenDescription: This is an optional part. If you want, then you can write here a little description of your external static IP address.Network Service Tier: Network Service Tiers enable you to optimize network quality and performance vs. cost for your resources and projects. Leave it to the default option (i.e., Premium).IP Version: Choose IPv4 for VM instance [IPv6 is for SSL proxy or TCP proxy load balancer].Type: Select either Regional or Global option. If you are reserving a static IP address for VM instance or network load balancer, then select Regional. If you are reserving a static IP address for SSL proxy, or TCP proxy load balancer, then select Global.Region: A region is a specific geographical location where you can run your resources, and each region has one or more zones. You can change your region or leave it to default.Attached to: Select a VM instance or load balancer that does not have a static IP address, or None to attach it later.Reserve: Now click on Reserve button for reserving the IP address.
Congratulations! you have successfully Reserved your External IP address as Static
Please Note: Google allows us to reserve only one External IP address per Zone. So, if you want to reserve external IP addresses for your different instances, then you must have to select a separate zone for each Instance.
So, this is my complete guide on How to reserve and assign a static IP address on Google Cloud Platform. If you have any questions regarding this tutorial, then feel free to let me know by commenting below, and I’ll get back you as soon possible.