All machines in my network based on linux. Main server has 192.168.0.1, mail server has 192.168.0.2, client machine has 192.168.0.3 ip.
I've added
iptables -t nat -A PREROUTING -d 192.168.0.1 -p tcp -m tcp --dport 25 -j DNAT --to-destination 192.168.0.2:25
at main server, because i want all clients work with my main server on smtp.
But i think, that this solution doesn't work because when mail server 192.168.0.2 decides to send packet back to client (192.168.0.3), it does it without help of gateway (192.168.0.1) because it's a local network.
How to force 192.168.0.2 send all the packages through the gateway?