Answer the question
In order to leave comments, you need to log in
Iptables forwarding socks?
There are two servers with socks-proxy servers configured on them. 1.2.3.4:7200 and 1.2.3.5:7201
Is it possible to redirect the connection to the first or second server through the third server 2.2.2.2 through ports 7200 and 7201, respectively?
Through iptables on the third server configured port forwarding
iptables -t nat -A PREROUTING -d 2.2.2.2 -p tcp --dport 7200 -j DNAT --to-destination 1.2.3.4:7200
iptables -A FORWARD -d 1.2.3.4 -p tcp --dport 7200 -j ACCEPT
Answer the question
In order to leave comments, you need to log in
Let's say the source has the address 3.3.3.3.
3.3.3.3 sends a packet to 2.2.2.2, which changes the destination address to 1.2.3.4.
The packet flies to 1.2.3.4, but the source address in it is still 3.3.3.3, not 2.2.2.2.
Therefore, the packet is sent back along the normal route, bypassing 2.2.2.2.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question