Hi guys,
I've finally had a chance to test my theory, and not entirely surprisingly, it doesn't work.
What I've done is this:
Network A - Router A: 192.168.69.0/24 - 192.168.69.1
Network B - Router B: 192.168.150.0/24 - 192.168.150.1
Network C - Router C: 192.168.2.0/24 - 192.168.2.1
IPSEC tunnels exist and work from A - B and B - C
So, on router A, configure second phase 2 IPSEC under A-B phase 1 ipsec to go from local(192.168.69.0) to 192.168.2.0. Configure matching phase 2 on router B for B-A's phase 1 for network 192.168.2.0 to 192.168.69.0.
Bring up phase 2. Check all works and VPNs all still ok from A - B and B - C. All good, we haven't broken anything yet.
Add manual outbound NAT on router B for LAN interface for source 192.168.69.0 to SNAT to 192.168.150.1 (interface address), so that traffic coming from the VPN looks like it is coming from router B.
Check SNAT working by SSH from 69.(x) to 150.(x) and run "who". It shows my connection appears to be coming from 150.1. So SNAT is working.
So, on router A, configure route: 192.168.2.0/24 via 192.168.69.1. This is probably unnecessary as 69.1 is the default route anyway, and I would hope at this point 2.0 traffic would be routed over the new phase 2.
So at this point, I'm hoping that traffic from A destined for C will hit router A, travel over the tunnel, get SNAT'd to B's address and B will then reroute the packets down its VPN to C. The destination on C will send responses back to router B, which will undo the SNAT and route the traffic back to its origin via the vpn from B to A.
But this doesn't seem to be working. I get no responses from remote servers on the 2.0 subnet from the 69.0. I'm just about to try some packet sniffing on the target server, but I suspect it is not getting this far. If it was, I can't see a reason responses wouldn't be routed back to 150.1.
So what I think must be happening is the packets which are going through the SNAT are not entering the stack again to be rerouted. This is where I get rather hazy - it's some years since I used iptables on Linux in anger, and I have almost zero knowledge of the network stack in BSD. So I don't know if what I'm trying here is physically possible on pfsense.
Any guidance here would be great - even if that guidance was simply "give up" - though I'd love to understand why this wont work.
Thanks,
-Oli