Private NAT를 사용하면 Network Connectivity Center 스포크와 함께 작동하여 다음 네트워크 간 네트워크 주소 변환(NAT)을 수행하는 Private NAT 게이트웨이를 만들 수 있습니다.
가상 프라이빗 클라우드(VPC) 네트워크: 이 시나리오에서는 연결하려는 VPC 네트워크가 Network Connectivity Center 허브에 VPC 스포크로 연결됩니다.
VPC 네트워크 및 Google Cloud외부의 네트워크: 이 시나리오에서는 하나 이상의 VPC 네트워크가 Network Connectivity Center 허브에 VPC 스포크로 연결되고 하이브리드 스포크를 통해 온프레미스 또는 기타 클라우드 제공업체 네트워크에 연결됩니다.
사양
일반 Private NAT 사양 외에도 Network Connectivity Center 스포크용 Private NAT에는 다음 사양이 포함됩니다.
Private NAT는 type=PRIVATE의 NAT 구성을 사용하여 서브넷 IP 주소 범위가 겹치는 네트워크가 통신할 수 있도록 합니다. 그러나 중복되지 않는 서브넷만 서로 연결할 수 있습니다.
Network Connectivity Center 허브를 참조하여 커스텀 NAT 규칙을 만들어야 합니다.
NAT 규칙은 Private NAT가 연결된 네트워크 간의 트래픽에 NAT를 수행하는 데 사용하는 PRIVATE_NAT 용도의 서브넷에서 NAT IP 주소 범위를 지정합니다.
Private NAT가 적용되는 서브넷 범위에서 VM 인스턴스를 만들면 대상 스포크가 게이트웨이와 동일한 Network Connectivity Center 허브에 있는 경우 이 VM 인스턴스의 모든 이그레스 트래픽이 게이트웨이에서 변환됩니다. Private NAT는 트래픽을 Private NAT 게이트웨이와 동일한 리전 내의 대상 스포크뿐만 아니라 여러 리전 간에도 변환합니다.
Private NAT 게이트웨이는 단일 VPC 네트워크의 단일 리전에 있는 서브넷 IP 주소 범위와 연결됩니다.
즉, 하나의 VPC 네트워크에 생성된 Private NAT 게이트웨이는 VM이 게이트웨이와 동일한 리전에 있더라도 Network Connectivity Center 허브의 다른 스포크에 있는 VM에 NAT 서비스를 제공하지 않습니다.
VPC 네트워크 간 트래픽
다음 추가 사양은 VPC 네트워크(Inter-VPC NAT) 간 트래픽에 적용됩니다.
두 VPC 네트워크 간에 Inter-VPC NAT를 사용 설정하려면 각 VPC 네트워크를 Network Connectivity Center 허브의 VPC 스포크로 구성해야 합니다.
VPC 스포크 간에 겹치는 IP 주소 범위가 없어야 합니다. 자세한 내용은 VPC 스포크 만들기를 참조하세요.
Private NAT 게이트웨이와 연결된 Network Connectivity Center 허브에는 VPC 스포크가 2개 이상 있어야 하며, 이 중 하나는 Private NAT 게이트웨이의 VPC 네트워크여야 합니다.
Inter-VPC NAT는 VPC 네트워크 피어링을 사용해 연결된 VPC 네트워크 간이 아닌 Network Connectivity Center VPC 스포크 간에만 NAT를 지원합니다.
VPC 네트워크와 기타 네트워크 간 트래픽
다음 추가 사양은 VPC 네트워크와 Google Cloud외부 네트워크 간의 트래픽에 적용됩니다.
소스 VPC 네트워크는 Network Connectivity Center 허브의 VPC 스포크로 구성되어야 합니다.
VPC 스포크와 Google Cloud외부의 목적지 네트워크 간에 연결을 설정하려면 하이브리드 스포크를 동일한 Network Connectivity Center 허브에 연결해야 합니다. 자세한 내용은 하이브리드 스포크와 VPC 스포크 간의 연결 설정을 참조하세요.
동일한 Network Connectivity Center 허브에서 VPC 스포크 및 하이브리드 스포크 사용 관련 요구사항에 관한 자세한 내용은 VPC 스포크를 사용한 경로 교환을 참조하세요.
기본 구성 및 워크플로
다음 다이어그램은 두 VPC 스포크 간의 트래픽에 대한 기본 Private NAT 구성을 보여줍니다.
Inter-VPC NAT 변환 예시(확대하려면 클릭)
이 예시에서 Private NAT는 다음과 같이 설정됩니다.
us-east1 리전에서 subnet-a의 모든 IP 주소 범위에 적용되도록 pvt-nat-gw 게이트웨이가 vpc-a에 구성되었습니다. vpc-a의 subnet-a에 있는 가상 머신(VM) 인스턴스는 pvt-nat-gw의 NAT IP 범위를 사용하여 vpc-a의 subnet-a가 vpc-b의 subnet-c와 겹치더라도, vpc-b의 subnet-b에 있는 VM으로 트래픽을 전송할 수 있습니다.
vpc-a 및 vpc-b 모두 Network Connectivity Center 허브의 스포크로 구성됩니다.
pvt-nat-gw 게이트웨이는 동일한 Network Connectivity Center 허브에서 VPC 스포크로 구성된 VPC 네트워크 간에 NAT를 제공하도록 구성됩니다.
워크플로 예시
이전 다이어그램에서 vpc-a의 subnet-a에 있는 내부 IP 주소 192.168.1.2가 있는 vm-a는 vpc-b의 subnet-b에 있는 내부 IP 주소 192.168.2.2가 포함된 vm-b에서 업데이트를 다운로드해야 합니다. 두 VPC 네트워크 모두 동일한 Network Connectivity Center 허브에 VPC 스포크로 연결됩니다. vpc-b에 vpc-a의 서브넷과 겹치는 또 다른 서브넷 192.168.1.0/24가 포함되어 있다고 가정해 보겠습니다. vpc-a의 subnet-a에서 vpc-b의 subnet-b와 통신하려면 다음과 같이 vpc-a에 Private NAT 게이트웨이 pvt-nat-gw를 구성해야 합니다.
Private NAT 서브넷: Private NAT 게이트웨이를 구성하기 전에 PRIVATE_NAT 목적의 Private NAT 서브넷(예: 10.1.2.0/29)을 만듭니다. 이 서브넷이 동일한 Network Connectivity Center 허브에 연결된 VPC 스포크의 기존 서브넷과 겹치지 않는지 확인합니다.
nexthop.hub가 Network Connectivity Center 허브 URL과 일치하는 NAT 규칙입니다.
subnet-a의 모든 주소 범위에 대한 NAT입니다.
다음 표에는 앞의 예시에 명시된 네트워크 구성이 요약되어 있습니다.
네트워크 이름
네트워크 구성요소
IP 주소/범위
지역
vpc-a
subnet-a
192.168.1.0/24
us-east1
vm-a
192.168.1.2
pvt-nat-gw
10.1.2.0/29
vpc-b
subnet-b
192.168.2.0/24
us-west1
vm-b
192.168.2.2
subnet-c
192.168.1.0/24
vm-c
192.168.1.3
Network Connectivity Center 스포크용 Private NAT는 포트 예약 절차를 따라 네트워크의 각 VM에 다음 NAT 소스 IP 주소와 소스 포트 튜플을 예약합니다. 예를 들어 Private NAT 게이트웨이는 vm-a를 통해 64개의 소스 포트(10.1.2.2:34000~10.1.2.2:34063)를 예약합니다.
VM이 TCP 프로토콜을 사용하여 목적지 포트 80의 업데이트 서버 192.168.2.2에 패킷을 전송하면 다음과 같은 결과가 발생합니다.
VM이 다음 속성으로 요청 패킷을 전송합니다.
소스 IP 주소: 192.168.1.2, VM의 내부 IP 주소
소스 포트: 24000, VM의 운영체제에서 선택한 임시 소스 포트
대상 주소: 192.168.2.2, 업데이트 서버의 IP 주소
목적지 포트: 80, 업데이트 서버에 대한 HTTP 트래픽에 대한 목적지 포트
프로토콜: TCP
pvt-nat-gw 게이트웨이는 이그레스에 소스 네트워크 주소 변환(SNAT 또는 소스 NAT)을 수행하여 요청 패킷의 NAT 소스 IP 주소와 소스 포트를 재작성합니다.
NAT 소스 IP 주소: 10.1.2.2, VM의 예약된 NAT 소스 IP 주소 및 소스 포트 튜플 중 하나
소스 포트: 34022, VM의 예약된 소스 포트 튜플 중 하나에서 가져온 사용되지 않은 소스 포트
대상 주소: 192.168.2.2, 변경되지 않음
목적지 포트: 80, 변경되지 않음
프로토콜: TCP, 변경되지 않음
업데이트 서버는 다음과 같은 속성과 함께 pvt-nat-gw 게이트웨이에 도착하는 응답 패킷을 전송합니다.
소스 IP 주소: 192.168.2.2, 업데이트 서버의 내부 IP 주소
소스 포트: 80, 업데이트 서버의 HTTP 응답
대상 주소: 10.1.2.2, 요청 패킷의 원래 NAT 소스 IP 주소와 일치
목적지 포트: 34022, 요청 패킷의 소스 포트와 일치
프로토콜: TCP, 변경되지 않음
pvt-nat-gw 게이트웨이는 응답 패킷에 목적지 네트워크 주소 변환(DNAT)을 수행하여 다음 속성의 업데이트를 요청하는 패킷이 VM에 전달되도록 응답 패킷의 대상 주소와 목적지 포트를 재작성합니다.
[[["이해하기 쉬움","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-04(UTC)"],[],[],null,["# Private NAT for Network Connectivity Center spokes\n==================================================\n\nPrivate NAT lets you create a Private NAT\ngateway that works in conjunction with Network Connectivity Center\nspokes to perform network address translation (NAT) between the following\nnetworks:\n\n- Virtual Private Cloud (VPC) networks: In this scenario, the VPC networks that you want to connect are attached to a Network Connectivity Center hub as VPC spokes.\n- VPC networks and networks outside of Google Cloud: In this scenario, one or more VPC networks are attached to a Network Connectivity Center hub as VPC spokes and connected to your on-premises or other cloud provider networks through hybrid spokes.\n\nSpecifications\n--------------\n\nIn addition to the [general Private NAT specifications](/nat/docs/private-nat#pvt-nat-specs),\nPrivate NAT for Network Connectivity Center spokes has the following\nspecifications:\n\n- Private NAT uses a NAT configuration of `type=PRIVATE` to let networks with overlapping subnet IP address ranges communicate. However, only non-overlapping subnets can connect to each other.\n- You need to create a custom NAT rule by referencing a Network Connectivity Center hub. The NAT rule specifies a NAT IP address range from a subnet of purpose `PRIVATE_NAT` that Private NAT uses to perform NAT on traffic between your connected networks.\n- When you create a VM instance in a subnet range where the Private NAT applies, all egress traffic from this VM instance is translated by the gateway if the destination spoke is in the same Network Connectivity Center hub as the gateway. Private NAT translates traffic to destination spokes within the same region as the Private NAT gateway as well as across regions.\n- A Private NAT gateway is associated with subnet IP address ranges in a single region in a single VPC network. This means a Private NAT gateway created in one VPC network doesn't provide NAT services to VMs in other spokes of the Network Connectivity Center hub, even if the VMs are in the same region as the gateway.\n\n### Traffic between VPC networks\n\nThe following additional specifications apply for traffic between\nVPC networks (Inter-VPC NAT):\n\n- To enable Inter-VPC NAT between two VPC networks, each VPC network must be configured as a VPC spoke of a Network Connectivity Center hub. You must ensure that there are no overlapping IP address ranges across your VPC spokes. For more information, see [Create a VPC spoke](/network-connectivity/docs/network-connectivity-center/how-to/working-with-hubs-spokes#create-vpc-spoke).\n- The Network Connectivity Center hub associated with the Private NAT gateway must have at least two VPC spokes, where one of the VPC spokes is the VPC network of the Private NAT gateway.\n- Inter-VPC NAT supports NAT between Network Connectivity Center VPC spokes only, and not between VPC networks connected using VPC Network Peering.\n\n### Traffic between VPC networks and other networks\n\nThe following additional specifications apply for traffic between\nVPC networks and networks outside of Google Cloud:\n\n- The source VPC network must be configured as a VPC spoke of a Network Connectivity Center hub.\n- A hybrid spoke must be attached to the same Network Connectivity Center hub to establish connectivity between the VPC spoke and the destination network outside of Google Cloud. For more information, see [Establishing connectivity between hybrid spokes and VPC spokes](/network-connectivity/docs/network-connectivity-center/concepts/dynamic-route-exchange-with-vpc-spokes#connectivity-between-hybrid-and-vpc-spokes).\n\nFor information about the requirements for using VPC spokes and\nhybrid spokes in the same Network Connectivity Center hub, see\n[Route exchange with VPC spokes](/network-connectivity/docs/network-connectivity-center/concepts/dynamic-route-exchange-with-vpc-spokes).\n\nBasic configuration and workflow\n--------------------------------\n\nThe following diagram shows a basic Private NAT configuration\nfor traffic between two VPC spokes:\n[](/static/nat/images/inter-vpc-nat-flow.png) Inter-VPC NAT translation example (click to enlarge).\n\nIn this example, Private NAT is set up as follows:\n\n- The `pvt-nat-gw` gateway is configured in `vpc-a` to apply to all the IP address ranges of `subnet-a` in the `us-east1` region. Using the NAT IP ranges of `pvt-nat-gw`, a virtual machine (VM) instance in `subnet-a` of `vpc-a` can send traffic to a VM in `subnet-b` of `vpc-b`, even though `subnet-a` of `vpc-a` overlaps with `subnet-c` of `vpc-b`.\n- Both `vpc-a` and `vpc-b` are configured as spokes of a Network Connectivity Center hub.\n- The `pvt-nat-gw` gateway is configured to provide NAT between VPC networks that are configured as VPC spokes in the same Network Connectivity Center hub.\n\n### Example workflow\n\nIn the preceding diagram, `vm-a` with the internal IP address `192.168.1.2` in\n`subnet-a` of `vpc-a` needs to download an update from `vm-b` with the internal\nIP address `192.168.2.2` in `subnet-b` of `vpc-b`. Both the VPC\nnetworks are connected to the same Network Connectivity Center hub as VPC\nspokes. Assume that `vpc-b` contains another subnet `192.168.1.0/24` that overlaps\nwith the subnet in `vpc-a`. For `subnet-a` of `vpc-a` to communicate with `subnet-b`\nof `vpc-b`, you need to configure a Private NAT gateway, `pvt-nat-gw`,\nin `vpc-a` as follows:\n\n- Private NAT subnet: Before configuring the Private NAT\n gateway, create a Private NAT subnet of purpose `PRIVATE_NAT`,\n for example, `10.1.2.0/29`. Ensure that this subnet doesn't overlap\n with an existing subnet in any of the VPC spokes attached to the\n same Network Connectivity Center hub.\n\n- A NAT rule whose `nexthop.hub` matches the Network Connectivity Center hub URL.\n\n- NAT for all address ranges of `subnet-a`.\n\nThe following table summarizes the network configuration specified in the preceding\nexample:\n\nPrivate NAT for Network Connectivity Center spokes follows the\n[port reservation procedure](/nat/docs/ports-and-addresses#port-reservation-procedure)\nto reserve the following NAT source IP address\nand source port tuples for each of the VMs in the network. For example, the\nPrivate NAT gateway reserves 64 source ports for `vm-a`:\n`10.1.2.2:34000` through `10.1.2.2:34063`.\n\nWhen the VM uses the TCP protocol to send a packet to the update server\n`192.168.2.2` on destination port `80`, the following occurs:\n\n1. The VM sends a request packet with these attributes:\n\n - Source IP address: `192.168.1.2`, the internal IP address of the VM\n - Source port: `24000`, the ephemeral source port chosen by the VM's operating system\n - Destination address: `192.168.2.2`, the update server's IP address\n - Destination port: `80`, the destination port for HTTP traffic to the update server\n - Protocol: TCP\n2. The `pvt-nat-gw` gateway performs source network address translation (SNAT or\n source NAT) on egress, rewriting the request\n packet's NAT source IP address and source port:\n\n - NAT source IP address: `10.1.2.2`, from one of the VM's reserved NAT source IP address and source port tuples\n - Source port: `34022`, an unused source port from one of the VM's reserved source port tuples\n - Destination address: `192.168.2.2`, unchanged\n - Destination port: `80`, unchanged\n - Protocol: TCP, unchanged\n3. The update server sends a response packet that arrives on the\n `pvt-nat-gw` gateway with these attributes:\n\n - Source IP address: `192.168.2.2`, the update server's internal IP address\n - Source port: `80`, the HTTP response from the update server\n - Destination address: `10.1.2.2`, which matches the original NAT source IP address of the request packet\n - Destination port: `34022`, which matches the source port of the request packet\n - Protocol: TCP, unchanged\n4. The `pvt-nat-gw` gateway performs destination network address translation\n (DNAT) on the response packet, rewriting the response packet's destination address\n and destination port so that the packet is delivered to the VM that requested the update with the following attributes:\n\n - Source IP address: `192.168.2.2`, unchanged\n - Source port: `80`, unchanged\n - Destination address: `192.168.1.2`, the internal IP address of the VM\n - Destination port: `24000`, matching the original ephemeral source port of the request packet\n - Protocol: TCP, unchanged\n\nWhat's next\n-----------\n\n- Set up [Private NAT for Network Connectivity Center spokes](/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)."]]