Hi.

On 18.08.22 20:40, Roberto Carna wrote:
Dear all, I have to change my haproxy.cfg file in order to enable two
FTP connections to the same server, with these requirements:

FTP server IP: 10.10.1.10

1st FTP service:
FTP Control: port 21
FTP Data: port 11000 to 11010

2nd FTP service:
FTP Control: port 2100
FTP Data: 11000 to 10010 (same range as the first service)

In the haproxy.cfg I tried this:

listen ftp-control-1
         bind 10.10.1.1:21
         mode tcp
         option tcplog
          server FTP 10.10.1.10:21 check 21

listen ftp-control-2
         bind 10.10.1.1:2100
         mode tcp
         option tcplog
          server FTP 10.10.1.10:21 check 2100

listen ftp-data-1-2   <--- The same config for FTP data because they
use the same port range
         bind 10.10.1.1:11000-11010
         mode tcp
         option tcplog
         server FTP 10.10.1.10 check

But it doesn't work.

What do you have in the logs or at start time in the output?
I assume you will get something similar like "port already in use".

Is my config correct or not?

Is it correct if I use the same FTP data port range for both services
on the same server?

Well the "bind" implies that haproxy bind to that ports, you should see this with "netstat -tulpn".

I think you will need different listening (bind) ports for the second server.

See https://docs.haproxy.org/2.6/configuration.html#4.2-bind

Thanks and greetings!

Robert

Regards
Alex

Reply via email to