if we have two server let's say server1(184.108.40.206) server2(220.127.116.11).
I'm working on redirect incoming traffic on server1 port 4444 to server2 port 12345,this is easy with iptables rule on server1 like the following:
sysctl -w net.ipv4.ip_forward=1 iptables -t nat -A PREROUTING -p tcp --dport 4444 -j DNAT --to-destination 18.104.22.168:12345 iptables -t nat -A POSTROUTING -j MASQUERADE
this working well
request --> 4444:server1 <===> 12345:server2
what I need to do is using tor netwok between the two server:
request --> 4444:server1 <===> |tor network| <===> 12345:server2
how I can do what?
I tried to use HiddenServicePort on server2 but I can't forward traffic from HiddenServicePort to another tor hostname ( in server1)
also how i can redirect traffic from iptables to tor specific hostname (server2 hostname)