Create IPv4 sub-prefixes and IPv4 addresses
This page describes how to divide your IPv4 public delegated prefix and create BYOIP addresses to use with Google Cloud resources. You can create IPv4 BYOIP addresses from a public delegated prefix or sub-prefix.
If you want to divide an IPv6 public delegated prefix, see Create IPv6 sub-prefixes.
Before you begin
- Create an IPv4 public advertised prefix.
- Create an IPv4 public delegated prefix.
Roles
To get the permissions that
you need to complete the tasks in this guide,
ask your administrator to grant you the
Compute Public IP Admin (roles/compute.publicIpAdmin)
IAM role on your project.
For more information about granting roles, see Manage access to projects, folders, and organizations.
You might also be able to get the required permissions through custom roles or other predefined roles.
Create sub-prefixes
You can divide a public delegated prefix into smaller IP address ranges by creating a sub-prefix. A sub-prefix is a public delegated prefix that has a public delegated prefix parent.
A sub-prefix name can't be changed without deleting and recreating the resource.
For this reason, we recommend that you create generic names that won't need to
change—for example, sub-203-0-113-0-28, where sub denotes the resource
type and 203-0-113-0-28 denotes the specific prefix and prefix length.
A public delegated prefix can be sub-delegated up to three times from a public
advertised prefix. For example, if you have a public advertised prefix with IP
address range 203.0.113.0/24, you can do the following:
- Create a public delegated prefix with IP address range
203.0.113.0/25from the public advertised prefix. - Create a sub-prefix with IP address range
203.0.113.0/26that has the previous public delegated prefix as its parent. - Create a sub-prefix with IP address range
203.0.113.0/27that has the previous sub-prefix as its parent.
At this point, you cannot create further sub-prefixes that have the
203.0.113.0/27 sub-prefix as a parent.
Console
In the Google Cloud console, go to Bring your own IP.
Click the public delegated prefix that you want to subdivide.
Click Create sub-prefix.
Enter a Name and optional Description for the sub-prefix.
Select a Prefix length for the sub-prefix.
Select IP addresses for the sub-prefix.
Select a Project for the sub-prefix. The IP addresses are made available in this project only.
Click Create.
gcloud
To create a sub-prefix from a public delegated prefix, use the
public-delegated-prefixes delegated-sub-prefixes create
command
gcloud compute public-delegated-prefixes \
delegated-sub-prefixes \
create SUB_PREFIX_NAME \
--range=SUB_PREFIX_RANGE \
--public-delegated-prefix=PDP_NAME \
--public-delegated-prefix-region=PDP_REGION \
--delegatee-project=PROJECT_ID
Replace the following:
SUB_PREFIX_NAME: a name for the sub-prefix that you are creating.SUB_PREFIX_RANGE: the IP address range for the sub-prefix that you are creating.PDP_NAME: the parent public delegated prefix or sub-prefix that contains the sub-prefix you are creating.PDP_REGION: the region of the public delegated prefix or sub-prefix that contains the sub-prefix you are creating.PROJECT_ID: an optional project ID for the sub-prefix. The following describes the behavior for this value:If you specify a value, the IP addresses are available only in the specified project.
If you don't use
--delegatee-project, the IP addresses are available in the same project as the sub-prefix's parent public delegated prefix or sub-prefix.
List prefixes
You can list all public advertised prefixes and public delegated prefixes (including sub-prefixes) in a project.
Console
In the Google Cloud console, go to Bring your own IP.
All public advertised prefixes, public delegated prefixes, and sub-prefixes are displayed.
gcloud
To list public delegated prefixes, including sub-prefixes, use the
public-delegated-prefixes list
command.
gcloud compute public-delegated-prefixes list
Create IP addresses
You must create static external IP address resources before you can use the IP addresses in an IPv4 public delegated prefix or sub-prefix. There are two ways to do this:
Create blocks of IP addresses: You can create blocks of IP addresses from a public delegated prefix's entire range or a subset of it. This is the only supported method for the following:
- Creating IP addresses from public delegated prefixes that don't use enhanced IP address allocation
- Creating global IP addresses
Create single IP addresses: For v2 public delegated prefixes that use enhanced IP address allocation, you can create single IP addresses, choosing a specific address or letting Google Cloud select one automatically.
After you create IP addresses from a public delegated prefix, you can still use the rest of the prefix to create other IP addresses or sub-prefixes.
Create a block of IP addresses
The IP addresses that you create from a public
delegated prefix or sub-prefix can be
regional or global. All IP addresses in a public delegated prefix or
sub-prefix are available; there is no reserved network address or broadcast
address. For example, if you create IP addresses from the entire range of a
/28 public delegated prefix or sub-prefix, 16 IP address resources are
created.
You can list all static external IP addresses. This list includes IP addresses that you have brought to Google Cloud and IP addresses that are provided by Google Cloud.
BYOIP addresses are created with names in a consistent format. For example,
203.0.113.144 is assigned the name address-203-0-113-144.
Console
In the Google Cloud console, go to Bring your own IP.
Click the public delegated prefix or sub-prefix that you want to create IP addresses in.
Click Create addresses.
Select the Prefix length.
Select the range of IP addresses you want to create.
Click Create addresses.
gcloud
To create IP addresses from a public delegated prefix or sub-prefix, use the
public-delegated-prefixes delegated-sub-prefixes create
command.
gcloud compute public-delegated-prefixes \
delegated-sub-prefixes \
create ADDRESSES_NAME \
--create-addresses \
--range=RANGE \
--public-delegated-prefix=PDP_NAME \
--public-delegated-prefix-region=PDP_REGION
Replace the following:
ADDRESSES_NAME: a name for the group of addresses that you are creating.RANGE: the CIDR block to create IP addresses from, which must be a subset of the parent prefix's range. Omit this flag to create IP addresses for the whole range of the parent prefix.PDP_NAME: the public delegated prefix or sub-prefix that you are creating IP addresses for.PDP_REGION: the region of the public delegated prefix or sub-prefix that you are creating IP addresses for.
Create a single IP address
You can create single static IP addresses from v2 regional IPv4 public delegated prefixes or sub-prefixes that use enhanced IP address allocation. Only prefixes created after December 13, 2025 support this feature. To check if a prefix uses enhanced IP address allocation, describe the prefix.
Console
- In the Google Cloud console, go to the IP addresses page.
- Click Reserve external.
- In the Name field, enter an IP address name.
- Select Premium.
- Select IPv4.
- Select Regional.
- Select the Assign from IP collection checkbox.
- Click IP collection, and then select the public delegated prefix that contains the IP address you want to create.
- For IP address, optionally enter a specific IP address to use. To let Google Cloud automatically select an address from the public delegated prefix's CIDR block, omit the IP address.
- Click Reserve.
gcloud
Use the
gcloud compute addresses create command.
gcloud compute addresses create NAME \
--network-tier=PREMIUM \
--ip-collection=PDP_NAME \
--addresses=IP_ADDRESS \
--description=DESCRIPTION \
--region=REGION
Replace the following:
NAME: a name for the group of addresses you are creating.PDP_NAME: the public delegated prefix or sub-prefix that contains the IP addresses you are creating. Must be a v2 regional public delegated prefix withenableEnhancedIpAllocationset to true.IP_ADDRESS: an optional IP address from the parent prefix's range that specifies which address to create. Omit this flag to let Google Cloud automatically select the address to create.DESCRIPTION: an optional description.REGION: the region of the IP addresses to create, which must match the region of the public delegated prefix.