Answer the question
In order to leave comments, you need to log in
Redirect traffic from one ip to another?
Greetings!
There is a gateway on which you need to redirect all traffic (any port and protocol) from one IP to another.
For example, redirect everything from 192.168.0.101 to 192.168.0.100 and back:
I write:
iptables -t nat -A PREROUTING -d 192.168.0.101 -j DNAT --to-destination 192.168.0.100
iptables -t nat -A POSTROUTING -d 192.168.0.100 -j SNAT --to-source 192.168.0.101
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question