So I have a laptop connected to the 4G network the only problem is I want to connect to it via SSH from my PC. So far I have discovered that ny network operator does not allow port forwarding but I can connect to a VPN that does.
So far I have set my tun0 (4G) device as default and have tried to reverse tunnel into it using the -R specifiers using SSH but with no luck. The whole route would look like this.
MyPc->MyRouter->Internet->VPN(Port forwarded)->4G Network->MyLaptop
I have tried:
ssh -R VPNPortforwardPort:localhost:LocalBindingPort "MyPcUserName"@MyPcIP ssh -R 20257:localhost:22 "Dirk Dirksen"@my.ip.add.res
But I get a timeout. I have also enabled my sshd_config to allow 'GatewayPorts yes' and still no luck. I have also set my home router to port forward 5555 to 22 to MyPc.
When I enable my VPN and then request port forwarding I get a number like 20257 which in the localhost I try to bind to port 22 but still no luck, I just get a time out response.
So what im getting a bit confused about is the port numbers and all this port forwarding. My home router is making 22->5555 and then my VPN to the laptop gives me 20257 and then I need to connect to port 22 through that 20257 and iptables has everything set to allow.
I'm not sure if this is even possible. It must be. Where am I going wrong?