I'm connected to Optimum WiFi
with my Raspberry Pi 2
and I'd like to be able to SSH
into it from another network and even though it seems like I got public ip address assigned to my wlan0
WiPi
adapter I still cannot ssh in, I tried changing port from 22
to another that did NOT help.
sshd
itself is running and listens on my newly selected port and I can ssh locally without any issues.
-
First, check that you have really a public address on RPi itself with ifconfig.jaromrax– jaromrax2015年04月15日 18:58:32 +00:00Commented Apr 15, 2015 at 18:58
-
I dont know what Optimum WiFi is, but usually you need a permission on the router to pass through the port. And actually you can even be in subnetjaromrax– jaromrax2015年04月15日 19:00:01 +00:00Commented Apr 15, 2015 at 19:00
-
@jaromrax I mean NO disrespect by saying following: if you would've read my question you wouldn't write comment #1 as my question already contain answer and comment #2 is not useful at all.alexus– alexus2015年04月15日 20:13:52 +00:00Commented Apr 15, 2015 at 20:13
-
What do you mean by "from another network"? Does the connection go through the internet?Matthew– Matthew2015年04月15日 20:26:21 +00:00Commented Apr 15, 2015 at 20:26
-
@matthew yes, connection must be able to travel over internet.alexus– alexus2015年04月15日 20:27:29 +00:00Commented Apr 15, 2015 at 20:27
3 Answers 3
To be able to connect to your pi from anywhere outside the local network, you will need to make sure that your router is set to port-forward.
To do so you will need to login to your router. If you're using Windows, open the command prompt and enter "ipconfig". Scroll up and find the ip address for the "Default Gateway", and enter this into your browser. If you're using Linux, the command is "ip addr".
It should then load a login page for your router, where you will need to enter the admin username and password. I cannot give you specific instructions after this part as each router has a different interface.
You will then need to search through the settings for an option that says "Port-Forwarding", which is usually a checkbox.
Restart your router and you should be able to connect from outside your local network.
-
Optimum WiFi
is public hot spot that's provided by CableVision (cable company) and users do not have access to setup port-forwarding.alexus– alexus2015年04月15日 21:19:14 +00:00Commented Apr 15, 2015 at 21:19 -
This page about the wifi doesn't mention anything about port-forwarding. optimum.net/internet/about-hotspots. Searching "port-forwarding optimum wifi" only mentions how to set up their router to port-forward. Are you sure?Matthew– Matthew2015年04月16日 13:10:29 +00:00Commented Apr 16, 2015 at 13:10
-
am I sure? am I sure of what? As I said before users do NOT have accesss to setup port-forwarding and you look at their page and also did not find anything...alexus– alexus2015年04月16日 21:25:46 +00:00Commented Apr 16, 2015 at 21:25
-
My bad, I misread the comment. Anyway, "To be able to connect to your pi from anywhere outside the local network, you will need to make sure that your router is set to port-forward." If you can't port forward, you can't access from outside the network.Matthew– Matthew2015年04月17日 14:42:01 +00:00Commented Apr 17, 2015 at 14:42
Most likely, you got an IP address in the 25.0.0.0/8 subnet with Optimum Wifi, which is not routed on the internet. See http://www.dslreports.com/forum/r26531911-Optimum-Wifi-Ip-addresses
ssh reverse tunnel:
pi@raspberrypi ~ $ crontab -l | tail -1
@hourly ssh -S alexus -O check X > /dev/null 2>&1 ; if [ $? != 0 ] ; then ssh -M -S alexus -fN -R2222:localhost:22 -p 443 X ; fi
pi@raspberrypi ~ $
req: sshd
running on remote host, where you can ssh in and then ssh into your raspberry.