Answer the question
In order to leave comments, you need to log in
How to redirect traffic using iptables?
Hello dear experts.
There are 5 proxies with
authorization (
http ,
socks )
servers
scattered geographically around the planet (all data for example)
: 6 server in order to have one incoming ip address and redirect to these 5 servers by ports.
Suppose server 6 (main): 6.6.6.6
And so 6.6.6.6:1000 - redirects everything to the proxy 1.1.1.1:9999
6.6.6.6:1001 - redirects everything to the proxy 2.2.2.2:8888
6.6.6.6:1002 - redirects everything to proxy 3.3.3.3:7777
6.6.6.6:1003 - redirects everything to proxy 4.4.4.4:6666
6.6.6.6:1004 - redirects everything to proxy 5.5.5.5:5555
How to organize this using iptables?
I found out that this is iptables PREROUTING POSTROUTING FORWARD
But how to correctly compose the rules themselves, the brute force did not work.
Answer the question
In order to leave comments, you need to log in
iptables -t nat -A PREROUTING -p tcp --dport 1000 -j DNAT --to-destination 1.1.1.1:9999
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question