Finally Fixed FTP port forwarding!!

Status
Not open for further replies.

facethewolf

Dabbler
Joined
Dec 13, 2011
Messages
21
Hello,
I'm so excited that I finally fixed this (though it may seem minor) I had to share this in case anyone else has the same problem.
This problem may not be SPECIFIC to Freenas, and really it's not even Freenas' problem.
I have a Netgear router connected to Comcast Cable. I setup Freenas and FTP service.
I setup the port forwarding on the NEtgear, and it worked for a while.
Someone recommended that I set the Freenas NIC for a static IP. A short while later, I found that I could not access the FTP service from outside the LAN. FTP over the LAN worked fine--but what's the point of that?
It took me a long while to figure out that it was the static IP address that was causing it. I had reserved that IP address on the Router, and forwarded port 21 and everything to that address, but the ports still were not getting forwarded.

I changed the Freenas Nic back to DHCP, and suddenly port forwarding worked.
My hypothesis, is that since the Netgear didn't hand out the address via DHCP, it failed to realize that the freenas was connected (even though the connected devices list showed it), and did not forward the port to a computer that was not "connected."

So my solution is to actually fake static-IP. Technically the Freenas Nic is set for dynamic IP address; however,The freenas mac address is remembered on the Netgear to always receive the same address via DHCP.
I just thought others might like to know my findings.
Thank you.
Sincerely, Sean
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Sean,

Thanks for posting your solution. I just saw this same thing on a Motorola Surfboard combo modem/router. What a PITA, glad you got it figured out!
 

pxtmission

Cadet
Joined
Jun 28, 2012
Messages
7
Hi Sean

Can you help me out. I'm kind of new to FreeNAS
I'm running into the same issue. I can use my Freenas if I'm using the LINKSYS router. But if I were to using any other router than I can not connect to my Freenas at all. I still see that it's connected but I'm not able to see any files or actual access to it at all.
I spoke with the Netgear technical support and they said my Netgear need to port to the FreeNAS server, but I do not know what port I must port to.

Can you help me out how to set it up.

Thanks alot
Hello,
I'm so excited that I finally fixed this (though it may seem minor) I had to share this in case anyone else has the same problem.
This problem may not be SPECIFIC to Freenas, and really it's not even Freenas' problem.
I have a Netgear router connected to Comcast Cable. I setup Freenas and FTP service.
I setup the port forwarding on the NEtgear, and it worked for a while.
Someone recommended that I set the Freenas NIC for a static IP. A short while later, I found that I could not access the FTP service from outside the LAN. FTP over the LAN worked fine--but what's the point of that?
It took me a long while to figure out that it was the static IP address that was causing it. I had reserved that IP address on the Router, and forwarded port 21 and everything to that address, but the ports still were not getting forwarded.

I changed the Freenas Nic back to DHCP, and suddenly port forwarding worked.
My hypothesis, is that since the Netgear didn't hand out the address via DHCP, it failed to realize that the freenas was connected (even though the connected devices list showed it), and did not forward the port to a computer that was not "connected."

So my solution is to actually fake static-IP. Technically the Freenas Nic is set for dynamic IP address; however,The freenas mac address is remembered on the Netgear to always receive the same address via DHCP.
I just thought others might like to know my findings.
Thank you.
Sincerely, Sean
 

facethewolf

Dabbler
Joined
Dec 13, 2011
Messages
21
Well, there are 2 types of connections. Connecting from within the local network, and connecting from the internet, the cloud, the great beyond. My problem was connecting to Freenas from the great beyond. Which connection are you having trouble with?
Within the local network, you shouldn't have any problems, the Netgear SHOULDN'T block internal traffic. If it is, then you're having more complicated problems.
If it's from the great beyond, my solution is to go into the NIC control panel on Freenas and set the ip address to DHCP, meaning it will ask the router for its IP address.
THEN, go into the netgear control panel, find the Reserve IP Address settings or similar, and have the netgear memorize the mac address of Freenas and set the IP address for it. Then you have to go into the port forwarding settings and forward port 21 to that address.
I hope that helps
S
PS after doing all this, you MIGHT, might have to unplug the freenas' lan cable for a minute and then plug it back in to make the DHCP operation work.
 

tingo

Contributor
Joined
Nov 5, 2011
Messages
137
Note: ftp is an old and insecure protocol. You really should use something more secure (ssh / scp) when accessing your data from the internet, unless you want someone else to get at your data too.
 

sanderst

Cadet
Joined
Dec 17, 2012
Messages
1
@facethewolf - I've been trying for several days to get ssh port forwarding to work through my Linksys (running dd-wrt) into my FreeNAS 8.3 running on my HP box....

No evidence that it was hitting the HP at all but was it the router, sshd config, /etc/hosts???

I finally tried forwarding to a Linux PC and that worked, which ruled out the router. I had put my IP and hostname in /etc/hosts via the Host name data base as suggested in http://doc.freenas.org/index.php/SSH but still no joy. It did niggle me that my PC was DHCP and the FreeNAS box was static like yours but as I could ping/ssh to it internally and it showed up in the router's active clients I thought all was OK.

So thanks for your post because although I had also entered a static lease in the router, I configured the same address statically for the FreeNAS NIC. Once I returned this to DHCP (and the router's DHCP table shows the NAS with the static IP) then it worked fine... I was just about to ask when I saw you were having a similar issue, albeit with different hardware. Phew....eventually!
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Check to see if your gateway is correct. Alot of people don't fill in ALL of the applicable networking information when they choose to disable DHCP. Disabling DHCP=You will fill in all of the appropriate info. Of course, it seems like noboody does that....
 

albertcoper

Cadet
Joined
Jan 26, 2013
Messages
1
omg OP i love you ive been trying to figure the same freaking thing out for about 3 days now...
 

wizmin

Cadet
Joined
Jan 28, 2013
Messages
6
Great!! But why would you open up FTP on your Router (firewall) for the Public.. FTP is an insecure Protocol.. if you need to Transfer Files and for what ever reason you and need to open a Port on your firewall Change the SSH port on the freeNAS
setup DYN DNS and use 'SCP'
 

djlsnuff

Cadet
Joined
Aug 17, 2013
Messages
1
facethewolf, thank you! I am using a peplink balance 30 router and statically assigned the ip of my freenas. I was able to access all shares locally. I was able to access all shares via LAN over ftp, but i could not for the life of me figure out why i could not access from WAN. Port forwarding was correctly set. Everything was done exactly like posted instructions. Then i came across this post and BOOM! Just like that. Fixed. Used MAC reservation in router with DHCP on FreeNAS. I think cyberjock may be right about gateway settings, but I could not find a place to input gateway on the interface settings tab. hh well.. fixed and happy. Thanks!
 

titan_rw

Guru
Joined
Sep 1, 2012
Messages
586
If port forwarding breaks when setting a static ip then something is broken. Either in the router, or a mis-configured static ip on the freenas machine.

Not setting a default route on the freenas machine wont break the port forward, but will stop freenas from replying. A tcpdump on freenas should still show the incoming packets, just no outgoing ones.

Keep in mind ftp is not the easiest application to get working behind NAT. I wrote a lengthy post on what is required in order to make a `freenas behind nat` accessible from ftp clients that are also behind nat.
 
Status
Not open for further replies.
Top