Reputation: 5246
I want to reach Jenkins from both behind the router and the internet.
Pretty straightforward setup:
Internet > Router > Mac > Jenkins
Known items:
From the router, I can see the machine's internal IP, which I'll call "X.X.X.X".
Then there's the Jenkins URL location configuration in Jenkins:
Goals
I want to be able to access the Jenkins site from any machine already behind the router. I thought that I could use the X.X.X.X IP address as the above Jenkins URL but this didn't work.
Second, I want to be able to reach the Jenkins site from outside the router. Then I can configure Jenkins anywhere as well as use web-hooks when there are changes.
I assume I then need to know the IP address of the router but that's about all I know.
How can I accomplish this?
Upvotes: 3
Views: 5867
Reputation: 5246
Here's how to connect to a Jenkins instance on Mac OS X from outside your router, although it's probably very similar on another OS like Windows or Linux.
Give your Jenkins machine a static IP address in Settings. We'll refer to it as jenkins_machine_static_ip
for the purposes of these instructions:
jenkins_machine_static_ip
), and also copy the Subnet Mask, & RouterIn your router's admin panel, assign the same jenkins_machine_static_ip
to the Mac Address of your Jenkins machine.
Access to the router admin panel depends on your router.
You can find your Mac Address on your Jenkins machine as follows:
Configure the Jenkins URL as http://jenkins_machine_static_ip:pick_a_port
, where jenkins_machine_static_ip
is the same one from steps 1&2 and pick_a_port
is any unused port.
router_forwarded_port
) and forwarding it to http://machine_static_ip:pick_a_port
, which you set up in #3.You can now access your Jenkins instance from outside the network by accessing your router's IP and the forwarding port. You can get your router's external IP address here: Router_IP
The address you need to connect to is: Router_IP:router_forwarded_port/
Upvotes: 2