Answer the question
In order to leave comments, you need to log in
How to redirect traffic from one DC to another?
There are two different vps, there is an application that connects to vps, the task is to hide one vps, how to make all incoming tcp traffic (port) come to ip1, and ip1 send it to ip2
You can do this using iptables, Debian8 axis
Answer the question
In order to leave comments, you need to log in
You need two iptables rules. The first redirects, the second ensures the symmetry of the route.
-A PREROUTING -d ip1 -p tcp -m multiport --dports 123,1234 -j DNAT --to-destination ip2
-A POSTROUTING -d ip2 -p tcp -m multiport --dports 123,1234 -j SNAT -- to-source ip1
Ports need to be specified specific. Or separately prescribe that traffic from your work address does not need to be redirected. If you do not specify restrictions on ports or addresses, then you will forward all traffic, and the first VPS itself will become unavailable to you.
iptables redirect , but the outgoing ip will be the one who redirects,
well, in addition to the redirect, there is also masquerading or snubbing
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question