Binding TCP port ranges to backend port ranges

Hi, I’d like to bind multiple internet TCP ports to multiple TCP ports internally. can that be achieved in a single frontend and backend pair?
Something like this:

frontend tcp12300_12399
  mode tcp
  bind *:12300-12399 ssl crt /usr/local/etc/certs/
  default_backend tcp_backend_12300_12399

backend tcp_backend_12300_12399
  mode tcp
  server tcpserver tcp-server:12300-12399

I’d like to have traffic on port 12300 to go to port 12300 on tcp-server and 12301 to 12301 on tcp-server and so on until port 12399.

thanks for any help in advance!

Yes, you just DON’T specify any destination ports specification in the backend configuration.

backend tcp_backend_12300_12399
  mode tcp
  server tcpserver tcp-server

Specify check port XX for the port used in health-checks, if you are doing health checking.

thanks a lot. i really appreciate it.

1 Like