I have a strange configuration, let's see if you can give me some advice :)
I have two networks (10.X/24 and 20.X/24) conected by a linux machine between them. This linux have two interfaces, each one atached to one of those networks. Devices atached to those networks doesn't have gateway and I can't change that neither install aditional software like vpn's, etc... Also I can't change subnet mask.
What I want is to comunicate one device of each network, and I was thinking is to configure a something like IP FORWARDING but changing the SRC and DST, I think this is more like a NAT. The idea is to do that if I ping to 20.254 (doesnt exist) from 20.50(device from net A), it redirects this packet to 10.50 changing src to 10.254. It's something like virtual IP's.
The main idea is to do this translation:
input eth0 (network A) SRC 20.50 DST 20.254 --> output eth1 SRC 10.254 DST 10.50
input eth1 (network B) SRC 10.50 DST 10.254 --> output eth0 SRC 20.254 DST 20.50
Keep in mind that addreces 10.254 and 20.254 doesnt exists and I use them to contact with the other network BECAUSE I can't set a gateway to ask for unknown networks neither add static routes.
Let's see if someone can give me the best way to do that.
Thanks!