0

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 (127.0.0.1) to my service.

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

  • I think this is not possible, however I'm also very interested in an answer, facing a related problem. – Tomáš Pospíšek Nov 28 '17 at 21:50
0

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 127.0.0.1.

sudo ifconfig eth0:0 10.0.0.1 up sudo ssh -g -L 1234:10.0.0.1: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.