公共 IP 地址可通过互联网路由。在 Google Cloud中,外部 IPv4 和 IPv6 地址始终是公共 IP 地址。
在 VPC 网络中配置子网的主要或次要 IPv4 地址范围时,您还可以使用公共 IPv4 地址作为内部地址。这些地址称为以非公开方式使用的公共 IP 地址。
区域和全球 IP 地址
当您列出或描述项目中的 IP 地址时, Google Cloud会将地址标记为全球或区域级地址,这表示特定地址的使用方式。当您将某地址与区域级资源(例如虚拟机)关联时, Google Cloud 会将该地址标记为区域级地址。区域是指Google Cloud 区域,例如 us-east4 或 europe-west2。
[[["易于理解","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,["# IP addresses\n============\n\nResources such as VM instances and load balancers have IP addresses in\nGoogle Cloud. These IP addresses let Google Cloud resources\ncommunicate with other resources in Google Cloud, in on-premises networks,\nor on the public internet. This page describes the IP address categorization\nused by Google Cloud.\n\nGoogle Cloud uses the following labels to describe different IP address\ntypes. For example, an *internal* IP address is not publicly routed. An\n*external* IP address is a publicly routed IP address. You can assign an\nexternal IP address to the network interface of a Google Cloud VM.\n\nExternal IP address\n\n: External IP addresses are publicly advertised, meaning they are reachable by\n any host on the internet. External IP addresses must be [publicly routable IP\n addresses](https://wikipedia.org/wiki/IP_address#Public_address).\n Resources with external IP addresses can communicate with the public internet.\n\n External IPv4 addresses for resources can be provided by Google, or you can\n [bring your own IP (BYOIP)](/vpc/docs/bring-your-own-ip) addresses to Google Cloud.\n While BYOIP addresses are static external IPv4 addresses, and can be used with\n most resources that support static external IPv4 addresses, there are some\n [exceptions](/vpc/docs/using-bring-your-own-ip#support).\n\n External IPv6 addresses can be provided by Google, or you can BYOIP addresses\n to Google Cloud. IPv6 BYOIP addresses can only be used by forwarding\n rules for external passthrough Network Load Balancers or subnets that can only host VMs.\n For more information, see [IPv6 subnet ranges](/vpc/docs/subnets#ipv6-ranges).\n\n For a list of external IPv4 and IPv6 address ranges that can be provided by\n Google, see\n [Google Cloud external IP ranges](https://www.gstatic.com/ipranges/cloud.json).\n\nInternal IP address\n\n: Internal IP addresses cannot be reached from the internet and are not\n publicly routable.\n\n: Internal IP addresses are local to a VPC network, a\n VPC network connected by using VPC Network Peering, or an\n on-premises network connected to a VPC network by using\n Cloud VPN, Cloud Interconnect, or a Router appliance.\n Resources with internal IP addresses communicate with other resources as if\n they're all on the same private network.\n\n Internal IPv4 addresses can be private IPv4 addresses, or they can be privately\n used public IPv4 addresses. For a list of valid internal IPv4 addresses, see\n [Valid IPv4 ranges](/vpc/docs/subnets#valid-ranges).\n\n Internal IPv6 addresses are unique within Google Cloud. For more\n information, see [IPv6 subnet ranges](/vpc/docs/subnets#ipv6-ranges).\n\n For details about how internal IP addresses are advertised when you connect\n your VPC network to another network, see [Route advertisements\n and internal IP addresses](/vpc/docs/vpc#route-adverts-internal-ip).\n\nPrivate IP address\n\n: Private IP addresses are addresses that [cannot be routed on the\n internet](https://wikipedia.org/wiki/IP_address#Private_addresses).\n\n In Google Cloud, private IP addresses can only be used as internal IP\n addresses within a VPC network or an on-premises network\n connected to a VPC network.\n\n For a list of private IPv4 ranges, see the entries for\n **Private IP address ranges** in the [valid internal IPv4 address\n ranges](/vpc/docs/subnets#valid-ranges) table.\n\n [Unique local addresses\n (ULAs)](https://datatracker.ietf.org/doc/html/rfc4193)\n are private IPv6 addresses. ULAs are used for internal [IPv6 subnet\n ranges](/vpc/docs/subnets#ipv6-ranges).\n\nPublic IP address\n\n: Public IP addresses are internet routable. In Google Cloud,\n external IPv4 and IPv6 addresses are always public IP addresses.\n\n You can also use public IPv4 addresses as internal addresses when you\n configure the primary or secondary IPv4 address range of a subnet in your\n VPC network. These addresses are referred to as [privately\n used public IP addresses](/vpc/docs/subnets#valid-ranges).\n\nRegional and global IP addresses\n--------------------------------\n\nWhen you list or describe IP addresses in your project, Google Cloud\nlabels addresses as global or regional, which indicates how a particular address\nis being used. When you associate an address with a regional resource, such as\na VM, Google Cloud labels the address as regional. Regions are\nGoogle Cloud regions, such as `us-east4` or `europe-west2`.\n\nFor more information about global and regional resources, see [Global, regional,\nand zonal\nresources](/compute/docs/regions-zones/global-regional-zonal-resources) in the\nCompute Engine documentation.\n\n### Summary of IP address types\n\nThe following tables describes examples of different regional and global IP\naddresses.\n\n#### Internal IP addresses\n\nInternal IP addresses are always Premium Tier.\n\n#### External IP addresses\n\nSome External IP addresses can be Standard Tier as well as Premium Tier.\n\nEphemeral and static IP addresses\n---------------------------------\n\nInternal and external IP addresses can be ephemeral or static.\n\nAn ephemeral IP address is an IP address that doesn't persist beyond the life\nof the resource. In general, ephemeral IP addresses are released if you stop or\ndelete the associated resource.\n\nIP addresses can be assigned to resources, such as instances and forwarding\nrules, in the following ways:\n\n- If you don't specify an IP address, Google Cloud automatically assigns an ephemeral IP address.\n- You can specify an IP address by using a reserved static IP address.\n- For VM instances, you can specify an IP address by using a custom ephemeral IP address. This method isn't supported for external IPv4 addresses or for IP addresses of forwarding rules.\n\nReserving a static IP address assigns the address to your project until you\nexplicitly release it. This is useful if you are dependent on a specific IP\naddress for your service and need to prevent another resource from being able to\nuse the address. Static addresses are useful if you need to move an IP address\nfrom one Google Cloud resource to another.\n\nSome services have exceptions to the previous definitions:\n\n- For HA VPN, you cannot manually assign a static IPv4 address to the\n interface of an HA VPN gateway. Cloud VPN creates two\n regional external IPv4 addresses for you when you create the gateway, and those\n addresses remain assigned to the gateway until you delete it.\n\n- For Cloud NAT, when you configure Cloud NAT to automatically\n allocate external IPv4 addresses, those addresses appear as static;\n however, they are deleted if you delete the Cloud NAT gateway or\n if you change the Cloud NAT gateway to use manual addresses.\n\nWhat's next\n-----------\n\n- For more information about reserving static IP addresses, see [Reserve a\n static external IP\n address](/vpc/docs/reserve-static-external-ip-address) or [Reserve a static internal IP\n address](/vpc/docs/reserve-static-internal-ip-address)."]]