Connecting through socat?

Forum / General Discussions / Connecting through socat?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #45436
    nurbles
    Participant

    I have a Windows systems on two separate private networks.  I have a (Ubuntu) linux system that is connected to both private networks.  It looks like I should be able to use the linux ‘socat’ utility to all the NoMachine client on Win-A connect to the NoMachine server on Win-B, but I haven’t been able to figure out exactly what I need to do.  My best guess was to forward all TCP & UDP traffic for port 4000 between the two networks, but that doesn’t seem to work — at least not with these commands:

    sudo socat TCP4-LISTEN:networkA:44001 TCP4:networkB:4000

    sudo socat UDP4:networkA:44001 UDP4:networkB:4000

    I’m hoping there’s a maestro out there who knows the correct incantation to get this to work — and is willing to share that information!

     

    #45643
    Tom
    Participant

    Hi Nurbels,
    I checked this solutions in my lab. It works for me without any problem
. Maybe it’s a problem with the ports you set in socat.
    Try to set them using the command:
 socat TCP4-LISTEN:4000 TCP4:server_network:4000

    Regards,
    Tom

    #45650
    nurbles
    Participant

    Thanks, I misunderstood the socat documentation and thought that I would (should) be able to specify which local address socat should listen on. When I removed the network on the listen side, it worked much better. Now my command looks like this:

    sudo -b socat -ly -lpsocat-SL -d -d TCP4-LISTEN:5900,fork,max-children=1 TCP4:192.168.12.34:5900

    The parameters at the beginning configure socat‘s logging and set the ID to use when logging (I actually have three instances of socat for three different systems, so I wanted to be able to differentiate between the log messages.) The max-children=1 setting tells socat to only allow ONE connection at a time while the fork allows socat to start listening for a new connection when the current connection terminates (correctly — I’ve fond VNC clients don’t always send a FIN to close the TCP connection when they’re closed, which messes socat up.)

    Thanks again, sorry to be a bother and I hope this help someone else in the future!

Viewing 3 posts - 1 through 3 (of 3 total)

This topic was marked as solved, you can't post.