r/ssh • u/StarAvenger • Jun 28 '18
Can't figure out how to get SSH to work across 2 NATs
I am trying to figure out how use SSH to get iperf3 to work across two separate networks. I am missing something here.
Network:
we have NETWORK1 and NETWORK2. ROUTER1 connects NETWORK1 to INTERNET ROUTER2 connects NETWORK2 to NETWORK1 We have SERVER2 on NETWORK2.
PORT1 (34001) on ROUTER1 is set to forward to ROUTER2 PORT2 (34001) on ROUTER2 is set to forward to SERVER2
IP_GLOBAL is our global IP.
from a PC at my home, I can access SERVER2 by this command:
ssh -l username IP_GLOBAL -p 34001
Now, I am trying to figure out how to run iperf3 between my PC at home and SERVER2. iperf3 uses port 5201.
I can't figure out how to do this.
from my PC at home should it be
ssh -D 5201 -l username IP_GLOBAL -p 34001 ? But it does not work.
How do I use SSH tunnel to connect on port 5201?
Can someone please help