Network Design and Operations
A router that performs NAPT (outside address 198.51.100.7) is configured with port forwarding, a static setting that translates only the destination: "forward traffic arriving at outside TCP port 8080 to port 80 on the inside web server 192.168.1.20." When host 203.0.113.9 on the internet connects from source port 51000 to port 8080 on 198.51.100.7, which is the destination and source of the packets the web server receives?
- ADestination 198.51.100.7:8080, source 203.0.113.9:51000
- BDestination 192.168.1.20:80, source 203.0.113.9:51000
- CDestination 192.168.1.20:80, source 198.51.100.7:51000
Show answer and explanation
Answer: B. Destination 192.168.1.20:80, source 203.0.113.9:51000
With port forwarding, the router rewrites the destination of packets arriving for the outside address and port (198.51.100.7:8080) to the configured inside address and port (192.168.1.20:80). The source is not rewritten, so to the web server the packets appear to come from 203.0.113.9:51000, and its access logs record the client's real address. The server's replies pass through this router, its default gateway, which looks up its translation table and rewrites the source back to 198.51.100.7:8080 before returning them to the client. Connections started from outside have no entry in the translation table under ordinary NAPT and never reach the inside, so this setting is needed to publish a server on the inside.
- A. This is the destination as sent by the client, before the router rewrites it.
- B. Correct. Only the destination is rewritten to the inside server's address and port.
- C. The setting translates only the destination, so the source is not rewritten.