# \[Solved\] Cannot bind socket

**URL:** <https://discourse.haproxy.org/t/solved-cannot-bind-socket/3180>\
**Category:** Help!\
**Created:** [November 5, 2018, 7:48am UTC](https://discourse.haproxy.org/t/solved-cannot-bind-socket/3180 "2018-11-05T07:48:20Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Tinnick](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@Tinnick](https://discourse.haproxy.org/u/Tinnick)\
**Post date:** [November 7, 2018, 12:31am UTC](https://discourse.haproxy.org/t/solved-cannot-bind-socket/3180/4 "2018-11-07T00:31:36Z")

</div>

Thanks Guys I was able to solve the problem.  
Lukas you were right. It is the kernel giving me this message.

Output of “haproxy -vv”:

```auto
[root@haproxy ~]# haproxy -vv
HA-Proxy version 1.5.18 2016/05/10
Copyright 2000-2016 Willy Tarreau <willy@haproxy.org>

Build options :
  TARGET = linux2628
  CPU = generic
  CC = gcc
  CFLAGS = -O2 -g -fno-strict-aliasing -DTCP_USER_TIMEOUT=18
  OPTIONS = USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_OPENSSL=1 USE_PCRE=1

Default settings :
  maxconn = 2000, bufsize = 16384, maxrewrite = 8192, maxpollevents = 200

Encrypted password support via crypt(3): yes
Built with zlib version : 1.2.7
Compression algorithms supported : identity, deflate, gzip
Built with OpenSSL version : OpenSSL 1.0.2k-fips 26 Jan 2017
Running on OpenSSL version : OpenSSL 1.0.2k-fips 26 Jan 2017
OpenSSL library supports TLS extensions : yes
OpenSSL library supports SNI : yes
OpenSSL library supports prefer-server-ciphers : yes
Built with PCRE version : 8.32 2012-11-30
PCRE library supports JIT : no (USE_PCRE_JIT not set)
Built with transparent proxy support using: IP_TRANSPARENT IPV6_TRANSPARENT IP_FREEBIND

Available polling systems :
      epoll : pref=300, test result OK
       poll : pref=200, test result OK
     select : pref=150, test result OK
Total: 3 (3 usable), will use epoll.

```

I found an article saying I have to modify the settings on selinux.  
Having done that, all available ports became bind-able.

“setsebool -P haproxy\_connect\_any=1”

article:

> <https://stackoverflow.com/questions/34793885/haproxy-cannot-bind-socket-0-0-0-08888>

Many thanks,  
Julian

---

_[View the full topic](https://discourse.haproxy.org/t/solved-cannot-bind-socket/3180)._
