When connecting Jenkins controller and Jenkins agent by means of JNLP, and having a firewall in between, which port(s) do I have to declare in the firewall to be kept open?
For Jenkins controller:
For Jenkins agent:
Which port has to be open for Jenkins master to be able to access Jenkins agent?
When connecting Jenkins master and slave/agent via JNLP, the agent is the one who will establish communication with the master. It's ideal if the agent(s) are behind a firewall or in a private network that doesn't allow incoming connections.
Which port has to be open for Jenkins master to be able to access Jenkins agent?
None, just be sure that the TCP port for JNLP is open on the master (port 9999 in your case)