1
1
I have a TCP client and server program that I made. My question is, when running the client and server on two separate machines that go through a different firewalled router over the internet, does it matter which router has ports forwarded? Ex. Can just the router used by the client machine have the correct TCP ports forwarded and the client server connection be established?
No: the client's router is irrelevant. Assuming (as is standard practice) that the client initiates the connection, then port forwarding on the client side plays no role whatsoever, for both requests and replies. In fact, the outgoing port is a high-number port randomly picked among free ports, it has no significance. It is only the server's router which must be configured to forward incoming connections on ports so and so to the correct machine running the requested service. – MariusMatutiae – 2014-09-10T08:26:35.650