I want to ssh to my Raspberry pi that will be on a different network from my home network. ON my home network router, I set up port forwarding: Set the WAN and LAN start and end ports to 22, set the protocol to TCP. The WAN Host IP address (start & end) set to 192.168.x.x (it is going to be static so i set the same start/end address), and the LAN host IP address to my static IP inside my home network. Now, from inside my home network, how do I ssh to the rpi? Is it >>> ssh username@public_ip_address?
You must use
0.0.0.0 for translate an unknown IP address (because it can be dynamic). Redirect all TCP input traffic from all IP addr port
22 to your host to destination
192.168.0.2 (from my example) and port
22 (change this port for prevent mass scanning)
then use :
ssh -p 22 email@example.com
You must test this configuration from a device behind the N.A.T router. But you can access to your local SSH server with:
ssh -p 22 firstname.lastname@example.org
from a device that is on the same network as your
Note: example for IPv4 only.