Forward Udp with Ssh Tunnel Using Socat and Putty

i'm trying to use UDP protocol, with ssh tunnel. I have these 2 machine, with these configurations:

1) Workstation a with windows 7, with putty and socat with cygwin.

2) RaspberryPi with raspbian.

Just for test (i need UDP for other programs, but if this not work is useless test other things), i'm trying to use from Workstation the DNS server of my router that's behind RaspberryPi.

After googling around and seen a lot of examples i have done this:

1) I use PuTTy to connect Workstation to RaspberryPi, and open on Workstation local TCP port 50053 and forwarded it to RasberryPI local TCP 50053. (L50053 to 127.0.0.1:50053)

2) On my cygwin shell on Workstation i run: socat udp-recvfrom:53,reuseaddr,bind=127.0.0.1,fork tcp:127.0.0.1:50053

3) On my RaspberryPI i run: socat tcp4-listen:50053,reuseaddr,fork,bind=127.0.0.1 UDP:192.168.1.1:53 (tested even with 8.8.8.8:53)

I have seen in every guide that this must work, but, well for me doesn't.

Any suggestion?

There is any way to see if socat is working right?

2

1 Answer

You should try udp-listen instead of udp-recvfrom. udp-recvfrom will create new TCP connection for each of the UDP packets. I've had similar problems with UDP tunneling through an SSH PuTTy connection and for me UDP-LISTEN did the trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest