I'm using a reverse tunnel to a public vps so users can connect to my machine at home. However, due to the reason the reverse tunnel works, their IP addresses are shown as local ( to my service.

is it possible to make SSH forward the public IP address of the user (e.g. instead of could it potentially break something?

  • I think this is not possible, however I'm also very interested in an answer, facing a related problem. Nov 28, 2017 at 21:50

1 Answer 1


SSH implements a tunnel in which information is only **forwarded* to or from the remote or local system. Therefor it can only to the assigned local address. You can however configure a local private address virtually and bind to it instead of

sudo ifconfig eth0:0 up sudo ssh -g -L 1234: user@host.tld

In order to keep the IP address you need something like l2tp. Note that port forwarding in these cases of NATs is called IP masquerading and by definition loses information about the original IPs when it is sent over the tunnel. Instead you'd need to encapsulate forward packets including their source into something like l2tp and THEN forward that through the tunnel then decode it on the other side.

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.