Issues SSHing to Raspberry Pi From External IP - linux

I've been trying to SSH to my RPi from an external network for a while with little luck. I've followed all the guides and they say all the same things: get SSH set up, port forward on port 22, and then connect using your external IP address. I've been able to easily SSH to the RPi using my internal IP from the same network with no problem, but not from my external IP. This is my configuration for port forwarding:
That is the internal IP for my RPi's ethernet connection. I've tried it with the IP for WiFi as well and it just has the same effect. When I try to SSH using my external IP, it just times out no matter which internal IP is port forwarded (ethernet or WiFi). I've tried it both on PuTTY on my PC and from my Macbook using
sudo ssh pi#my.external.ip.address
It still just times out. The only thing I can think that might be happening is some issue with a firewall, but I have no idea how firewalls work so if this has been seen before and it is a firewall issue, more detailed guide would be nice.
Even if the issue is not known, is there any way to debug the SSH call and see where exactly it's failing when I use the external IP? Any kind of help is greatly appreciated.

I recently struggled through a lot of this with my pi. As alvits suggests, if you are trying to connect to the pi via the LAN it probably won't work. You need to test from an external IP address.
You shouldn't need to sudo either.
If you are still using pi/raspberry as the username and password, change ASAP. Once the firewall is open it won't take long before you start to see bots trying to log in. I think it was about 30 minutes on my machine. It was interesting for a few days, then annoying. Almost all attacks stopped when I moved off of port 22.

According to this page, it does not appear that my router supports SSH. I was able to find guides online of how to enable it using custom firmware, however I probably won't be attempting that. Thanks for the help anyways!

Related

How can I connect to an IIS site being served on my computer from my iPad?

Both devices are connected to the same WiFi network.
I have set IIS bindings to allow connections to my IP:
However, my computer's IP address is the same as my iPad's.
Is there a way to make this work?
That's not your IP. Every time you use a laptop on a Wifi network, you'll be using the public IP address of whatever network you're on.
The IP address of "your" computer doesn't belong to your computer. It belongs to the network you're connected to. Your computer is just borrowing it for a while.
Try to set a static IP address for your computer and use another machine to send ping command to it. Then use iPad to connect.
Initially when I posted this question, I was using an xfinitywifi hotspot and I assume that came with a whole host of problems. Full-disclosure, I did not figure out how to make it work in this scenario.
However when I moved to my own home wifi network, I was still having this problem.
I had to do two things, one of which, I know is not recommended, but it was really easy.
First, I had to enter my network and sharing center and set my connection as home connection instead of public which is what I previously had it at.
Second, which is not recommended, I turned off Windows firewall. I only do this when I need to access my site from another device for debugging. I turn it back on when I am done. For a more permanent setup I know it is recommended to just enable the port you need, but I could not figure this out.

Phone cannot access sites being served by localhost(lite-server) on same WiFi network

Searched all over the place for a fix for this or even a good way to troubleshoot it. I've read the previous SO threads that seem to cover this issue but nothing in any of them has worked in my case.
Basically, I can't get access to anything that is being served via localhost on my mac in any browser on my Android device.
This is happening despite the fact they are connected to the same WIFI network and I am using the correct network address for my mac on which localhost is running (I have checked and double checked several times). I have no idea what the problem is because it worked perfectly fine before and I haven't changed anything that I believe would interfere with localhost access.
I don't have firewall or port blocking settings on my router either.
I have also tried on several different Android devices to eliminate it being a problem specific to one particular device.
Totally stumped. Any clues or hints on how to fix this would be much appreciated!
***** UPDATE *****
I tried using python -m SimpleHTTPServer 3000and it works. The site is accessible on my Android device. So I am pretty sure it is not a network issue per se.
The site is essentially a Node app which I built using the angular-quickstart template found here. It launches lite-server when npm start is run. Hope that gives some further insight into what the problem might be.
If you open up a terminal on your mac and then run the command ifconfig it will tell you what ip address all your interfaces have. It is probably your en0 interface. That ip address should be used in your browser on your Android device.
You will have to make user that you server (web) is binding to the correct ip address as well. You could be binding to all ip addresses if possible.

Connecting to Raspberry Pi on Remote Network (XFinity Router)

I have set up a Raspberry Pi in my home office with a Linux OS and have installed Apache (PHP/MySQL). Everything is working and I've been able to successfully connect via SSH from my computer while connected to the same network in my home.
I've seen many similar questions on here but none that can outline what I'm trying to do. I have an XFinity Router and can access it's settings using IP 10.0.0.1 locally. I've read into Port Forwarding which I've set up for the Raspberry Pi but now I'm stuck on the next step in the settings to get it set up so I can connect to it remotely (from a network outside my home's). I'm hoping to use this to host web-based PHP scripts that we can run from any web browsers as well as be able to SSH in from any internet connection.
I'm sorry if this is similar to other questions here but the XFinity interface seems to trouble me and it's not making it easy for me to wrap my head around Port Forwarding and what goes into setting this up correctly.
Thanks for your help!
You need to do three things:
Make sure your Raspberry Pi gets the same IP address on your LAN every time. This can be done by configuring your router for DHCP reservation by using the Pi's MAC (ethernet hardware address), if it supports it. To get the Pi's MAC, You can type ipconfig eth0, or you can use Advanced IP Scanner for Windows, or my own Pi Finder for Mac. (Alternatively, you can set your Pi to use a static IP address.)
Forward port 22 (SSH) in your router to the internal IP address you chose. (If your router supports forwarding a different external address to internal port 22, I recommend doing that for extra security.)
Get a consistent external IP address or name, so you can find your home network on the outside. If you don't have a static IP address from your ISP, then you will need a Dynamic DNS service, such as those offered from Dyn.com, no-ip.com, and Namecheap. You'll need to configure your router to update the service, and not all routers support all Dynamic DNS services (or any). (Alternatively, you can install a Dynamic DNS updater client on your Raspberry Pi or other computer on your home network, but that may or may not be easy.)
I can't advise specifics as to how to configure your particular router, but these three steps are what are generally required to do what you want, and the rest is figuring out the specifics of how your router wants it.

Remote ssh with no router configuration

I will be sending a linux machine to a non technical customer overseas. After the customer has connected the machine to his LAN , which is also connected to the Internet, I want to be able to ssh into this machine without requiring the customer to do any router configuration (no port forwarding for instance).
The linux machine is connected to the internet through a router. It does not have a public ip address.
Is this possible using ssh configuration only?
If not then what is the simplest way to achieve this?
I used to work in a place where we had a setup that allowed for this, but unfortunately I can't remember the details - here is are the basics of the setup though.
The customers machine would connect using SSH to a machine with a known hostname using the -R option to ssh to setup a reverse port forward. We could then connect to the known machine and use the forwarded port to get to port 22 on the customers machine.
Sorry I can't remember more, but it worked absolutely perfect :)
If that linux system is directly connected with modem then it must have public ip address so you will able to access that linux system from anywhere . but make sure the remote system has static public ip address otherwise you need to do dynamic dns.

andlinux slirp network failed

I have installed andlinux Beta 2 on my WinXP. Everything works fine until last night, I don't recall that I ever changed anything on network configuration or andlinux setup, the network stop working inside andlinux. With that said, I mean open a KDE console, I do "ping yahoo.com", I see DNS is resolved correctly, however, no response at all.
My andlinux is startup as a WinXP service. Open windows task manager I can see following services are up and running:colinux-daemon.exe colinux-net-daemon.exe colinux-slirp-net-daemon.exe
On andlinux side, there are two network interface eth0 and eth1. eth1 is configured to communicate with local WinXP. I configured it to use samba to access windows directories, no problem. From WinXP side, I can use ssh to login into andlinux box via eth1 IP address.
eth0 is configured as slirp, no port forwarding. eth0 has IP=10.0.2.15, default gateway is 10.0.2.2, netmask=255.255.255.0; These are configured in /etc/network/interfaces. DNS is 10.0.2.3, which as I just mentioned resolve yahoo.com correctly.
On the windows side, internet works fine. I disabled firewall on all network interface. I rebooted my laptop, no luck. I searched over inet, seem no one has this problem. People say network is done if they kill the colinux-slirp-net-daemon. What frustrated me is that this whole thing worked well, but for no reason it's broken all the sudden. Anyone has experience on this issue, please help, appreciate!
I thought I had the same problem, but then found my andLinux system's network connectivity was actually working fine, and that several things made it difficult to tell what was going on.
Test I did to validate connectivity: wget www.yahoo.com
Behavior I observed that made troubleshooting difficult:
Pings from andLinux - not all hosts will respond to pings from the andLinux OS (ie Ubuntu, not the Host Windows OS). According to my packet captures the pings appear as UDP pings instead of ICMP pings once they leave the host OS's adapter. The major IPs/hosts (like yahoo, google, 4.2.2.2 etc.) on the internet I usually ping to test connectivity currently don't respond to these type of pings.
Traceroutes from andLinux - even when successful, these never show more than 2 hops when done from the andLinux OS. If successful, both hops show 10.0.2.2. If unsuccessful, the second hop just times out. Not sure why, I'm sure there is an explanation.
Packet captures - at the host OS level, the capture (eg wireshark) must be done on the physical interface the traffic is going over. I was initially capturing on the TAP-Win32 Adapter but this only showed X Window traffic.
Installed apt sources URLs no longer valid - Ubuntu 9.04 is long out of support by now, so the URLs in the apt sources.list file didn't exist anymore. This is what got me thrown off in the first place, because I didn't troubleshoot this specifically and just tried to test my internet connectivity first, then got confused by the ping and traceroute behavior seen above. Changed http://us.archive.ubuntu.com/ubuntu to http://old-releases.ubuntu.com/ubuntu/ in sources.list and was good to go.

Resources