How to forward internal Ethernet ip:port to localhost:port on Ubuntu

Issue

I have a relatively crude linux machine, with a setup that enables me to use my RPI through it since it’s wifi doesn’t work.

The RPI’s ip is 10.42.0.206 and I can ssh to it just fine through the machine. But I want to also be able to access it on other devices, one thing I though was to forward 10.42.0.206:22 to something like 192.168.1.13:5022 (the ubuntu’s ip) but I can’t figure it out to make it work, could someone please help?

Do I make a proxy or something, idk…

Solution

Turns out I was right about the proxy part. For anyone that needs it, here’s the answer:

  1. Install simpleproxy: sudo apt-get install simpleproxy

  2. Run it: simpleproxy -L 5022 -R 10.42.0.206:22

replace the port 5022 with your port or use ip:port and replace 10.42.0.206:22 with your internal ip:port

Answered By – RedstoneHair

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published