HAProxy community

Unable to bind 3000 ports in haproxy

I want to bind 3000 ports in haproxy. Port number ranging from 400001 to 43000. But I am unable to do so. After adding the frontend and backend in haproxy.cfg file, I am unable to restart haproxy. It gives me the error Starting proxy mp40772: cannot bind socket [0.0.0.0:40772]. Could you please let me know if it is possible to bind 3000 ports in haproxy

Sure, there are no limits within haproxy. Make sure you are starting haproxy as root though, so that it can adjust ulimit’s, etc. Also make sure you don’t have any other OS level security features interfering with this, like SELinux.

SELinux is disabled. What other OS level feature do i need to check. How do I make this work

You need to start haproxy as root.

Yes, i do start it via root user sudo service haproxy restart.

I found the solution for this. In the file /etc/sysctl.conf we need to add the following and then reboot the server for making the chnages. This will map the ports

net.ipv4.ip_local_port_range = 1024 65003