Why does NAT GW get two IP address EIP and Private IP Address

0

Hi

I need some help in understanding the use case of Elastic IP Address and Private IP Address that gets assigned to the NAT GW.

1- When a NAT GW is launched, it gets two IPs Elastic IP Address and Private IP Address. What IP does it use as the SRC IP when it forwards the traffic to the Internet Gateway. From Documentation "The NAT gateway sends the traffic to the internet gateway, using its Elastic IP address as the source IP address."

2- What IP [EIP or Private IP] does the Internet Gateway use for translation? From Documentation: "For communication using IPv4, the internet gateway also performs network address translation (NAT)"

If I try to combine above points then does Internet Gateway translate the EIP of the NAT GW to a publicly routable address as the src before sending it out on the internet?

질문됨 일 년 전328회 조회
2개 답변
1

I suggest to check this blog, it explains the packet flow and how the Source IP gets changed at each hop. See the below statement and the diagram along with the table showing packet flow.

AWS NAT Gateways performs Port Address Translation. AWS NAT Gateways performs source-NAT, and translates the IP address of the source with its private IP address. Then, the Internet Gateway (IGW) translates the private IP address of the NAT Gateway to the Elastic IP address associated with the NAT Gateway

profile pictureAWS
전문가
답변함 일 년 전
1

To add some explanation to the above blog, when the packet reaches NAT-GW, The NAT-GW translates the source IP address to its private IP address then it forwards the packet to IGW. When the packet reaches the IGW, it performs another source IP translation where it uses the EIP, that's associated with the NAT-GW, as the packet source IP.

AWS
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인