TechKnowSurge
CompTIA Security+ 3.2 CompTIA Security+ 4.5 CompTIA Security+ 2.5
InteractiveSecurityFree

Where Does the Reply Go?

Two PCs share one public address. A reply arrives on public port 61002, a probe arrives on port 3389: where does the NAT gateway send each one?

⚑ Complete this interactive to capture a CTF flag worth 5 points.

About this interactive

Most internal networks use private addresses, the RFC 1918 ranges set aside in 1996 to stretch the supply of IPv4. Millions of networks use the same private ranges, so those addresses cannot be routed on the internet. Network address translation swaps them for a public one on the way out. What most people call NAT is really port address translation (PAT): the whole network shares one public address. When 192.168.0.26 opens a connection to a web server, the gateway records the inside address and port, gives the conversation a port on the public address, and rewrites the packet's source. When the reply comes back to that public port, the gateway looks it up, rewrites the destination to 192.168.0.26 and the original port, and sends it in. Two PCs using the same inside port still get different public ports, which is how the replies stay apart. The security side follows from the table. A host on the internet that tries to reach in finds no entry for its packet, so the gateway has nowhere to send it. Traffic can go out and its replies come back, and little else gets in: NAT behaves much like a stateful firewall. A NAT gateway is whatever device does this job, often a firewall dedicated to it.

What you'll learn

Aligned to

CompTIA Security+
3.2 Given a scenario, apply security principles to secure enterprise infrastructure.
4.5 Given a scenario, modify enterprise capabilities to enhance security.
2.5 Explain the purpose of mitigation techniques used to secure the enterprise.

Key terms

Network Address Translation
NAT
A method that maps private IP addresses to a public IP address, allowing multiple devices to share a single public IP.
Port Address Translation
PAT
A form of NAT that maps multiple devices on a private network to a single public IP address by differentiating each connection using unique source port numbers. PAT is the most common NAT implementation and is what enables an entire home or office network to share a single public IP address.
NAT Table
A translation table maintained by a NAT-enabled router that records mappings between inside local and inside global addresses to ensure return traffic is correctly forwarded.
NAT Gateway
A dedicated or purpose-configured device that performs network address translation, often implemented as a firewall assigned specifically to that function.
Private IP Address
An IP address from a reserved range (Class A: 10.0.0.0–10.255.255.255, Class B: 172.16.0.0–172.31.255.255, Class C: 192.168.0.0–192.168.255.255) used within private networks and not routable on the public internet.
RFC 1918
The internet standard that defines three private IPv4 address ranges reserved for use within private networks and not routable on the public internet.

Topics

Network Address Translation Port Address Translation Nat Gateway Private Ip Address Interactive Predict

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →