Port forwarding is necessary when a machine on the Internet needs to initiate a connection to a machine that is located behind a firewall or NAT router. If the connection is initiated by the machine behind the firewall, the firewall / router will automatically recognize the response traffic and send it to the machine that opened the connection.
But if the packet arrives at the external interface, and it is not part of such a connection, the router must know what to do with it. By default, he will reject it. But if forwarding is configured for the port, this indicates which internal machine to send it to.
In other words: you need port forwarding, if you want to start the server behind the NAT firewall / router, you do not need it if you just start the client.
Barmar
source share