I have a nonstandard network of VMs that are causing routing headaches. Each VM is homed on on three different subnets (192.168.1.0/24
through 192.168.3.0/24
), and each VM can connect to every other VM --- but only over a single subnet. For example: VM1 (192.168.*.1
) can connect to VM2 (192.168.*.2
) only over subnet 2 (can ping 192.168.2.2
), while VM3 can connect to VM2 only over subnet 3 (can ping 192.168.3.2
).
I'd like to write some iptables rules (or similar) on VM1 such that I can have a "fake route" for local traffic to 192.168.1.2
which actually goes to 192.168.2.2
. Any thoughts on how to do this?