• February 27, 2025, 10:57:10 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

This Forum Beta is ONLY for registered owners of D-Link products in the USA for which we have created boards at this time.

Author Topic: 323 + Linksys Router = neverending frustration  (Read 7026 times)

gijoecam

  • Level 1 Member
  • *
  • Posts: 8
323 + Linksys Router = neverending frustration
« on: September 10, 2010, 07:30:52 AM »

I've been chasing my tail here for a couple of weeks now, and despite searching, haven't found a solution yet. 

Here's the short version:  DNS-323 is currently connected to a linkSys BEFSR81 8-port wired router, and connected via Charter cable internet (dynamic IP).  Sharing on the network is fine, but access from outside is non-existent at the moment.  I had it working briefly for a couple hours last Wednesday, but I have no idea what happened while I was out of town last weekend. 

When connecting from inside my home network, either by mapping the drives or via an FTP request in a browser, I can log on just fine using any of the users I've granted access to.  From outside the LAN, it forwards the address to the proper Ip address and *appears* to attempt to connect as it should (i.e. it prompts for a username and password).  However, entering a valid username and password results in a timeout error.  I had a buddy run Filezilla on it last night and here's what it turned up:

Status: Resolving address of camfam.dyndns.org
Status: Connecting to 24.247.51.160:21021...
Status: Connection established, waiting for welcome message...
Response: 220---------- Welcome to Pure-FTPd [TLS] ----------
Response: 220-You are user number 2 of 10 allowed.
Response: 220-Local time is now 18:47. Server port: 21021.
Response: 220-This server supports FXP transfers
Response: 220 You will be disconnected after 2 minutes of inactivity.
Command: USER Friends
Response: 331 User Friends OK. Password required
Command: PASS **********
Response: 230 OK. Current restricted directory is /
Command: SYST
Response: 215 UNIX Type: L8
Command: FEAT
Response: 211-Extensions supported:
Response: EPRT
Response: IDLE
Response: MDTM
Response: SIZE
Response: REST STREAM
Response: MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
Response: MLSD
Response: ESTP
Response: PASV
Response: EPSV
Response: SPSV
Response: ESTA
Response: AUTH TLS
Response: PBSZ
Response: PROT
Response: 211 End.
Status: Connected
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is your current location
Command: TYPE I
Response: 200 TYPE is now 8-bit binary
Command: PASV
Response: 227 Entering Passive Mode (192,168,1,125,217,54)
Status: Server sent passive reply with unroutable address. Using server address instead.
Command: MLSD

If I'm interpreting this correctly (and I honestly have no clue at this point), I *think* the NAS box is seeing the incoming request on port 21021 as it should, and attempting to connect via some other outgoing port unsuccessfully, correct?  The 'Entering Passive Mode' line is what has me confused....  What is it, what does it do, how does it work, and how the heck do I make this thing work properly?

If anyone has any ideas, I'm all ears...  I have NO IDEA where to go from here....  I have no idea if this is a NAS issue or a routing issue from here?  Help!??!

Thanks gang!

-Joe
Logged

fordem

  • Level 10 Member
  • *****
  • Posts: 2168
Re: 323 + Linksys Router = neverending frustration
« Reply #1 on: September 10, 2010, 09:02:01 AM »

Quote
Command: PASV
Response: 227 Entering Passive Mode (192,168,1,125,217,54)
Status: Server sent passive reply with unroutable address. Using server address instead.
Command: MLSD

If I'm interpreting this correctly (and I honestly have no clue at this point), I *think* the NAS box is seeing the incoming request on port 21021 as it should, and attempting to connect via some other outgoing port unsuccessfully, correct?  The 'Entering Passive Mode' line is what has me confused....  What is it, what does it do, how does it work, and how the heck do I make this thing work properly?

If anyone has any ideas, I'm all ears...  I have NO IDEA where to go from here....  I have no idea if this is a NAS issue or a routing issue from here?  Help!??!

Thanks gang!

-Joe

A bit of both actually, the connection is not being correctly routed because the NAS is incorrectly configured.

First - so that you understand the problem - a little bit on ftp.

For the purpose of this discussion I'm going to ignore all forms of secure ftp - so that leaves us with just two - standard (active mode) ftp and passive mode ftp - ftp is somewhat unique in that it requires two separate connections, a control connection and a data connection.

With standard ftp, the control connection is made, from the client to the server on port 21, and the data connection is made in the opposite direction, from the server to the client, usually on port 22.

Now - back when consumer routers were just hitting the market, and NAT, the process used to share an ip address was new, the routers would allow all outgoing connection requests, and allow any responses to those requests back in, sending them to the internal host that it could match the response to - any incoming traffic that could not be matched would be discarded.

This caused problems for standard ftp, because the data connection was an incoming request, that did not have a prior outgoing request to be matched against - you might think it could be matched against the control connection, but that already has both request & response, so it is already complete.  More recent NAT routers use a process called "ftp protocol fixup", that fixes this, but only if standard ports are used.

To get around this problem passive ftp was born - with passive ftp, both connections are made from client to server, and the server tells the client what ip address and port to make the data connection on.

When the client sends a request for a passive connection (that's the PASV command you see), the server responds with the data channel details to be used to make the connection - in this case - 227 Entering Passive Mode (192,168,1,125,217,54) - the problem is that the NAS which is not setup correctly is sending the client, a private non routable address - 192.168.1.125 - and so the client returns the error - Server sent passive reply with unroutable address. Using server address instead - additionally, you probably don't have the data port forwarded, causing the connection to time out.

How to make it work.

Either use standard ftp (tell the client not to use passive mode ftp) - which will fail, because you have chosen a non standard port to connect on - or configure the NAS AND router to use passive mode ftp.

For passive ftp to work, you MUST configure the NAS to send the public address (there is a check box in the ftp setup to do this) AND you MUST configure the router to forward the range of passive ftp ports that the NAS uses.

By the way - thank you for not obscuring the ip address details in your post - this makes it very easy for me to see where your problem lies, and to offer a solution.
Logged
RAID1 is for disk redundancy - NOT data backup - don't confuse the two.

gijoecam

  • Level 1 Member
  • *
  • Posts: 8
Re: 323 + Linksys Router = neverending frustration
« Reply #2 on: September 10, 2010, 11:00:31 AM »

Thanks for the history lesson, as well as the background on how the system is *supposed* to work.  I'm operating just out of my comfort zone here on all this stuff, so it's nice to find someone who can speak slowly and use small words my mechanical engineer brain can understand.

I have routed the standard passive mode port range block in the router to the NAS's IP address as well.  That seemed to be the key to getting it to work last week for that brief window of time where it did.

You mentioned port 22 as being the default outgoing port...  I had read elsewhere that it was port 20?  I used a port checker tool from the dyndns web site, and no matter how hard I tried, I couldn't get ports 20, 21, or 22 to forward properly, hence the reason I forwarded port 21021 as a work-around. 

Now, I also believe that when it was working last week, I had the NAS configured to report the network IP address in passive mode.  The problem is that I'm running a cable modem, so every time it pulls a new IP address, those values will change.  Does that mean I need to update that manually every time it renews the IP address?  That happens at least once a month, more often if we have a power outage or internet outage (which also seems to happen a couple times a month out here in the boonies).  It doesn't appear that those numbers automatically update (though the NAS properly reports them to DynDNS anytime that happens, it just doesn't appear to update them in the FTP settings automatically)

Does that make any sense?  If that's the case, any ideas on how to work around it?
Logged

fordem

  • Level 10 Member
  • *****
  • Posts: 2168
Re: 323 + Linksys Router = neverending frustration
« Reply #3 on: September 10, 2010, 02:33:35 PM »

You're right the data channel does default to 20, 22 is SSL or some such - it's been too long since I worked with it for my old brain to remember clearly.

You're also right on the NAS not properly tracking and reporting any changes in the public ip address if/when it occurs - I forgot about that, my ip rarely changes, but I have seen it happen - I'm not aware of any workarounds.

My guess is it'll take a firmware patch to make it work correctly.
Logged
RAID1 is for disk redundancy - NOT data backup - don't confuse the two.

gijoecam

  • Level 1 Member
  • *
  • Posts: 8
Re: 323 + Linksys Router = neverending frustration
« Reply #4 on: September 12, 2010, 09:40:27 AM »

I tried adjusting the setting for 'report IP address in passive mode' to my current IP address for the network as reported to DynDNS.  Still no-go.  Any other ideas?  This has got me frustrated to no end, and d-link's tech support is about useless...
Logged

fordem

  • Level 10 Member
  • *****
  • Posts: 2168
Re: 323 + Linksys Router = neverending frustration
« Reply #5 on: September 12, 2010, 06:04:31 PM »

Did you also set the router to foward the passive port range specified on the DNS-323?
Logged
RAID1 is for disk redundancy - NOT data backup - don't confuse the two.

dosborne

  • Level 5 Member
  • *****
  • Posts: 598
Re: 323 + Linksys Router = neverending frustration
« Reply #6 on: September 12, 2010, 06:22:55 PM »

As a test, you could try adding the DNS323 to the DMZ if your router has one.
Logged
3 x DNS-323 with 2 x 2TB WD Drives each for a total of 12 TB Storage and Backup. Running DLink Firmware v1.08 and Fonz Fun Plug (FFP) v0.5 for improved software support.

gijoecam

  • Level 1 Member
  • *
  • Posts: 8
Re: 323 + Linksys Router = neverending frustration
« Reply #7 on: September 13, 2010, 04:12:13 AM »

Did you also set the router to foward the passive port range specified on the DNS-323?

I did that to no avail the other day.

I ended up resetting the entire NAS back to the factory settings using the Factory Reset command, then went through and reconfigured everything (usernames/passwords, groups, FTP settings, and FTP access etc.) and suddenly it started working.  The key here seemed to be resetting the 'Report External IP in Passive Mode' to the IP address of the cable modem.  Though I had done that earlier as well, it still wasn't working until I did the full reset on the NAS.  As best I can tell, I set everything back to exactly how I had it before the reset, and now it is working.  Go figure!?  At least I know that once a month or so I'll need to go in and reset the external IP (when the cable modem rolls the IP address over).  I wish DLink would give you the option to automatically update that field when it updates the IP on the dyndns website. 

Again, thanks a million for all the help.  Should our paths ever cross, the first round is on me!
Logged