[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-05 (世界標準時間)。"],[],[],null,["# Internal ranges overview\n========================\n\nInternal ranges let you reserve blocks of internal IP addresses and specify\nhow those addresses can be used. You can use internal ranges to help you manage\nVirtual Private Cloud (VPC) network topology as networks grow more complex with\nfeatures like [VPC Network Peering](/vpc/docs/vpc-peering),\n[Shared VPC](/vpc/docs/shared-vpc),\n[Cloud VPN](/network-connectivity/docs/vpn/concepts/overview), and\n[Cloud Interconnect](/network-connectivity/docs/interconnect/concepts/overview).\n\nSpecifications\n--------------\n\n- An internal range resource represents an internal IPv4 or IPv6 CIDR block that is allocated from within a VPC network.\n- When you reserve an internal range, you configure the following:\n - If the range can be used by Google Cloud resources in its VPC network or is reserved for external use.\n - How the range can be used if VPC Network Peering is configured.\n - If the range can overlap with subnets or routes in its parent VPC network.\n - If the range's address block or overlap behavior can be modified.\n- By default, you can't reserve an internal range that contains IP addresses that are used by other Google Cloud resources in the range's VPC network.\n- If you enable overlap with subnets, routes, or both, you can create internal ranges with CIDR blocks that overlap with the IP address range of the specified resource types.\n- You can't create Google Cloud resources that use IP addresses from an existing internal range, unless you explicitly associate the resource with the internal range (for subnets) or allow overlapping (for routes).\n- If an internal range is immutable, you can only modify the range's description. If the range is mutable (the default), you can modify the range's CIDR block, overlap behavior, and description. Immutability can't be changed after the range is created.\n\nFor example, consider a mutable internal range for `10.0.0.0/24` with no overlap\nspecified.\n\nIf you try to create a subnet in the same VPC network that uses\nthe range `10.0.0.0/25`, the subnet creation fails, unless you\n[associate the subnet with the internal range](/vpc/docs/create-use-internal-ranges#create-subnets-with-ranges).\n\nIf you try to create a route in the same VPC network that uses\nthe range `10.0.0.0/25`, the route creation fails, unless you update the\ninternal range by [setting the `overlaps`\nproperty](/vpc/docs/create-use-internal-ranges#update-overlap) to\n`OVERLAP_ROUTE_RANGE`.\n\nPeering types\n-------------\n\nThe peering type of an internal range specifies the range's behavior with\nrespect to VPC Network Peering. The peering type can be one of the\nfollowing:\n\n- `FOR_SELF`: the internal range can only be used in the VPC\n network where it was created. The range is accessible from its associated\n VPC network and peers of that VPC network.\n Peers of peer networks, however, cannot use this range. This is the default\n setting.\n\n- `FOR_PEER`: the internal range can only be associated with resources in peer\n networks. No resource within the range's parent VPC network\n can be associated with the range, but resources in peer networks can.\n\n- `NOT_SHARED`: the internal range can only be associated with resources in\n the network where the range was created, without sharing the range with its\n peers. A peered network can't use the internal range in a way that is\n visible to the parent VPC network. A peered network can use\n the same range if the peering type is `NOT_SHARED` in both networks.\n\nUsage types\n-----------\n\nThe usage type of an internal range resource specifies whether the allocated\nCIDR block can be associated with other Google Cloud resources in its\nparent VPC network. The usage type for an internal range can be\none of the following:\n\n- `FOR_VPC`: the range can be associated with other Google Cloud\n resources in its parent VPC network. This is the default\n setting.\n\n- `EXTERNAL_TO_VPC`: the range cannot be associated with other\n Google Cloud resources in its parent VPC network.\n\n- `FOR_MIGRATION`: the range can be used to [migrate a subnet\n range](#for-migration), including from one peered VPC network\n to another.\n\n### Migrating IPv4 subnet ranges\n\nTo migrate a CIDR range from one subnet to another, you must delete the subnet\nand then recreate it. Normally, when you delete a subnet, its CIDR range is\nreleased and can be used by any other resource. To reserve the CIDR range during\na migration---after the original subnet is deleted but before the new subnet\nis created---you can [reserve an IPv4 internal range that has the `FOR_MIGRATION`\nusage type](/vpc/docs/create-use-internal-ranges#create-migration-range).\n\nAn internal range for migration specifies a CIDR range, a source subnet, and a\ntarget subnet.\n\n- The IPv4 CIDR range must match or contain the source subnet range.\n- The source and target subnets can be in the same project or in different projects.\n- The source subnet must be in the same project as the internal range resource.\n- The target subnet doesn't need to exist at the time that you create the internal range.\n\nWhen you delete the source subnet, the CIDR range can only be assigned to a\nsubnet that matches the target subnet.\n\nAfter you've migrated the subnet, you can delete the internal range.\n\nInternal ranges with usage type `FOR_MIGRATION` must have the peering type\n`FOR_SELF`.\n\nExample use cases\n-----------------\n\nThe following table describes use cases for internal ranges with\ndifferent usage and peering combinations. IPv6 internal ranges have specific\nusage and peering requirements and don't support all of the use cases listed\nhere.\n\nIPv4 address allocation strategies\n----------------------------------\n\nWhen you reserve an IPv4 internal range, you can either specify a CIDR block\nor let Google Cloud allocate one automatically. For automatic allocation,\nyou specify a prefix length and optional target CIDR blocks. Google Cloud\naccounts for existing IP address allocations and allocates the internal range a\nfree CIDR block of the chosen size from within the target or default CIDR\nblocks.\n\nIf you use automatic allocation, you can specify the allocation strategy\nthat Google Cloud uses to select a free block.\nAllocation strategies are only available for automatically allocated IPv4\ninternal ranges. The following table describes the allocation strategies\nthat you can choose from:\n\nFor example, suppose that you want to reserve a `/24` CIDR block from the target\nblock `10.0.0.0/8`. Within the target block, only the following IP address\nranges are available: `10.1.0.0/25`, `10.2.0.0/16`, and `10.3.0.0/23`. The\nfollowing list describes the blocks that might be selected for each allocation\nstrategy:\n\n- `RANDOM`: Google Cloud randomly determines any available `/24` block, such as `10.2.179.0/24`.\n- `FIRST_AVAILABLE`: Google Cloud finds the lowest available `/24` block, which is `10.2.0.0/24`.\n- `RANDOM_FIRST_N_AVAILABLE`: Suppose you specify `3` for N. Google Cloud creates a set of the three lowest available `/24` blocks---`10.2.0.0/24`, `10.2.1.0/24`, and `10.2.2.0/24`. From that set, Google Cloud randomly chooses one of the three blocks, such as `10.2.2.0/24`.\n- `FIRST_SMALLEST_FITTING`: Google Cloud finds the smallest available blocks (highest prefix) that can contain the specified prefix of `/24`. The smallest available block is `10.3.0.0/23`. Google Cloud allocates the lowest block from within that range, which is `10.3.0.0/24`.\n\nQuota\n-----\n\nThere is a limit to how many internal range resources you can create in a single\nproject. For more information, see the per-project\n[quotas](/vpc/docs/quota#internal-ranges-quota) in the VPC documentation.\n\nWhat's next\n-----------\n\n- [Create and use internal ranges](/vpc/docs/create-use-internal-ranges)"]]