title: UDP reverse tunnel over ssh (using socat)
body: <p>I want to setup a reverse udp tunnel, because I need to connect to my openvpn server from remote and the openvpn server is behind a NAT. For this I use socat and ssh. The tcp tunnel command:</p>
  
  <pre><code>socat exec:"ssh removeserver \"socat tcp-listen:10000,fork -\"" tcp-connect:localhost:22
  </code></pre>
  
  <p>does work correctly and I'm then able to buildup a ssh connection to remoteserver:10000.</p>
  
  <p>But when I want to do the same with udp:</p>
  
  <pre><code>socat exec:"ssh removeserver \"socat udp-listen:10000,fork -\"" udp-connect:localhost:1194
  </code></pre>
  
  <p>and then try to buildup the openvpn connection, I get the following error:</p>
  
  <pre><code>2011/12/23 13:27:43 socat[28241] E read(3, 0x80c3b08, 8192): Connection refused
  </code></pre>
  
  <p>The tunnel at first seems to work, becaues both logfiles (server and client) have entries for the connection attempt. But the connection can't be established.</p>