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



## nbari (May 9, 2010)

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:


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

and the pf.conf with this:


```
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.


----------



## nbari (May 9, 2010)

this help me to solve the problem: 

http://old.nabble.com/conf-143085:-ftp-proxy(8)-rc(8)-with-multiple-instances-td27275480.html


----------

