A new alias port number is allocated from a pool of unused port addresses. This number is added to the table entry. The NAT router then changes the source IP address to the IP address of the outgoing network interface. It also changes the source port number to the alias port number from the table entry. The translated message is then sent through the outgoing network interface.
Messages coming into the outgoing network interface follow the reverse process.
The destination IP address matches the one for the outgoing network interface for the NAT router. The destination port number is used to look up the matching IP and port number. The destination IP address is changed as is the port number in the message using the values from the table. The message is then sent to the local network and the local computer. Neither the source nor the destination computer know about the masquerade due to the address translation.