title: Jenkins Slave port number for firewall
body: <p>We use Jenkins 1.504 on <strong>Windows</strong>.</p>
  
  <p>We need to have Master and Slave in different sub-networks with firewall in between.
  <br>We can't have ANY to ANY port firewall rules, we must specify <strong>exact</strong> port numbers.</p>
  
  <p>I know the port Master is listening on.</p>
  
  <p>I also see that Slave opens connection to the Master from the arbitrary port dynamically assigned every run, and port on the Master side is also arbitrary.
  <br>I can fix Master's port by specifying it in Manage Jenkins > Configure Global Security > TCP port for JNLP slave agents).</p>
  
  <p>How to fix Slave port?</p>
  
  <p><br>
  <strong><em>UPDATE</em></strong>: Found Connection Mechanism described here: <a href="https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI#JenkinsCLI-Connectionmechanism">https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI#JenkinsCLI-Connectionmechanism</a></p>
  
  <p>I think it might work for us, but still would be better to have fixed-2-fixed ports connection.</p>