Access Jenkins by IP address from "outside the network" - macos

I am using Jenkins on MacOS (Monterey) and I want to be able to access my Jenkins from any (outside) network using my ip address.
I have updated the --httpListenAddress to 0.0.0.0 and restarted Jenkins.
I have checked for port 8080 to be open to inbound traffic.
I have been able to access this Jenkins from devices on the same network but not from an outside network.
I was able to achieve everything I wanted when using an AWS EC2 instance (by adding security group rules) but not able to do the same for a local Jenkins on my machine.
Any help/advice would be great! (Maybe without using a 3rd party service?)
Thank you.

Related

Not able to enter Jenkins (Mac) using network IP

I'm trying to setup Jenkins on my MacMini server. I've installed it using official docs and everything works, except accessing Jenkins using local network ip. I
'm able to enter using localhost:8080, but not able to reach it from 192.168.1.X:8080 from other network device or even from the same mac server.
I've already tried instructions from this question
Accessing Jenkins on Mac OS X from another machine
but no effect.
It looks like Jenkins does not open to external connections or something. My browser finds Jenkins address, but it says "Not able to connect", just like if there is no such port (8080).
I've created a test http server, just to see if my Mac is reachable and ports are open, and everything works fine. Im able to enter an http, ssh, VNC using network address, but not able to enter Jenkins using it's port.
Does anybody knows why?

How to login to Jenkins from any network

I’m an absolute beginner when it comes to setting up a Jenkins environment but I have just installed Jenkins on a MAC v10.15.5 using home-brew and would like the capability to:
Open a web browser
Login to Jenkins from any machine on any network
Trigger a job.
I’m able to do this using a different machine on the same network but unable to do this using a machine on a different network. I changed the "httpListenAddress" value within the jenkins-lts.plist file to 0.0.0.0 to allow the web interface to be accessible from anywhere as mentioned at https://www.macminivault.com/installing-jenkins-on-macos/ but apart from that I’m not sure where to go from here.
I’ve heard about Apache Tomcat but not sure if it's necessary for what I need to do. If anyone can provide instructions / safe approaches about how to login to the Jenkins environment on my MAC from any network that would be appreciated.
To get jenkins web interface use $JENKINS_HOST_IP:8080 (by default jenkins uses port 8080) and then make first-run-configure.
Login to Jenkins from any machine on any network - it depends on network topology, what is used in your organisation. So, to reach jenkins host from any network where should be allowed traffic from/into network where jenkins host is placed.
Trigger a job - where are a lot of triggers you can use. Take a look at official documentation here

SonarQube on windows - can only view locally

I have a windows server 2016 machine which I have Jenkins running on. I wanted to install SonarQube. So have downloaded v7.1
I have managed to start sonarqube on the machine and can view the webserver at http://localhost:9000
I tried to view the page on a different machine using the IP address and port 9000, but this doesn't connect. Looking in the sonar.properties file I can see
Binding IP address. For servers with more than one IP address, this property specifies which
address will be used for listening on the specified ports.
By default, ports will be used on all IP addresses associated with the server. sonar.web.host=http://xx.xxx.xxxx.xxx
If I use http:// then sonarqube starts, but I can't see sonarqube from any other machine, if I don't use http:// (so just the ip) then it won't start with a bind error.
Has anyone experience of setting this up on windows?
Turns out it was something a lot simpler, the machine is being run on azure and there was no port 9000 endpoint

SSH connect from local windows VM to Azure windows VM

I want to have a SSH connection from my local windows machine or VM on my computer to Azure windows server VM. I tried Cygwin and Putty but both of them gave timeout connection. I used public ip address and opened port 22 on Azure VM.
I will appreciate if some one can give me any hints or links.
There are multiple firewalls that can be the reason here. Fist you must have a rule on the server to allow incoming SSH requests (port 22). Then you need to configure the NSG(Network security group) to allow incoming on port 22. If it still doesn't work, you need to verify that you are allowed to do an outgoing SSH request from your computer.
Thanks for suggestions, I found the problem which was the host machine IP address(ipconfig) (where is a local VM inside domain) was different from the IP address that communicate outside the domain to internet. I was set in NSG of Azure VM to only accept this IP and because of that it gave time-out error. After changing the IP it works.

Accessing Jenkins on Mac OS X from another machine

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?
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:
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'
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.
You can find your Mac Address on your Jenkins machine as follows:
Go to Settings > Network > Advanced... > Hardware
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.
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.
Set up port forwarding on your router by picking an arbitrary router port (we'll call it 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/

Resources