You don't mention which operating systems you are using, so I can only give you generic advice:
You'll have to set up two tunnels:
- An IPv4-over-IPv6 tunnel between machine A and the server
- An IPv4-over-IPv4 tunnel between machine B and the server
On the home network you'll have to route traffic for 192.168.178.0/24
to machine A. If machine A is the default gateway then this will already be the case. Otherwise you'll have to add a static route on the default gateway to send that traffic to machine A. On machine A you'll have to configure a static route for 192.168.178.0/24
towards the IPv4-over-IPv6 tunnel to the server.
On the remote network you'll have to route traffic for 192.168.0.0/24
to machine B. If machine B is the default gateway then this will already be the case. Otherwise you'll have to add a static route on the default gateway to send that traffic to machine B. On machine B you'll have to configure a static route for 192.168.0.0/24
towards the IPv4-over-IPv4 tunnel to the server.
The server will need two static routes:
192.168.0.0/24
towards the IPv4-over-IPv6 tunnel to machine A
192.168.178.0/24
towards the IPv4-over-IPv4 tunnel to machine B
Now machines on the home network will send their packets for 192.168.178.0/24
to the default gateway. If this is not machine A then the default gateway will forward them to machine A. Machine A will forward them over the IPv4-over-IPv6 tunnel to the server. The server will forward them over the IPv4-over-IPv4 tunnel to machine B, who will forward the packets to the remote network.
Now machines on the remote network will send their packets for 192.168.0.0/24
to the default gateway. If this is not machine B then the default gateway will forward them to machine B. Machine B will forward them over the IPv4-over-IPv4 tunnel to the server. The server will forward them over the IPv4-over-IPv6 tunnel to machine A, who will forward the packets to the home network.
I explicitly wrote down each hop of the path in both directions. Communication will only work if every step described above works.
You can use many protocols and applications for setting up the tunnels. Plain IPvX-in-IPvY tunnels are the easiest, but provide no encryption. The same goes for GRE tunnels. OpenVPN is a bit more difficult to set up but does provide encryption. Take a look at the Linux IPv6 How-To and the Tunnel section of the Linux Advanced Routing How-To to see how to set up tunnels.