DD-WRT and Large FTP Transfers
Symptoms:
FTP client disconnects from the FTP server after a long file transfer.
Cause:
While the file is being transfered on the data channel, there are no commands sent on the FTP command channel. Therefore, the FTP command channel connection exceeds the inactivity timeout set in the IP Filter and is disconnected. When the file has finished uploading and the client tries to send the next command it fails causing the FTP session to terminate.
Resolution:
Change the TCP timeout to a larger value.
Note: In DD-WRT versions prior to v24, the max value for TCP timeout is 3600 seconds. For large file transfers, 1 hour can easily be exceeded. The value can be changed, but it must be changed from the DD-WRT terminal. (Telnet, SSH into DD-WRT) Version 24 of DD-WRT allows the value to be changed from the GUI, up to a maximum of 86400 seconds.
Network Diagram Shows the final configuration.

Below is a chart showing the progression of the DD-WRT settings on both ends and the associated symptoms before I found this problem. Please note that the timeout has to be changed on both sides. In other words, a single file upload cannot consume more time than the smaller of the two tcp timeout settings. (The UDP setting is included because of P2P. You want these connections to timeout in a relatively short amount of time to keep your router from being overloaded from peer connections.)
