HOW-TO: Using G6 FTP Server behind OpenBSD

Things covered in this doc: * OpenBSD 3.0 or greater * pf * G6 Ftp * FlashFXP NOTE: This document can be applied too all packet filters and/or port redirectors. Since the days when i installed OpenBSD i've been trying to set up my Windows server to act as an ftp server behind the OBSD. It went all well untill users that were behind nat too emailed me about not getting any directory listing. So i started scouring the net hoping that i would find some answers. But since i didn't,i tackled the problem myself and here are the results. The sollution was to redirect a range of ports from the OpenBSD to the ftpserver and make G6 use only use those ports with the external address. So on to the inner workings. Step 1: Modifying nat.conf on the OpenBSD Firstly you need to choose a port range (example: 43000->44000) that you will redirect. Then you need to insert those 2 lines in nat.conf: # fxp0=external NIC # 192.168.1.1 = internal windows G6 ftp server rdr on fxp0 proto tcp from any to any port 21 -> 192.168.1.1 port 21 # Control port rdr on fxp0 proto tcp from any to any port 43000:44000 -> 192.168.1.1 port 43000:* # data ports Step 2: Modifying G6 server on the Windows Box In G6 select menu Setup -> Multi IP settings. Check the box reading "Passive mode IP" and enter your external ip. "Passive port range" should be set too 43000 - 44000. Step 3: Final preparements Reload the nat rules on your bsd box by invoking the command "pfctl -N /etc/nat.conf". Try it! It worked like a charm for me and all my users now access my server without a problem :). One more thing that i noticed is that configuring FlashFXP with the same settings as G6 I now can get the directory listings on ftp servers behind nat too. Enjoy! ## Original Contact: DarkSniper (root@darks.mine.nu) ## ## Original Website: http://darks.mine.nu ## ## Current Mirror Contact: thegleek (thegleek@thegleek.com) ## ## Current Mirror Website: http://www.thegleek.com/quickies/G6.html ##