I don't care about moving SSH off of port 22.

This is my first time doing anything with SSH, if there's a better way, let me know. The end goal is to be able to access my server remotely.

I have a Linksys EA7500. It has the following fields that I need to put in:

  • External Port
  • Internal Port
  • Device IP# (auto prefills with 192.168.x.xxx)

The guides I've seen so far are all for people who have port forwarded before. I'm completely new to this, and everything I've been told makes no sense. What do I need to fill in these? Also, assuming my global IP is xx.xx.x.xxx, and the system name is discord, what would the command be to remote SSH?

Please keep what you say as simple as possible.


Okay, so you have a server machine on your home LAN that you want to be able to SSH into from the public Internet, right?

Check what IP address that machine is using right now. It's probably 192.168.x.y. For best results long-term, you want to make sure its IP address isn't going to change, but for simplicity's sake, for now, we can just use whatever it's got.

So fill in your port forwarding fields this way: External port: 22 Internal port: 22 Device IP address: 192.168.x.y (your server's IP address)

Now, make a note of your NAT gateway/router's public IP address. Let's say it's Also make a note of your account username that you want to use to log into this server. Let's say you've set up username "someusername".

When you want to connect to your SSH server box from the public internet, you do it like this:

ssh someusername@

Note that if you try that from another machine inside your home LAN and it doesn't work, that means your NAT gateway is kinda crappy and doesn't support NAT Loopback (a.k.a. "Hairpin NAT", "NAT Hairpinning"). So if this was the first way you tried to test your port mapping and it didn't work, don't give up yet. Try from a machine on the public Internet. There are public websites that have tools that let you check your NAT port forwarding/mapping rules, so you could pick one of those and use it to test your setup. Or you could put an SSH tool on your phone, and disable Wi-Fi on your phone so that you're for sure using cellular data, or you could tether your laptop to your phone (or join your laptop to your phone's personal hotspot feature), in order to test your port forwarding rule from a machine on the public Internet rather than your private home LAN.

  • Thank you! One more question before I accept your answer: how would I find the nat gateway for the router? (I'm running an Ubuntu based server) – amyiris Nov 26 '19 at 21:33
  • Actually, I'll just accept and ask another question. – amyiris Nov 26 '19 at 23:13

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.