I have now spent some time researching, but I haven't found a working solution to the following problem:
I want to tunnel any requests on server 1, port x to server 2, port x. The port stays the same, I just want to tunnel any data being sent to server 1 on port x to server 2.
The connection would look like this:
Client > Server 1 >tunnel> Server 2
and reverse:
Server 2 >tunnel> Server1 > Client
Is that possible? If yes, how? The servers are both running Debian 8.
Please excuse me if this is a total noob question, but I am just getting started with servers and stuff.
Thanks ^^
This is called Proxy(ing). Yes this is possible by enabling the forwarding module on server1 and then add the appropriate forwarding rules on your iptables.
For example:
*On server1:
Enable Forwading:
Add forwarding Rules on Iptables
where:
portX: The port you wish to forward
server1_ip: Server ip which receives initial ip and forwards to server2.
server2_ip: The ip address of the server you wish to forward the traffic to.