I have a following VPN routing problem. I have a sparse list of network ranges that are inside private address space (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) from organisation A and I want to route the traffic to these addresses from organisation B over VPN tunnel. These address ranges get updated every now and then, so I’d like to use an address list in the router in the organisation B side, because these addresses are needed not only in routing but also in various firewall rules. The VPN connection is over L2TP/IPSec, organisation B being the client and A the server.
The access is only for organisation B to access hosts of organisation A.
For various reasons, it is not possible to use any routing protocol between these 2 organisations.
I have a pre-routing mangle rule, to set routing mark to packets having a destination address matching to the address list of organisation A addresses. Then I have a static route 0.0.0.0/0 with that routing mark to the VPN connection. This does work.
The problem is that there are no (and will not be) return routes in the organisation A side back to organisation B. For that reason, I’d need to set masquerading for the VPN interface in the organisation B side. This does NOT work. Something very weird is happening with the traffic, but the bottom line is that the organisation B side local addresses “leak” over the masquerade and the traffic does not go through. Also looking into statistics, the traffic seems to “match” with the masquerade rule, but it just does not do, what it’s supposed to.
If I instead of address list and routing mark, just create individual static routes for all organisation A ranges, then masquerade works perfectly and traffic flows fine. This is not very nice solution for me, because now I have same addresses in two places and must keep them in sync. RouterOS does not support using an address list in static route configuration, which would, of course, solve my problem neatly. Still, I see no reason, why masquerade wouldn’t work also with a routing mark.
I’m running MikroTik (RouterOS 6.47.8) and because it took some time to believe that it’s indeed RouterOS that is wrong, not me, I’ve faced the same behaviour in MIPSBE and ARM hardware versions as well as Intel CHR installation.