how to route ftp connection to different jails each one with is own ftp servers

Hi, I have a server with multiple jails using private addresses on the jails and one public IP on the master, so far I only need one jail with ftp so I configure the master host with ftp-proxy and edited the rc.conf with the following lines:

Code:
ftpproxy_enable="YES"
ftpproxy_flags="-R 172.16.13.2 -p 21 -b 68.228.37.157"

and the pf.conf with this:

Code:
nat on bce1 from 172.16.13.0/24 to any -> $public_addr
nat-anchor "ftp-proxy/*"
rdr-anchor "ftp-proxy/*"

that worked for a single jail, a connection to port 21 on IP 68.228.37.157 redirects to jail with internal IP 172.16.13.2 on port 21 and works perfect.

but now how to listen on port 22 (or other rather than 21 since 21 is for the first jail) on IP 68.228.37.157 and redirect the traffic to jail with internal IP 172.16.13.3 on port 21 ?


any ideas

regards.
 
Back
Top