A
A
Alik Send2019-09-07 22:07:50
SSH
Alik Send, 2019-09-07 22:07:50

How to setup ssh tunnel on mikrotik?

Hello.
I need to access my server which is in the enterprise. I do not have access to the enterprise itself and how the network is organized there, I can only guess. To connect I use a VPN (PPTP if that matters), I get an IP from the 192.168.99.0/32 network. I connected from a computer using a VPN client, then did sudo route add -host 192.168.1.2 -interface ppp0and ssh [email protected]. As far as I understand, there is a local network in which there is a VPN server open to the outside, to which I connect, and then I have access to this network, including to the computer 192.168.1.2.
Now I have a mikrotik router and I set up a VPN connection on the router and added 192.168.1.2 to the Routes list - now I can access it directly, and the router will route this connection through the VPN.
I also made ssh tunnels to this server, as some services are running there that I wanted to have access to. I did like this: ssh -f -N -L 1234:localhost:1234- after that I could go to localhost:1234 and have access to the service that is running on the server on port 1234.
The question is, can I configure the router so that it creates these tunnels for me? So that I can use IP_РОУТЕРА:1234to access the service on the server?
Google does not help - they ask how to configure the router so that through it you can have access to the subnet behind the router, but I need something else.
Thanks

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
rionnagel, 2019-09-09
@rionnagel

https://wiki.mikrotik.com/wiki/Manual:System/SSH_client
I don't think this can be used successfully. Need to test.

A
Andrey Barbolin, 2019-09-07
@dronmaxman

You have come up with an interesting problem. Question. If you have an L3 route to your server, why not connect to the services directly with IP_SERVER:1234?

G
Gregory, 2019-09-09
@Maxlinus

rdp server?
https://habr.com/ru/post/319158/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question