I'm encountering a similar issue. I have a core network with five routers (v7.x) connected to five remote sites via Wireguard and/or L2TPipsec. OSPF is functioning just fine for this part of the system. The problem occurs when we use a VPN client to connect to the network for management. The Core router acts as the VPN concentrator for the L2TP/ipsec vpn tunnels. IP addresses are assigned to clients via a pool (10.11.12.0/24). I simply cannot get the core router to advertise the route via ospf using interface templates. The L2TP address of the core (10.11.12.1)shows up in the routing tables as a /32 address. It is useless as a gateway leading to 10.11.12.0/24. If I configure the core router to distribute connected routes, it works. However, now all the routes connected to the Core are distributed as external routes. I might be able to live with that, but it causes OSPF flapping on least one of the remote routers. I don't understand why that's happening, but it's not a viable solution. The issue is clearly a routing problem as traceroutes from the remote routers to a client on the VPN pool attempt to use the default gateway at the remote site rather than the tunnel interface. I work around that issue by assigning the remote router's default gateway a higher administrative distance (eg:220) so the default route advertised via the Core takes precedence. However, that cuts off our ability to access the network via it's public IP address. As you can see, I've been going in a bit of a circle. Is there a correct way to advertise the network used for a VPN pool?
Here's my (current attempt) interface template and the interfaces that have come up based on those paremeters:
[admin@Core] /routing/ospf> interface-template/p
4 area=backbone interfaces=dynamic instance-id=0 type=nbma retransmit-interval=5s transmit-delay=1s hello-interval=10s dead-interval=40s priority=128 cost=1
[admin@Core] /routing/ospf/interface> p
8 D address=10.11.12.1%<l2tp-user1> area=backbone state=dr network-type=nbma cost=1 priority=128 retransmit-interval=5s transmit-delay=1s hello-interval=10s dead-interval=40s
9 D address=10.11.12.1%<l2tp-user2> area=backbone state=dr network-type=nbma cost=1 priority=128 retransmit-interval=5s transmit-delay=1s hello-interval=10s dead-interval=40s
[admin@remote1] /ip route pr
Flags: D - DYNAMIC; A - ACTIVE; c, s, o, y - COPY
Columns: DST-ADDRESS, GATEWAY, DISTANCE
# DST-ADDRESS GATEWAY DISTANCE
D o 0.0.0.0/0 10.200.100.9%wireguard1 110
0 As 0.0.0.0/0 x.x.x.x 1 <--Public IP for remote site
DAc 10.200.50.0/26 bridge1 0
DAo 10.11.12.1/32 10.200.100.9%wireguard1 110