Say I have two machines, both running Linux;

Machine A is running a VPN server and is behind a NAT.

Machine B is the VPN client.

Machine A creates a reverse SSH tunnel from itself to Machine B, exposing a port on Machine B that connects back to the VPN running on Machine A.

How can I connect to Machine A's VPN server from Machine B through the SSH reverse tunnel?

  • I've seen something similar done with this using iptables; askubuntu.com/questions/324685/how-to-route-all-internet-traffic-through-tor-the-onion-router Aug 31 '18 at 3:12

A SSH tunnel only works with TCP, so your VPN server must be configured to use TCP for connections. You connect the the tunnel endpoint on Machine B just as you would connect to Machine A. In other words, just replace the ip address and destination port in your client configuration.

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.