问题描述
我想从路由器和互联网后面都到达Jenkins.
I want to reach Jenkins from both behind the router and the internet.
非常简单的设置:
Internet>路由器> Mac> Jenkins
Internet > Router > Mac > Jenkins
已知项目:
-
从路由器上,我可以看到机器的内部IP,我将其称为"X.X.X.X".
From the router, I can see the machine's internal IP, which I'll call "X.X.X.X".
然后在Jenkins中进行Jenkins URL位置配置:
Then there's the Jenkins URL location configuration in Jenkins:
目标
-
我希望能够从任何计算机访问Jenkins站点已经在路由器后面.我以为我可以使用X.X.X.X IP地址作为上述Jenkins URL,但这无效.
I want to be able to access the Jenkins site from any machinealready behind the router. I thought that I could use the X.X.X.X IPaddress as the above Jenkins URL but this didn't work.
第二,我希望能够从外部访问Jenkins网站路由器.然后我可以在任何地方配置Jenkins以及使用发生变化时会发出网页响声.
Second, I want to be able to reach the Jenkins site from outside therouter. Then I can configure Jenkins anywhere as well as useweb-hooks when there are changes.
我假设我需要知道路由器的IP地址,但这仅是我所知道的.
I assume I then need to know the IP address of the router but that's about all I know.
我该怎么做?
推荐答案
以下是从路由器外部连接到Mac OS X上的Jenkins实例的方法,尽管在其他操作系统(例如Windows或Linux)上可能非常相似.
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.
-
在设置"中为您的Jenkins机器提供一个静态IP地址.出于以下说明的目的,我们将其称为
jenkins_machine_static_ip
:
- 转到设置> 网络> 高级... > TCP/IP
- 复制 IPv4地址(它将是您的
jenkins_machine_static_ip
),并复制子网掩码,并& 路由器 - 选择配置IPv4 > 手动
- 填写复制的信息,然后选择确定"
- Go to Settings > Network > Advanced... > TCP/IP
- Copy the IPv4 Address (it'll be your
jenkins_machine_static_ip
), and also copy the Subnet Mask, & Router - Select Configure IPv4 > Manually
- Fill in copied info and select 'OK'
在路由器的管理面板中,将相同的jenkins_machine_static_ip
分配给Jenkins机器的 Mac地址.
In 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.
您可以在Jenkins机器上找到您的 Mac地址,如下所示:
You can find your Mac Address on your Jenkins machine as follows:
- 转到设置> 网络> 高级... > 硬件
- Go to Settings > Network > Advanced... > Hardware
将 Jenkins URL 配置为http://jenkins_machine_static_ip:pick_a_port
,其中jenkins_machine_static_ip
与步骤1和步骤2中的相同,pick_a_port
是任何未使用的端口.
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.
- 可以通过以下路径在您的Jenkins Web门户中配置 Jenkins URL :
Jenkins > 管理Jenkins > 配置系统> Jenkins位置 - 查看原始问题中的图片.
- The Jenkins URL can be configured in your Jenkins web portal by following this path:
Jenkins > Manage Jenkins > Configure System > Jenkins Location - See the image in the original question.
您现在可以通过访问路由器的IP和转发端口从网络外部访问Jenkins实例.您可以在此处获取路由器的外部IP地址: Router_IP
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
您需要连接的地址是:Router_IP:router_forwarded_port/
The address you need to connect to is: Router_IP:router_forwarded_port/
这篇关于从另一台计算机访问Mac OS X上的Jenkins的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!