How do you setup FTP server based off of a share?

Discussion in 'Tomato Firmware' started by JC Santiago, Apr 22, 2014.

  1. JC Santiago

    JC Santiago Network Newbie Member


    I am new to tomato and would appreciate some guidance.

    I have an old PC that I would like to use as a file server. Using my router I would like to setup an FTP server and simply point it to a share on that PC

    How would I go about doing that? Can tomato even do this? I am running ver 117 of shibby's tomato usb
  2. Grimson

    Grimson Networkin' Nut Member

    I'm using Toastmans build but it should be similar:
    Under Administration->CIFS Client mount the share on the PC, the go to USB and NAS->FTP Server and point the Directories to the appropriate places on the share.

    You could also set up an FTP Server on the PC and just forward the needed ports from the router, this way you can spare the router some work and (depending on the server software you use) have much more control/options than the rather basic FTP server on the router offers.
  3. koitsu

    koitsu Network Guru Member

    Note #1: My below comments apply only if you plan on making this FTP server accessible from the Internet. If you only plan on making this available to things on your LAN, then ignore everything below.

    Note #2: If you choose the latter of @Grimson 's choices, make sure you properly forward ports for both passive and active modes. An extremely large number of people when setting up FTP servers do not do this correctly because they don't understand the underlying protocol. FTP is also TCP-only (lots of people get this wrong too).

    I've mentioned in the past the proper way to do this, and when NAT is involved it requires that the FTP server software let you assign a port range for passive mode (and you should pick a very small range, something like 32 ports if possible; do not pick a humongous (24K) range!

    The below is taken from an actual production FTP server that I ran for 15+ years. The firewall rule is a single rule because the FTP server was public-facing on a dedicated IP address, but the FTP port methodology/nuances are explained in the comments (read slowly, don't skim):

    Hope this helps. (It just never ceases to amaze me how many public FTP servers are broken in this regard...)
  4. JC Santiago

    JC Santiago Network Newbie Member

    So what you're saying is that i have to use port forwarding. I can't just use the server on the router and point it to a share.
  5. koitsu

    koitsu Network Guru Member

    Nope, that's not what I'm saying at all. Quoting myself:

    @Grimson offered two solutions: 1) using the router, and 2) using a PC. "The latter" refers to his 2nd solution.

    I'm not sure what the behaviour of the built-in FTP server is with regards to Internet-accessible FTP. If it doesn't poke holes in the firewall for you (it would need to for passive mode), then you will have to do so yourself manually (and not through the Port Forwarding GUI; you can't forward a port to the router itself). You could try it and find out! :D If it doesn't work, there could be lots of reasons why (including but not limited to your ISP blocking connections destined to TCP port 21).
  6. JC Santiago

    JC Santiago Network Newbie Member

    i saw that it supports cifs so I believe i can do it.
  7. koitsu

    koitsu Network Guru Member

    Talking about the situation where you use your Tomato router for the FTP server and the "old PC" for storage (i.e. your Tomato router will mount a CIFS/SMB share on your old PC, and your Tomato router will run the FTP server):

    CIFS/SMB is just the over-network protocol used to, in layman's terms, mount a filesystem on your Tomato router. It has nothing to do with the FTP protocol, which is for file transfer via a completely unrelated methodology. FTP just lets you transfer files between System A and System B, storing them on whatever filesystems are available on System A or System B -- doesn't matter if it's CIFS, NTFS, ext3, ZFS, or anything else. FTP doesn't care about the filesystem (doesn't matter if it's a CIFS/SMB share, a local disk using NTFS, a local disk using ext3, a local disk using ZFS, a USB stick using ext4, etc...).

    Just wanna be clear here since you said "I see it supports CIFS so I think it's possible", when CIFS has nothing to do with FTP directly.

    As for the FTP part of the picture: I just looked under the USB and NAS / FTP Server menu on my own router, and one of the pull-down choices for Enable FTP Server is "Yes, WAN and LAN", so that should (hopefully!) punch relevant holes in the firewall for FTP passive mode (it would definitely work in active mode regardless, since by default all outbound traffic is permitted on Tomato, it's only inbound that's filtered).
  8. JC Santiago

    JC Santiago Network Newbie Member

    What I'm saying is that it looks like I can run the ftp server on the router and have it point to a share instead of having it work over a usb drive.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice