I had a practice question about a NAT-enabled router with outside address 24.34.112.235 and inside network 192.168.1/24 and three inside hosts .1, .2 and .3. The three hosts all open two connections to 128.119.40.86 port 80.
The NAT table of the router was given as
NAT Translation Table
WAN Side LAN Side
24.34.112.235, 4000 192.168.1.1, 3345
24.34.112.235, 4001 192.168.1.1, 3346
24.34.112.235, 4002 192.168.1.2, 3445
24.34.112.235, 4003 192.168.1.2, 3446
24.34.112.235, 4004 192.168.1.3, 3545
24.34.112.235, 4005 192.168.1.3, 3546
My question is regarding the answer. I understand the IP addresses. However, are the port numbers randomly chosen or does the order of 3345, 3346, 3445, etc. have a sort of logic given behind them?
What are the requirements on hosts and routers choosing port numbers for this situation?
Is there any reason the WAN-side port numbers couldn't be 6000 to 6005, for example? Or the LAN-side port numbers be 1234 to 1239?