Answer the question
In order to leave comments, you need to log in
How to FORWARD from one ip to another via iptables?
I'm trying to study this topic, but for me, a beginner, NAT is still something far away.
I have two servers at home connected to the same router, the router sends all traffic via an external IP to the first server via DMZ Host, I had to redirect this traffic from the first (.23) to the second server (.30) when connecting via port 2332
I found a working option for me that redirects traffic if you connect via the public IP of the router
iptables -t nat -A PREROUTING -i enp3s0 -p tcp --dport 2332 -s 192.168.0.23 -j DNAT --to 192.168.0.30:2332
iptables -t nat -A POSTROUTING -j MASQUERADE
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