There are two basic ways to go about this, I’m not completely sure about the second way I’m going to mention below, since I have never done it.
Use another VPN type, such as GRE, IPIP, EoIP, L2TP, etc. One that creates a virtual interface on the router that you can assign IP addresses to, and reference those for routing. Then use IPSec to secure those tunnels specifically. Then you can either do static routes, since it’s a small network, or a dynamic routing protocol such as BGP or OSPF to distribute routes over those tunnels. This is much easier to scale out in the long run.
Method 2 should in theory work, but I have never done it so I’m not sure how the routers will handle it for sure.
In IPSec you define a policy, that policy tells the router what traffic it is looking for to encrypt and send down the IPSec tunnel. I’m going to assume that .1 is the main router.
So in the main router specify these policies:
1.) Src. Address 172.16.1.0/24 Dst. Address 172.16.2.0/24 SA Src. SA Dst.
2.) Src. Address 172.16.1.0/24 Dst. Address 172.16.3.0/24 SA Src. SA Dst.
3.) Src. Address 172.16.2.0/24 Dst. Address 172.16.3.0/24 SA Src. SA Dst.
4.) Src. Address 172.16.3.0/24 Dst. Address 172.16.2.0/24 SA Src. SA Dst.
You will also need a firewall rule that will permit the communication between these subnets, and make sure they are not captured by any NAT rules.
On router 2, you need matching policies with the main router, and the same will hold true with R3.
1.) Src. Address 172.16.2.0/24 Dst. Address 172.16.1.0/24 SA Src. SA Dst.
2.) Src. Address 172.16.2.0/24 Dst. Address 172.16.3.0/24 SA Src. SA Dst.
On router 3:
1.) Src. Address 172.16.3.0/24 Dst. Address 172.16.1.0/24 SA Src. SA Dst.
2.) Src. Address 172.16.3.0/24 Dst. Address 172.16.2.0/24 SA Src. SA Dst.
At least in theory this should define for each router how to communicate to each other, and they will know to encrypt the traffic between each other using R1 as the main location. Be sure to have the appropriate firewall rules as well. You will also likely need to set the level to Unique instead of the default require, so each policy has it’s own SA. As you can see, adding one more node increases the number of required rules a lot, and will only get worse. For a small setup this is OK, but if there is any chance for growth, use method 1.
IPSec is not really subject to normal routing, this is because it is considered traffic that is sent out by the router itself, and therefore uses the output chain in the firewall rules. Look at the packet flow diagram:
http://wiki.mikrotik.com/wiki/Manual:Packet_Flow#Changes_in_RouterOS_v6
After Postrouting, the MikroTik looks at the specific traffic and decides if it matches an IPSec policy. If it does, then it shifts it to IPSec encryption, encapsulates the traffic, puts on a different header for it, and sends out the traffic as its own in the output process.