[[["易于理解","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-18。"],[],[],null,["# Private NAT\n===========\n\nPrivate NAT enables *private-to-private* address translation\nbetween networks:\n\n- [Private NAT for Network Connectivity Center spokes](/nat/docs/about-private-nat-for-ncc) enables private-to-private network address translation (NAT) for Virtual Private Cloud (VPC) networks that are connected to a Network Connectivity Center hub, which includes private-to-private NAT for traffic between VPC spokes and between VPC spokes and hybrid spokes.\n- [Hybrid NAT](/nat/docs/about-hybrid-nat) enables private-to-private NAT between VPC networks and on-premises or other cloud provider networks that are connected to Google Cloud over Cloud Interconnect or Cloud VPN.\n\nSpecifications\n--------------\n\nThe following sections describe the specifications of\nPrivate NAT. These specifications apply to both\nPrivate NAT for Network Connectivity Center spokes and\nHybrid NAT.\n\n### General specifications\n\n- Private NAT allows outbound connections and the inbound responses to those connections.\n Each Cloud NAT gateway for Private NAT performs source NAT on egress traffic and\n destination NAT for established response packets.\n\n- Private NAT does not support auto mode VPC networks.\n- Private NAT doesn't permit unsolicited inbound requests from connected networks, even if firewall\n rules would otherwise permit those requests. For more information, see [Applicable RFCs](#specs-pvt-nat-rfcs).\n\n- Each Cloud NAT gateway for Private NAT is associated with a single VPC\n network, region, and Cloud Router. The Cloud NAT gateway and\n the Cloud Router provide a control plane---they aren't involved in\n the data plane---so packets don't pass through the Cloud NAT gateway\n or Cloud Router.\n\n Even though a Cloud NAT gateway for Private NAT is\n managed by a Cloud Router, Private NAT doesn't use or depend on the\n Border Gateway Protocol.\n- Private NAT does not support [Endpoint-Independent Mapping](https://tools.ietf.org/html/rfc5128).\n- You cannot use Private NAT to translate a specific primary or secondary IP address range for a given subnet. A Private NAT gateway performs NAT on all IPv4 address ranges for a given subnet or list of subnets.\n- After you create the subnet, you cannot increase or decrease the Private NAT subnet size. However, you can specify multiple Private NAT subnet ranges for a given gateway.\n- Private NAT supports a maximum of 64,000 simultaneous connections per endpoint.\n- Private NAT supports only TCP and UDP. ICMP and other protocols are not supported.\n- A virtual machine (VM) instance in a VPC network can only access destinations in a non-overlapping---not in an overlapping---subnetwork in a connected network.\n\n### Routes and firewall rules\n\nPrivate NAT uses the following routes:\n\n- For Network Connectivity Center spokes, Private NAT uses subnet routes and dynamic routes:\n - For traffic between two VPC spokes attached to a Network Connectivity Center hub that contains only VPC spokes, Private NAT uses the subnet routes exchanged by the attached VPC spokes. For information about VPC spokes, see [VPC spokes overview](/network-connectivity/docs/network-connectivity-center/concepts/vpc-spokes-overview).\n - If a Network Connectivity Center hub contains both VPC spokes and hybrid spokes such as VLAN attachments for Cloud Interconnect, Cloud VPN tunnels, or Router appliance VMs, Private NAT uses the dynamic routes learned by the hybrid spokes through BGP and subnet routes exchanged by the attached VPC spokes. For information about hybrid spokes, see [Hybrid spokes](/network-connectivity/docs/network-connectivity-center/concepts/overview#hybrid_spokes).\n- For Hybrid NAT, Private NAT uses dynamic routes learned by Cloud Router over Cloud Interconnect or Cloud VPN.\n\n\nCloud NGFW firewall rules are applied directly to the network interfaces of\nCompute Engine VMs, not Cloud NAT gateways for Private NAT.\n\nWhen a Cloud NAT gateway for Private NAT provides NAT for a VM's network\ninterface, applicable egress firewall rules are evaluated as packets for that network interface\nbefore NAT. Ingress firewall rules are evaluated after packets have been processed by NAT.\nYou don't need to create any firewall rules specifically for NAT.\n\n\u003cbr /\u003e\n\n### Subnet IP address range applicability\n\n\n\u003cbr /\u003e\n\n| **Important:** In Google Cloud, the terms *subnet* and *IP address range* are not synonyms. Each subnet has one primary IP address range, and, optionally, multiple secondary IP address ranges. For background information essential to understanding subnet IP address range applicability, see the [VPC network overview](/vpc/docs/vpc).\n\n\u003cbr /\u003e\n\nYou can configure a Cloud NAT gateway for Private NAT to provide NAT for the\nfollowing:\n\n\u003cbr /\u003e\n\n- **Primary and secondary IP address ranges of all subnets in the region.** A single Private NAT gateway provides NAT for the primary internal IP addresses and all alias IP ranges of eligible VMs whose network interfaces use a subnet in the region. This option uses exactly one NAT gateway per region.\n- **Custom subnet list**: a single Cloud NAT gateway provides NAT for\n the primary internal IP addresses and all alias IP ranges of eligible VMs whose network\n interfaces use a subnet from a list of specified subnets.\n\n### Bandwidth\n\n\nUsing a Cloud NAT gateway for Private NAT doesn't change the amount of outbound or\ninbound bandwidth that a VM can use. For bandwidth specifications, which vary by\nmachine type, see [Network bandwidth](/compute/docs/network-bandwidth) in the\nCompute Engine documentation.\n\n\u003cbr /\u003e\n\n### VMs with multiple network interfaces\n\n\nIf you configure a VM to have [multiple network\ninterfaces](/vpc/docs/multiple-interfaces-concepts), each interface must be in a\nseparate VPC network.\nConsequently, a\nCloud NAT gateway for Private NAT can only apply to a single network interface\nof a VM. Separate Cloud NAT gateways for Private NAT can provide NAT to the same\nVM, where each gateway applies to a separate interface.\n\n### NAT IP addresses and ports\n\nWhen you create a Private NAT gateway, you must specify a subnet of purpose `PRIVATE_NAT`\nfrom which NAT IP addresses are assigned for the VMs. For more information about Private NAT\nIP address assignment, see [Private NAT IP addresses](/nat/docs/ports-and-addresses#pvt-nat-ip).\n\n\nYou can configure the number of source ports that each Cloud NAT gateway for Private NAT\nreserves on each VM for which it is to provide NAT services. You can\nconfigure [static port allocation](/nat/docs/ports-and-addresses#static-port),\nwhere the same number of ports is reserved for each VM, or\n[dynamic port\nallocation](/nat/docs/ports-and-addresses#dynamic-port), where the number of reserved\nports can vary between the minimum and maximum limits that you specify.\n\nThe VMs for which NAT is to be provided are determined by the\n[subnet IP\naddress ranges](#specs-subnet-ranges) that the gateway is configured to serve.\n\nFor more information about ports, see [Ports](/nat/docs/ports-and-addresses#ports).\n\n\u003cbr /\u003e\n\n### Applicable RFCs\n\nPrivate NAT is a Port Restricted Cone NAT as defined in [RFC 3489](https://www.ietf.org/rfc/rfc3489.txt).\n\n### NAT timeouts\n\nPrivate NAT sets timeouts for protocol connections. For\ninformation about these timeouts and their default values,\nsee [NAT timeouts](/nat/docs/tune-nat-configuration#nat-timeouts).\n\nWhat's next\n-----------\n\n- Set up [Private NAT](/nat/docs/set-up-private-nat).\n- Learn about [Cloud NAT product interactions](/nat/docs/nat-product-interactions).\n- Learn about [Cloud NAT addresses and ports](/nat/docs/ports-and-addresses).\n- Learn about [Cloud NAT rules](/nat/docs/nat-rules-overview).\n- Troubleshoot [common issues](/nat/docs/troubleshooting)."]]