I want to ssh across the internet, one network to another. Specifically, from my LAN using a run-of-the-mill router and cable modem to a neighbor's LAN using a different run-of-the-mill router. The solution I've found looks awkward:
You can specify port forwarding for incoming ports to forward to port 22 on each of the computers.
Say you have 4 computers on this network. We will call them A, B, C, and D. You have a laptop on a different network and you want to connect to computer A, B, C, or D.
Set incoming port forward on port 55555, for example, to forward to computer A on port 22.
To connect to computer A on port 22, you would connect to the external IP on port 55555 which will forward to computer A on port 22. The command to connect would read like so:
ssh username@externalIP:55555
example:
ssh holymoses@123.456.78:55555
Surely there's a more dynamic way to establish the connection. Can I specify MAC address or hostname, perhaps? Because it's residential, I can't really do too much with a FQDN.
Would it help to register a FQDN with no-ip? Certainly, the FQDN can be registered to the external IP for the router, but I'm not sure that gets me anywhere with actually establishing the connection, however.
I've only ever done ssh across my home LAN or to digital ocean. While I don't have my neighbor's router model at hand, I'm sure that using static IP addresses and port forwarding would work -- but I'd rather use DHCP.
How do I specify which computer: A, B, C or D with DHCP?