# udp over ssh?

## Kaste

Hello friendly people

I am trying to forward udp port 1412 over ssh (or some other means that don't require root), which as we all know is not provisioned for (and the service does not use rpc). I then came up with this

```

end point $socat udp4-listen:1412,reuseaddr,fork tcp:localhost:1413

local $ ssh -R :1413:localhost:1413 -N end_point

local $ socat tcp4-listen:1413,reuseaddr,fork udp:localhost:1412

```

This however has one problem. socat seems to bunch more than one udp packet into the tcp packet, which leads to trouble with the application i want to forward.

Is there any way to fix this or does anybody have a better solution? I tried nc/nc6 before socat but i couldn't ever get that to work for some reason.

----------

## msalerno

I believe that ssh can only forward TCP.  I have never used socat before, but tcp4-listen does not look right to me.

socat udp-listen:1413,reuseaddr,fork udp:localhost:1412

For netcat, are you sure you specified UDP (-u) ?

----------

## Kaste

What I want is u1412-> server ->tcp 1413 server -> tcp 1413 local -> udp 1412 local  and as you said udp can't be forwarded so udp on both ends of socat doesn't make sense.

what would be the exact commands for nc to do what i do with socat?

----------

## msalerno

Gotcha, I didn't realize that the tcp tunnel was a requirement.  There's a bunch of stuff online about udp through ssh.  Did you try any of those suggestions?

----------

## Kaste

I scoured the results of a bunch of similar searches before and the solution in my initial post was the best i could come up with. most of these recommend nc but that yielded worse results so far. Are there better options?

----------

