[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-19。"],[],[],null,["# Create IPv4 sub-prefixes and IPv4 addresses\n===========================================\n\nThis page describes how to divide your IPv4 public delegated prefix and create\nBYOIP addresses to use with Google Cloud resources. You can create IPv4\nBYOIP addresses from a public delegated prefix or sub-prefix.\n\nIf you want to divide an IPv6 public delegated prefix, see [Create IPv6\nsub-prefixes](/vpc/docs/create-ipv6-sub-prefixes).\n\nBefore you begin\n----------------\n\n1. Create an IPv4 [public advertised prefix](/vpc/docs/create-pap).\n2. Create an IPv4 [public delegated prefix](/vpc/docs/create-pdp).\n\n### Roles\n\n\nTo get the permissions that\nyou need to complete the tasks in this guide,\n\nask your administrator to grant you the\n\n\n[Compute Public IP Admin](/iam/docs/roles-permissions/compute#compute.publicIpAdmin) (`roles/compute.publicIpAdmin`)\nIAM role on your project.\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nYou might also be able to get\nthe required permissions through [custom\nroles](/iam/docs/creating-custom-roles) or other [predefined\nroles](/iam/docs/roles-overview#predefined).\n\nCreate sub-prefixes\n-------------------\n\nYou can divide a public delegated prefix into smaller IP address ranges by\ncreating a sub-prefix. A sub-prefix is a public delegated prefix that has a\npublic delegated prefix parent.\n\nA sub-prefix name can't be changed without deleting and recreating the resource.\nFor this reason, we recommend that you create generic names that won't need to\nchange---for example, `sub-203-0-113-0-28`, where `sub` denotes the resource\ntype and `203-0-113-0-28` denotes the specific prefix and prefix length.\n\nA public delegated prefix can be sub-delegated up to three times from a public\nadvertised prefix. For example, if you have a public advertised prefix with IP\naddress range `203.0.113.0/24`, you can do the following:\n\n- Create a public delegated prefix with IP address range `203.0.113.0/25` from the public advertised prefix.\n- Create a sub-prefix with IP address range `203.0.113.0/26` that has the previous public delegated prefix as its parent.\n- Create a sub-prefix with IP address range `203.0.113.0/27` that has the previous sub-prefix as its parent.\n\nAt this point, you cannot create further sub-prefixes that have the\n`203.0.113.0/27` sub-prefix as a parent. \n\n### Console\n\n1. In the Google Cloud console, go to **Bring your own IP**.\n\n [Go to Bring your own IP](https://console.cloud.google.com/networking/byoip)\n2. Click the public delegated prefix that you want to subdivide.\n\n3. Click **Create sub-prefix**.\n\n4. Enter a **Name** and optional **Description** for the sub-prefix.\n\n5. Select a **Prefix length** for the sub-prefix.\n\n6. Select **IP addresses** for the sub-prefix.\n\n7. Select a **Project** for the sub-prefix. The IP addresses are made\n available in this project only.\n\n8. Click **Create**.\n\n### gcloud\n\nTo create a sub-prefix from a public delegated prefix, use the\n[`public-delegated-prefixes delegated-sub-prefixes create`\ncommand](/sdk/gcloud/reference/compute/public-delegated-prefixes/delegated-sub-prefixes/create) \n\n```\ngcloud compute public-delegated-prefixes \\\n delegated-sub-prefixes \\\n create SUB_PREFIX_NAME \\\n --range=SUB_PREFIX_RANGE \\\n --public-delegated-prefix=PDP_NAME \\\n --public-delegated-prefix-region=PDP_REGION \\\n --delegatee-project=PROJECT_ID\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eSUB_PREFIX_NAME\u003c/var\u003e: a name for the sub-prefix that you\n are creating.\n\n- \u003cvar translate=\"no\"\u003eSUB_PREFIX_RANGE\u003c/var\u003e: the IP address range for the\n sub-prefix that you are creating.\n\n- \u003cvar translate=\"no\"\u003ePDP_NAME\u003c/var\u003e: the parent public delegated prefix or\n sub-prefix that contains the sub-prefix you are creating.\n\n- \u003cvar translate=\"no\"\u003ePDP_REGION\u003c/var\u003e: the region of the public delegated prefix\n or sub-prefix that contains the sub-prefix you are creating.\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: an optional project ID for the\n sub-prefix. The following describes the behavior for this value:\n\n - If you specify a value, the IP addresses are available only in the\n specified project.\n\n - If you don't use `--delegatee-project`, the IP addresses are\n available in the same project as the sub-prefix's parent public\n delegated prefix or sub-prefix.\n\nList prefixes\n-------------\n\nYou can list all public advertised prefixes and public delegated prefixes\n(including sub-prefixes) in a project. \n\n### Console\n\n1. In the Google Cloud console, go to **Bring your own IP**.\n\n [Go to Bring your own IP](https://console.cloud.google.com/networking/byoip)\n2. All public advertised prefixes, public delegated prefixes, and\n sub-prefixes are displayed.\n\n### gcloud\n\nTo list public delegated prefixes, including sub-prefixes, use the\n[`public-delegated-prefixes list`\ncommand](/sdk/gcloud/reference/compute/public-delegated-prefixes/list). \n\n```\ngcloud compute public-delegated-prefixes list\n```\n\nCreate IP addresses\n-------------------\n\nWhen you create addresses from a public delegated prefix or sub-prefix, you\ncannot further sub-divide that prefix.\n\nThe [IP addresses](/vpc/docs/ip-addresses) that you create from a public\ndelegated prefix or sub-prefix are static external IP addresses and can be\nregional or global. All IP addresses in the public delegated prefix or\nsub-prefix are made available; there is no reserved network address or broadcast\naddress. For example, if you create IP addresses from a `/28` public delegated\nprefix or sub-prefix, 16 IP address resources are created.\n\nYou can [list all static external IP\naddresses](/compute/docs/ip-addresses/reserve-static-external-ip-address#list_ip).\nThis list includes IP addresses that you have brought to Google Cloud\nand IP addresses that are provided by Google Cloud.\n\nBYOIP addresses are created with names in a consistent format. For example,\n`203.0.113.144` is assigned the name `address-203-0-113-144`. \n\n### Console\n\n1. In the Google Cloud console, go to **Bring your own IP**.\n\n [Go to Bring your own IP](https://console.cloud.google.com/networking/byoip)\n2. Click the public delegated prefix or sub-prefix that you want to create\n IP addresses in.\n\n3. Click **Create addresses**.\n\n4. Select the **Prefix length**.\n\n5. Select the range of **IP addresses** you want to create.\n\n6. Click **Create addresses**.\n\n### gcloud\n\nTo create IP addresses from a public delegated prefix or sub-prefix, use the\n[`public-delegated-prefixes delegated-sub-prefixes create`\ncommand](/sdk/gcloud/reference/compute/public-delegated-prefixes/delegated-sub-prefixes/create). \n\n```\ngcloud compute public-delegated-prefixes \\\n delegated-sub-prefixes \\\n create ADDRESSES_NAME \\\n --create-addresses \\\n --public-delegated-prefix=PDP_NAME \\\n --public-delegated-prefix-region=PDP_REGION\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eADDRESSES_NAME\u003c/var\u003e: a name for the group of addresses\n that you are creating.\n\n- \u003cvar translate=\"no\"\u003ePDP_NAME\u003c/var\u003e: the public delegated prefix or sub-prefix\n that you are creating IP addresses for.\n\n- \u003cvar translate=\"no\"\u003ePDP_REGION\u003c/var\u003e: the region of the public delegated prefix\n or sub-prefix that you are creating IP addresses for.\n\nWhat's next\n-----------\n\n- [Manage BGP announcement (v2)](/vpc/docs/manage-bgp-announcement)"]]