Search code examples
network-programmingportcommunicationnagiosnrpe

Who needs to open port - client or server?


In network communication if PC1 is sending request to perform task on PC2 then PC2 respond with result to PC1, who (PC1 or PC2) needs to open port? or both needs to open port?

I am setting up nagios Core with NRPE and NSClient++ and I am unclear which system is required to open port. and what port numbers are required to open on client and server?


Solution

    • They both need to open ports.
    • Port numbers need to be chosen from available ports (typically > 1024).
    • Client needs to know the Server's port number in order to initiate the communication.

    I don't know anything regarding your environment or use case. But above 3 lines hold for any kind of socket communication.