仅具有内部 IP 地址(无外部 IP 地址)的虚拟机实例可以使用专用 Google 访问通道,从而可以访问 Google API 和服务的外部 IP 地址。数据包的源 IP 地址可以是网络接口的主要内部 IP 地址,也可以是分配给接口的别名 IP 范围内的地址。如果停用专用 Google 访问通道,则虚拟机实例将无法再访问 Google API 和服务,而只能在 VPC 网络内发送流量。
专用 Google 访问通道对具有外部 IP 地址的实例没有影响。根据互联网访问要求,具有外部 IP 地址的实例可以访问互联网。它们不需要任何特殊配置就能将请求发送到 Google API 和服务的外部 IP 地址。
您可以在子网一级启用专用 Google 访问权限;它是 VPC 网络中子网的一项设置。如需为子网启用专用 Google 访问通道并查看相关要求,请参阅配置专用 Google 访问通道。
[[["易于理解","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-07-09。"],[],[],null,["# Private Google Access\n=====================\n\nVM instances that only have internal IP addresses (no external IP addresses) can\nuse Private Google Access. They can reach the external IP addresses of Google\nAPIs and services. The source IP address of the packet can be the primary\ninternal IP address of the network interface or an address in an alias IP range\nthat is assigned to the interface. If you disable Private Google Access, the\nVM instances can no longer reach Google APIs and services; they can only send\ntraffic within the VPC network.\n\nPrivate Google Access has no effect on instances that have external IP\naddresses. Instances with external IP addresses can access the internet,\naccording to the [internet access\nrequirements](/vpc/docs/vpc#internet_access_reqs). They don't need any special\nconfiguration to send requests to the external IP addresses of Google APIs and\nservices.\n\nYou enable Private Google Access on a subnet by subnet basis; it's a setting\nfor subnets in a VPC network. To enable a subnet for\nPrivate Google Access and to view the requirements, see [Configure\nPrivate Google Access](/vpc/docs/configure-private-google-access).\n\nSupported services\n------------------\n\nPrivate Google Access lets you access [Google APIs and\nservices](/vpc/docs/configure-private-google-access#domain-options)\nthat are hosted in Google's production infrastructure.\n\nOther Google services are hosted in VPC networks and can be\naccessed by using the following methods:\n\n- To connect to services that are published using the\n [Service Networking API](/service-infrastructure/docs/service-networking/reference/rest),\n see [private services access](/vpc/docs/private-services-access).\n\n- To connect to services that are published using\n [Private Service Connect](/vpc/docs/configure-private-service-connect-producer), see [Access managed services](/vpc/docs/configure-private-service-connect-services).\n\nExample\n-------\n\nThe following diagram shows an implementation of Private Google Access.\n[](/static/vpc/images/private-google-access.svg) Implementation of Private Google Access (click to enlarge).\n\nThe VPC network has been configured to meet the [DNS, routing,\nand firewall network requirements](/vpc/docs/configure-private-google-access#config)\nfor Google APIs and services. Private Google Access has been enabled on\n`subnet-a`, but not on `subnet-b`.\n\n- `VM A1` can access Google APIs and services, including Cloud Storage,\n because its network interface is located in `subnet-a`, which has\n Private Google Access enabled. Private Google Access applies to the instance\n because it only has an internal IP address.\n\n- `VM B1` **cannot** access Google APIs and services because it only has an\n internal IP address and Private Google Access is disabled for `subnet-b`.\n\n- `VM A2` and `VM B2` can both access Google APIs and services, including\n Cloud Storage, because they each have external IP addresses.\n Private Google Access has no effect on whether or not these instances can\n access Google APIs and services because both have external IP addresses.\n\nWhat's next\n-----------\n\n- To configure Private Google Access, see [Configure\n Private Google Access](/vpc/docs/configure-private-google-access)."]]