# Proxy traffic through a SSH tunnel? (SOCKS proxy)

**URL:** <https://forum.mikrotik.com/t/proxy-traffic-through-a-ssh-tunnel-socks-proxy/100088>\
**Category:** General\
**Created:** [July 22, 2016, 6:12pm UTC](https://forum.mikrotik.com/t/proxy-traffic-through-a-ssh-tunnel-socks-proxy/100088 "2016-07-22T18:12:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kenth](https://forum.mikrotik.com/letter_avatar/kenth/32/6_449c533f586939b6e5f246632a46421f.png) [@kenth](https://forum.mikrotik.com/u/kenth)\
**Post date:** [July 22, 2016, 6:12pm UTC](https://forum.mikrotik.com/t/proxy-traffic-through-a-ssh-tunnel-socks-proxy/100088/1 "2016-07-22T18:12:08Z")

</div>

Can Mikrotik proxy traffic over a SSH tunnel? In Linux I can do   
  
  
# ssh -D port\_no ip\_address

And then in e.g. Firefox enable SOCKS proxy at localhost:port\_no.

---

<div class="post-metadata">

**Author:** ![guipoletto](https://forum.mikrotik.com/letter_avatar/guipoletto/32/6_449c533f586939b6e5f246632a46421f.png) [@guipoletto](https://forum.mikrotik.com/u/guipoletto)\
**Post date:** [May 11, 2017, 8:16pm UTC](https://forum.mikrotik.com/t/proxy-traffic-through-a-ssh-tunnel-socks-proxy/100088/2 "2017-05-11T20:16:11Z")

</div>

I’m trying to do just that, but with no success for now.

I can tunnel specific ports just fine, like tunnelling local port 8010 to remote 10.0.0.10:80, works fine, but i have to remember all the mappings in this rat’s nest…  
So i went on looking for a more friendly solution, and i was presented to the concept of dynamic mapping and proxying with cocks v5.

I setup putty with option D8080, and firefox proxy settings 127.0.0.1:8080 with socks v5. But i can not get it to work.

Does someone has a similar setup running and could chime in with some advice?  
  
  
Thanks!

---

<div class="post-metadata">

**Author:** ![Sob](https://forum.mikrotik.com/letter_avatar/sob/32/6_449c533f586939b6e5f246632a46421f.png) [@Sob](https://forum.mikrotik.com/u/Sob)\
**Post date:** [May 12, 2017, 1:26am UTC](https://forum.mikrotik.com/t/proxy-traffic-through-a-ssh-tunnel-socks-proxy/100088/3 "2017-05-12T01:26:12Z")

</div>

I just tried a quick test and it worked, nothing special was required. I did the same thing you did, only with different port. The SOCKS5 part is done by client, so it should just work.

---

<div class="post-metadata">

**Author:** ![agiz10](https://forum.mikrotik.com/letter_avatar/agiz10/32/6_449c533f586939b6e5f246632a46421f.png) [@agiz10](https://forum.mikrotik.com/u/agiz10)\
**Post date:** [November 5, 2019, 1:44pm UTC](https://forum.mikrotik.com/t/proxy-traffic-through-a-ssh-tunnel-socks-proxy/100088/4 "2019-11-05T13:44:37Z")

</div>

To avoid opening new thread, i will use this one.

SOCKS proxy works, but sometimes (somewhat often) it stops working. It seems it hangs on TLS handshake with remote sites. I could not find anything regarding this, but the closest i could find is this report. In short: “there is a short-timeout bug of some kind in OpenSSH itself”:  
[https://askubuntu.com/questions/786897/ssh-tunneled-socks-proxy-connection-refusals-on-firefox-47-0-kubuntu-16-04](https://askubuntu.com/questions/786897/ssh-tunneled-socks-proxy-connection-refusals-on-firefox-47-0-kubuntu-16-04)

When i connect with Putty to Linux (Ubuntu - ssh SOCKS proxy tunnel) machine, it works without any problems, so there is most likely some problem with MikroTik ssh implementation..  
I thought i should share this if others have problem. Would be good if someone else could confirm my findings.

Regards,

---

<div class="post-metadata">

**Author:** ![hulitolku](https://forum.mikrotik.com/letter_avatar/hulitolku/32/6_449c533f586939b6e5f246632a46421f.png) [@hulitolku](https://forum.mikrotik.com/u/hulitolku)\
**Post date:** [August 19, 2020, 11:06pm UTC](https://forum.mikrotik.com/t/proxy-traffic-through-a-ssh-tunnel-socks-proxy/100088/5 "2020-08-19T23:06:51Z")

</div>

Which command can replace parameter “-D” on New Treminal in Microtik?

---

<div class="post-metadata">

**Author:** ![simmorsal](https://forum.mikrotik.com/letter_avatar/simmorsal/32/6_449c533f586939b6e5f246632a46421f.png) [@simmorsal](https://forum.mikrotik.com/u/simmorsal)\
**Post date:** [February 17, 2023, 12:10pm UTC](https://forum.mikrotik.com/t/proxy-traffic-through-a-ssh-tunnel-socks-proxy/100088/6 "2023-02-17T12:10:07Z")

</div>

> [@P00HB33R](#):
>
> Which command can replace parameter “-D” on New Treminal in Microtik?

Everywhere on the internet people know how to easily set this up easily, yet no one answers this question!
