3

Hi I have looked all over the internet but could not find a solution. I am not saying that I didn't find anything, I am saying that I tried so many things and nothing worked. So hopefully someone can help.

I have a FreeNAS set up at my home and I can SSH into it with my local ip address. I have a smart linksys router and when I try to connect to the home server with my public IP I get connection timed out.

Here is a example output of what I get when I run the debug SSH

OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to <My Public IP> [<My Public IP>] port 22.
debug1: connect to address <My Public IP> port 22: Operation timed out
ssh: connect to host <My Public IP> port 22: Operation timed out

If you want me to include anything else let me know.

Update 2015-07-21 Port Forwarding

I have port forwarding setup. Here is a image of what my single port forwarding looks like.

Update 2015-07-21 Firewall

I came across that while reading about this problem on the internet. I looked at my NAS firewall. Tried to stop it with /etc/rc.d/ipfw stop and it said that firewall_enable="NO". I set it to "YES" and then I ran the stop command again. Then I tested the SSH with my public ip and still got connection timed out. Then I turned off my linksys and freenas firewall. Still connection timed out. So I am not sure what I am doing incorrectly. So would it be possible to give me a step by step on how to turn off both firewalls correctly.

I have put the linksys firewall settings back since I it was not working correctly.enter image description here

  • Please add details of the port forwarding you have configured on the router, in order for the incoming ssh to be sent onward to your FreeNAS device. – steve Jul 21 '15 at 6:26
  • In fact, did you configure port forwarding on your router? – katti Jul 21 '15 at 7:20
  • I have added a port forwarding image from my liksys account. – Navleen Singh Jul 21 '15 at 13:32
  • Try netcat to see if port is open...nc -v -z -w 3 <IP_OF_DST> 22. If it succeeds then it's most likely not a firewall issue – gwillie Jul 23 '15 at 4:21
0

It may be that a firewall is blocking SSH access to your NAS from external IP addresses, while allowing access from a private IP in the LAN. Check your firewall config (if any) on the NAS and the router.

  • I have updated my post about the with my linksys firewall information. – Navleen Singh Jul 21 '15 at 13:56
-2

The used public ip has to be purchase one and should get it from your local ISP. If that so, i think there should not be a problem you to ssh over that public ip address. Is this the case.?

Updated

"What is my ip" will of course give you a public ip, but note that it is dynamic and not persist to you all the time. OK, let assume what you get by typing "what is my ip" is persist for the time being, however, I have experienced that there are some ISPs will not add routes to those dynamic public ips within the Internet domain. So, this might be the case for you.

Even if your local ISP allow access to those dynamic public ips, there are further at least two steps you need to set up on your local router.

  1. set up port-forwarding from internet side to your local network. ( if for SSH (port 22/tcp) example) localnetwork:22<-----router----->internet:22

  2. excluding NAT for a specific local ip. What i mean by local ip is the ip address that you assigned to your local server. This is about making sure your local router will not do any IP/port translation when it forwards traffic.

  • What do you mean by "public ip has to be purchased". My public ip is the one I get when I type "What is my IP" in google. Can you explain because every spot I looked says you public ip is the one you get from typing "What is my ip" in google. – Navleen Singh Jul 21 '15 at 1:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.