Prepare and test your skills

Prepare and test your skills

A static internal IP address is a named, regional address resource that holds a private IP address for a project inside a Virtual Private Cloud (VPC) (opens in a new tab) subnet. Reserving the address prevents Google Cloud from giving that same address to another resource as an ephemeral address. The reservation keeps private addressing stable for internal communication, service discovery, and high-availability failover, because the same address can be reused after a virtual machine (VM) is deleted and re-created.
How internal IP addresses are assigned depends on the subnet that a VM network interface is connected to. Each IPv4-only or dual-stack interface receives one primary internal IPv4 address from the subnet's primary IPv4 range, while each IPv6-only or dual-stack interface connected to a subnet with an internal IPv6 range receives one /96 IPv6 range from the subnet's /64 internal IPv6 range. Compute Engine (opens in a new tab) can assign these addresses automatically as ephemeral addresses, or an administrator can assign a specific address by reserving a static address or specifying a custom ephemeral address at VM creation.
| Address type | Lifetime | Use when |
|---|---|---|
| Ephemeral internal address | Released when the resource is generally stopped or deleted | The address does not need to survive replacement of the VM or forwarding rule |
| Static internal address | Remains assigned to the project until it is explicitly released | The service depends on a stable private address that can move from one resource to another |
A static internal address behaves the same as an ephemeral address for traffic, but only the static address persists after its resource is deleted.
The two ways to create a static internal reservation are reserve-then-assign and promote-in-use, and both workflows depend on an existing VPC network with a subnet. For IPv6, the subnet must have an internal IPv6 range with INTERNAL access type. Reserving first blocks automatic allocation of that address, while promoting converts an address that is already attached to a running resource.
Reserve a static internal IPv4 or IPv6 address and then associate it with a VM:
/96 IPv6 range.Specify an ephemeral address and then promote it to static:
A reserved static internal address is used when creating resources that need stable private connectivity. After reservation, the address can be assigned when creating a VM instance or an internal load balancer, including assignment to a primary or secondary network interface. If no custom or reserved IPv6 address is specified for a dual-stack or IPv6-only interface, Compute Engine automatically assigns an ephemeral internal IPv6 address from the subnet's IPv6 range.
Existing reservations can be viewed in the Google Cloud console, with command-line tools, and with API methods for one region or all regions. In the console, go to IP addresses (opens in a new tab) and then Internal IP addresses, where the Type column shows whether an address is static or ephemeral. The same information is available with the gcloud compute addresses list command, or with the addresses.list method for one region and the addresses.aggregatedList method for all regions. Unassigning a static internal IPv6 address from a dual-stack instance moves the address from IN_USE to RESERVED, so the address stays held by the project and can later be assigned to another resource in the same region.
Static internal IP address limitations define quota, scope, reuse, and change rules for the reservation lifecycle. The address resource lives in one region and the subnet that supplies its value, so traffic and assignment stay inside that regional boundary. Only VPC networks are supported, and legacy networks cannot use static internal reservations.
Exam tip: Deleting a resource does not release its static internal IP address — the address remains reserved until it is explicitly deleted, unlike an ephemeral address that is generally released when its resource is stopped or deleted.
Static external IP addresses in Google Cloud are reserved public addresses that stay with a project until released. Google Cloud labels each address as regional or global based on how the address is used. A regional address is tied to one region, such as us-east4, while a global address is an anycast address that can front a load balancer in multiple regions.
Regional static external IP addresses are addresses tied to a specific region and used by zonal or regional resources in that region. When an address is attached to a regional resource, such as a Compute Engine (opens in a new tab) virtual machine (VM), Google Cloud labels the address as regional. The address exists in the same region as the VM for routing, latency, and pricing, and only one resource at a time can use a reserved address.
Regional external IPv4 addresses can use Premium Tier or Standard Tier networking, while regional external IPv6 addresses are Premium Tier only. Traffic from the internet reaches the VM or regional forwarding rule through a one-to-one mapping between the regional external address and the target. Regional addresses are also used as external addresses for Cloud NAT and Cloud VPN gateways.
Regional external IPv4 addresses support several regional uses:
When reserving for a VM or a regional load balancer, choose Regional and select the region where the resource lives.
Global static external IP addresses are internet-accessible anycast addresses used only for global load balancing. A global address is not tied to a single region or zone, so one stable frontend IP can direct clients to backends in different regions through Google's Premium Tier network. Global addresses always use Premium Tier and cannot use Standard Tier.
A global external address is attached to a global forwarding rule (opens in a new tab) for a global load balancer, which then sends traffic to the appropriate regional backends. Global addresses can be used by external proxy Network Load Balancers, external Application Load Balancers, and global external passthrough Network Load Balancers.
How reservation scope and network tier differ controls where an address can be used and what object holds the reservation. Regional IPv4 and global addresses are reserved at the project level, while regional IPv6 addresses are reserved from a specific subnet's external IPv6 range and stay associated with that subnet. The choice depends on whether the destination lives in one region or needs one anycast frontend across regions.
| Address type | IP range size | Network tier | Reserved under |
|---|---|---|---|
| Regional external IPv4 | /32 | Premium Tier or Standard Tier | Project |
| Regional external IPv6 | /96 | Premium Tier only | Subnet |
| Global external IPv4 | /32 | Premium Tier only | Project |
| Global external IPv6 | /64 | Premium Tier only | Project |
Choose a regional address when the destination lives in one region, such as a VM network interface or a regional forwarding rule. Choose a global address when the destination is a global load balancer that needs one anycast frontend across regions. Virtual Private Cloud (opens in a new tab) networking carries global load balancer traffic to backends in different regions from that single frontend.
Exam tip: Choose a global static external address only for a global load balancer; choose a regional static external address for a Compute Engine VM or a regional load balancer.
IP promotion and lifecycle management controls how an IP address moves from temporary use to long-term reservation and back to the available pool. An ephemeral IP address (opens in a new tab) is automatically assigned by Google Cloud and does not persist beyond the life of the resource, while a static IP address (opens in a new tab) is a reserved resource that stays assigned to the project until it is explicitly released. Promotion converts an in-use ephemeral address into a static reservation so the same address can survive restarts, rebuilds, and moves between resources.
Ephemeral and static addresses differ in persistence, ownership, and how they are assigned to resources such as a VM instance or a forwarding rule. If no address is specified, Google Cloud automatically assigns an ephemeral address that is generally released if the resource is stopped or deleted. Reserving a static address assigns that address to the project, which prevents another resource from taking it and allows the address to be moved from one Google Cloud resource to another.
| Address type | Persistence | Use when |
|---|---|---|
| Ephemeral | Released when the associated resource is stopped or deleted | The address does not need to survive the resource lifecycle |
| Static | Remains reserved for the project until explicitly released | A service depends on a fixed address or the address must move between resources |
Only one resource at a time can use a static external or static internal address. A Google-provided static external address is not announced to the public internet until it is associated with a resource, such as a VM or an external forwarding rule.
Promotion is the process that converts an ephemeral address already attached to a resource into a static reserved address without changing the address value. For external addresses, promoting an ephemeral external address to static does not cause Google Cloud to drop packets sent to the VM, including packets sent directly or through a load balancer. The promoted address remains attached to the same VM, so the address must first be unassigned from that VM before it can be assigned to another resource.
Promotion follows the same order for internal and external addresses:
networkIP, ipv6Address, or IPAddress value.For internal IPv6 promotion, the reservation must also include a prefixLength of 96 because internal IPv6 addresses are reserved as a /96 range from the subnet. A virtual machine (VM) (opens in a new tab) keeps using its promoted address without interruption, but a static reservation name cannot be changed after it is created, so choose a name that identifies the service and region.
The lifecycle of a reserved address moves from RESERVED to IN_USE and back to RESERVED until the reservation is deleted. A reserved address first exists as RESERVED in the project, then becomes IN_USE when attached to a VM network interface or forwarding rule, then returns to RESERVED when unassigned but not deleted. Deleting a VM or forwarding rule does not automatically release its static address, so the address resource must be manually released when it is no longer required.
Listing and releasing complete the lifecycle and control cost. Reserved addresses can be viewed on the IP addresses (opens in a new tab) page under External IP addresses or Internal IP addresses, with gcloud compute addresses list, or with the addresses.list and addresses.aggregatedList methods for regional and multi-region views. If a static external address is reserved but not assigned to a resource such as a VM or forwarding rule, it is charged at a higher rate than addresses that are in use, so unassigned reservations should be reassigned or released promptly. The full reservation lifecycle is therefore reserve, attach to use, detach to hold, and delete to release and stop charges.
Exam tip: Deleting a VM does not release its static address, and an unassigned static external address costs more than an in-use address — release unused reservations to avoid extra charges.
An ephemeral internal IP address is generally released when the resource is stopped or deleted, while a static internal IP address remains assigned to the project until it is explicitly released. Both behave the same for traffic, but only the static address persists after its resource is deleted and can be reused after a virtual machine (VM) is deleted and re-created. Use an ephemeral address when the address does not need to survive replacement of the VM or forwarding rule, and use a static address when the service depends on a stable private address that can move from one resource to another.
Use a regional static external IP address for a resource that lives in one region, such as a Compute Engine virtual machine (VM) network interface or a regional load balancer forwarding rule, and use a global static external IP address only for a global load balancer frontend across regions. A regional address is tied to one region and reaches its target through a one-to-one mapping, while a global address is an anycast address that can direct clients to backends in different regions through the Premium Tier network. Regional external IPv4 addresses support Premium Tier or Standard Tier networking, while all global external addresses require Premium Tier.
Promotion converts an ephemeral address already attached to a resource into a static reserved address without changing the address value and without dropping packets sent to the virtual machine (VM). To promote it, identify the in-use ephemeral address value and create a static reservation from that value with a new reservation name plus the region and, for internal addresses, the subnetwork that the address belongs to. The address remains attached to the same VM or load balancer frontend and continues to carry traffic, and for internal IPv6 promotion the reservation must also include a prefix length of 96.
Deleting a virtual machine (VM) or forwarding rule does not automatically release its static address, and the address resource must be manually released when it is no longer needed. The reservation returns to RESERVED status when unassigned but not deleted, so it stays held by the project and can be moved to another resource. An unassigned static external address is charged at a higher rate than an address that is in use, so unused reservations should be reassigned or released promptly.
An administrator is planning the IP address architecture for two distinct workloads deployed in Google Cloud:
us-central1-a that requires a persistent public IPv4 address for direct inbound connections.Which combination of static external IP address scopes must the administrator reserve for these resources?
Reserve a global static external IP address for both the VM instance and the External Application Load Balancer.
Reserve a regional static external IP address in us-central1 for both the VM instance and the External Application Load Balancer.
Reserve a global static external IP address for the VM instance, and reserve a regional static external IP address in us-central1 for the External Application Load Balancer.
Reserve a regional static external IP address in us-central1 for the VM instance, and reserve a global static external IP address for the External Application Load Balancer.
Last updated