I've just installed Jenkins with its default configs on a Centos 7 physical box.

Port 8080 is open on the firewall:

sudo iptables -L -n
ACCEPT     tcp  --              tcp dpt:8080

It also looks like Jenkins is actually listening on all interfaces:

sudo netstat -an | grep "LISTEN "
tcp6       0      0 :::8080                 :::*                    LISTEN

I can curl localhost:8080 locally (from the Centos box) without a problem, but from anywhere else in the network I get a Connection refused.

Am I missing something?

  • looks like it's only listening in ipv6. Sep 1, 2017 at 5:50
  • It's listening on IPV4 now. Still can't connect.
    – Panos
    Sep 1, 2017 at 15:20
  • could you disable selinux and try again? setenforce 0 as root sets it in permissive mode temporarily. Sep 1, 2017 at 16:48

2 Answers 2


The above looks like Jenkins is defaulting to ipv6 only.

Try the following, this will probably fix your problem:

run: $ /sbin/sysctl net.ipv6.bindv6only

You will probably get an output with value net.ipv6.bindv6only = 1.

If this is the case, you will need to disable the setting:

sudo /sbin/sysctl net.ipv6.bindv6only=0

After the command above you will get an answer like net.ipv6.bindv6only = 0, restart Jenkins: sudo systemctl restart jenkins and try to connect to Jenkins again.

If this worked for you, you should put this in a sysctl config-file. Because this is not a persistent fix. After a reboot the setting you just have modified will be defaulted to 1 again.

Check /etc/sysctl.conf and /etc/sysctl.d/* and add net.ipv6.bindv6only = 0 in order to make this setting permanent and run sudo sysctl -p or restart after changing it.

  • In Centos the bind can only show ipv6 entry while it is in reality bound to both ipv4 and ipv6.
    – Elias
    Sep 1, 2017 at 13:05
  • 6
    Apparently Java was configured to use IPV6 by default, so I forced it to use IPV4 by adding JENKINS_JAVA_OPTIONS="$JENKINS_JAVA_OPTIONS -Djava.net.preferIPv4Stack=true" to /etc/sysconfig/jenkins and now I do get the correct answer from netstat: tcp 0 0* LISTEN . I still can't connect to Jenkins, though. Do I need to specify a hostname for Jenkins or does it listen on 8080 regardless of the hostname?
    – Panos
    Sep 1, 2017 at 14:16
  • I'm coming to the conclusion that the culprit here is the firewall/IP tables, no Jenkins. Even when I spin up a web server on port 8081 (or even 80) I don't get connection from the outside.
    – Panos
    Sep 1, 2017 at 17:28
  • @Panos since it is a Centos 7 machine, could you try the following (unless you disabled the firewalld service and use plain iptables): firewall-cmd --zone=public --add-port=8080/tcp --permanent firewall-cmd --zone=public --add-service=http --permanent firewall-cmd --reload
    – Bombaci
    Sep 1, 2017 at 21:39
  • Nothing :( Neither 80 nor 8080 working. Actually, even with the firewall down and iptables disabled I still don't get to connect through those ports. I can still ping the server and ssh into it... This is insane...
    – Panos
    Sep 1, 2017 at 22:25

@panos : it worked after setting JENKINS_JAVA_OPTIONS="$JENKINS_JAVA_OPTIONS -Djava.net.preferIPv4Stack=true" in /etc/sysconfig/jenkins then sudo systemctl restart jenkins. also i removed ipv6 entries in /etc/hosts not sure if the file needs to be edited, later i checked "netstat -tulpen" can see java is listening on tcp..

  • 1
    In case of an Ubuntu based machine the Jenkins settings will be on /etc/default/jenkins
    – gkephorus
    Aug 30, 2021 at 16:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .