I've got a pair of hosts with very bad routing between the two, but I have a third host that has very good ping to each. To work around the bad routing, I'm setting up the third host to bounce packets back and forth between the two.
This third host has an IP address that isn't used for anything else. My ideal configuration would be, when host 1 sends a packet to host 3, host 3 automatically NATs the source and destination addresses, replacing source=host3 and destination=host2, then forwards the packet.
The inverse should be true: If host2 tries to respond, the packet should go back to host3, which will NAT it back to source=host3, destination=host1. No connection tracking is required -- this can be done entirely statelessly.
Where I'm stuck is in getting both DNAT and SNAT to work at the same time. It seems like, if a packet is handled by DNAT, it's automatically marked to skip the SNAT rules: the DNAT works fine, but the source address isn't getting translated.
What is the proper iptables configuration to achieve this?