Mind Dump, Tech And Life Blog
written by Ivan Alenko
published under license CC-BY
posted in category Systems Software / SSH
posted at 18. Dec '21

Howto Connect To Device On Internal Network

Classic scenario - we want to access a Wi-Fi access point from an outside network, but an AP has only a internal IP address. How to handle this?

We’ll use the same principle as reverse SSH tunnel, but we won’t access a service running on loopback device on the server, but use a server to map port from a device on an internal network to our computer.

ssh -L 4003:10.0.0.173:443 me@example.org

The command creates a SSH tunnel through example.org using username me and maps remote port 443 port (HTTPS) on device 10.0.0.173 to local port 4003 on our computer. We’ll see a shell on the example.org, keep it open to keep the tunnel open.

Then we open up a web browser and type:

https://localhost:4003

and we’ll see a login page of Wi-Fi access point.

Works for any port, MySQL, Postgres, anything. Not sure if it’s possible to map multiple ports in one command.

Add Comment

Comments (1)

xHire
Posted: 2021-12-23 09:13:44 UTC / Approved: 2021-12-25 20:14:07 UTC
> Not sure if it’s possible to map multiple ports in one command. It’s not.