<p>Your configuration is wrong. Here you add <code>http://192.168.99.100:8080/</code> is a local Jenkins URL. Github does not connect with the local URL. Also you give the wrong webhook-URL.</p>

<p>Please add your public IP of Jenkins in your webhook like <code>http://35.24.128.75:8080/"</code> And GitHub webhook payload url is like <code>http://35.24.128.75:8080/github-webhook"</code></p>

<p>for Full webhook configuration please watch this video: <a href="https://www.youtube.com/watch?v=wsnq9uGAWkM&amp;t=460s" rel="nofollow noreferrer">https://www.youtube.com/watch?v=wsnq9uGAWkM&amp;t=460s</a></p>

CC BY-SA 4.0
2019-02-08T05:24:05.747Z
2019-02-08T05:24:05.747Z
Subhash
<p>You are on the correct track with port forwarding - you will need to tell your router to forward traffic from your public IP address to your Jenkins server on a specific port.</p>

<p>The 192.168.x.x address is one of the Private address ranges - nobody from the external web can see any of your servers on these addresses. See <a href="https://en.wikipedia.org/wiki/Private_network" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Private_network</a> for more information on private addresses if you are interested.</p>

<p>You probably have a modem/router to connect to your ISP. It does the work of converting all the traffic from the 192.168.x.x addresses into something that can be used in the internet. When a response comes back from the internet to your computer, the router recognizes that it is a response and sends it to the computer that initiated the request.</p>

<p>But if a request comes from the outside world that is not a response, the router does not know where to send it - it just drops it. This is where port forwarding comes in. You can tell your router that if it sees a request coming in on port 8080 then it should send the request to the server at address 192.168.x.x and port xxxx. </p>

<p>Note that the inbound port and the server port do not have to be the same. This can provide a level of security through obscurity - since most developers tend to have servers running on port 8080, some hacker scripts will try that port as a matter of course. You might want to have some random port number on your router going to port 8080 internally. (This is still not good security, but it is better than nothing.)</p>

<p>Edit: I left out one important thing: you need to tell GitHub to hit your public IP address in order for the port forwarding to work. You can find out just the IP by going to <a href="https://www.google.com/search?q=whats+my+ip" rel="nofollow noreferrer">https://www.google.com/search?q=whats+my+ip</a> and Google will tell you what your public IP is. </p>

<p>If you are connected to your ISP 24x7 then your public IP probably doesn't change that often (if ever), and this will probably work for you.</p>

<p>If your IP changes regularly (or you just want to go to the next level) you can look into a public dynamic dns (which requires a local client) to give you a DNS name that always points to your IP address (e.g. noip.com - I haven't used them in over a decade so I don't know if they are good or not, but at least it will give you a starting point at looking at this).</p>

CC BY-SA 4.0
2019-02-09T11:36:17.767Z
Thank you very much!
I managed to use a program named "ngrok" that can do port forwarding to my local jenkins server and it fixed it!
Tomerhek
CC BY-SA 4.0
2019-02-07T20:39:19.600Z
2019-02-08T00:50:22.580Z
2019-02-08T00:50:22.580Z
Andrew Monkhouse
<p>Started to learn DevOps 3 days ago, so I have a lot to learn!</p>

<p>I have a jenkins running on docker toolbox container and I can access it via 192.168.99.100:8080.
I configured a job and managed to use "Build Now" to get the files from my GitHub repository, the git is public.</p>

<p>I want my job to build automatically after a commit is made in my GitHub but it does not work.</p>

<p>I configured a webhook in my GitHub settings but after I commit, the "Webhooks" page display an error "Last delivery was not successful. Couldn't connect to server."
In the URL inside the webhook I configured "<a href="http://192.168.99.100:8080/jenkins-name/" rel="nofollow noreferrer">http://192.168.99.100:8080/jenkins-name/</a>"
Is it wrong to use that URL? I am not sure about it.</p>

<p>In jenkins, I am using the GitHub plugin and I configured in "Configure System"  a GitHub Server with my credentials and the "Test connection" button was verified.
In the job, configured my GitHub repository in the "Source Code Management" section and in the "Build Triggers" section I checked "GitHub hook trigger for GITScm polling".</p>

<p>I read it have something with port forwarding..
Will appreciate any help!</p>

<docker><jenkins><git><github>
Connecting GitHub to Jenkins running on docker toolbox
Tomerhek
# Connecting GitHub to Jenkins running on docker toolbox

(Asked by: username_0 on 2019-02-07)

Started to learn DevOps 3 days ago, so I have a lot to learn!

I have a jenkins running on docker toolbox container and I can access it via 192.168.99.100:8080.
I configured a job and managed to use "Build Now" to get the files from my GitHub repository, the git is public.

I want my job to build automatically after a commit is made in my GitHub but it does not work.

I configured a webhook in my GitHub settings but after I commit, the "Webhooks" page display an error "Last delivery was not successful. Couldn't connect to server."
In the URL inside the webhook I configured "<http://192.168.99.100:8080/jenkins-name/>"
Is it wrong to use that URL? I am not sure about it.

In jenkins, I am using the GitHub plugin and I configured in "Configure System" a GitHub Server with my credentials and the "Test connection" button was verified.
In the job, configured my GitHub repository in the "Source Code Management" section and in the "Build Triggers" section I checked "GitHub hook trigger for GITScm polling".

I read it have something with port forwarding..
Will appreciate any help!

**Tags:** docker, jenkins, git, github


---

## 2 answers

### Answer by username_1 on 2019-02-08. Score: 1

Your configuration is wrong. Here you add `http://192.168.99.100:8080/` is a local Jenkins URL. Github does not connect with the local URL. Also you give the wrong webhook-URL.

Please add your public IP of Jenkins in your webhook like `http://35.24.128.75:8080/"` And GitHub webhook payload url is like `http://35.24.128.75:8080/github-webhook"`

for Full webhook configuration please watch this video: <https://www.youtube.com/watch?v=wsnq9uGAWkM&t=460s>


---

### Answer by username_2 on 2019-02-07. Score: 0

You are on the correct track with port forwarding - you will need to tell your router to forward traffic from your public IP address to your Jenkins server on a specific port.

The 192.168.x.x address is one of the Private address ranges - nobody from the external web can see any of your servers on these addresses. See <https://en.wikipedia.org/wiki/Private_network> for more information on private addresses if you are interested.

You probably have a modem/router to connect to your ISP. It does the work of converting all the traffic from the 192.168.x.x addresses into something that can be used in the internet. When a response comes back from the internet to your computer, the router recognizes that it is a response and sends it to the computer that initiated the request.

But if a request comes from the outside world that is not a response, the router does not know where to send it - it just drops it. This is where port forwarding comes in. You can tell your router that if it sees a request coming in on port 8080 then it should send the request to the server at address 192.168.x.x and port xxxx.

Note that the inbound port and the server port do not have to be the same. This can provide a level of security through obscurity - since most developers tend to have servers running on port 8080, some hacker scripts will try that port as a matter of course. You might want to have some random port number on your router going to port 8080 internally. (This is still not good security, but it is better than nothing.)

Edit: I left out one important thing: you need to tell GitHub to hit your public IP address in order for the port forwarding to work. You can find out just the IP by going to <https://www.google.com/search?q=whats+my+ip> and Google will tell you what your public IP is.

If you are connected to your ISP 24x7 then your public IP probably doesn't change that often (if ever), and this will probably work for you.

If your IP changes regularly (or you just want to go to the next level) you can look into a public dynamic dns (which requires a local client) to give you a DNS name that always points to your IP address (e.g. noip.com - I haven't used them in over a decade so I don't know if they are good or not, but at least it will give you a starting point at looking at this).

> **Comments:**
> **username_0**: Thank you very much! I managed to use a program named "ngrok" that can do port forwarding to my local jenkins server and it fixed it!  

---

