Results 1 to 1 of 1
I have a CentOS box (lets call it Server). When ServerA receives data on ports 1001 to 1003 it should send it to ServerB which is accessed via VPN through ...
- 07-03-2011 #1Just Joined!
- Join Date
- Jul 2011
- Location
- Calgary, AB
- Posts
- 1
TCP Port Relay for CentOS?
I have a CentOS box (lets call it Server). When ServerA receives data on ports 1001 to 1003 it should send it to ServerB which is accessed via VPN through the gateway to which ServerA is connected.
I tried using Socat to do this but when I try to make a connection Socat says there is no route to host(?) even though I can SSH into ServerB from ServerA.
Can someone suggest a way to do this?
EDIT:
I got it partially to work using SSH forwarding on ServerA and socat on ServerB. Keep in mind I do have SSH access to ServerA from ServerB.
On ServerA entered the following SSH command:
Remote IP has to be the internal IP address of the remote server. Remote port is the port on which socat will listen.ssh -g -L localip:localport:remoteip:remoteport
On ServerB entered the following socat command
Where listeningport is the port on which socat listens for incoming connections from ServerA, destinationip is the IP address of recipient device to which the data will be sent and destinationport is the port on which that device is listening for connections.socat TCP-LISTEN:listeningport,fork TCP:destinationip:destinationport
Current issue: after about an hour the SSH forwarders from ServerA stopped working. Killed the SSH processes and re-entered the commands and the connections are working again.Last edited by omber; 07-04-2011 at 02:54 AM. Reason: Partial solution found


Reply With Quote