/ip/route gateway question

Hi all,
I have a route specified under /ip route
where I’m routing the following network over an l2tp interface. The interface is setup when the remoteserver calls into my server via L2TP/IPSec.
This works as long as the l2tp-interface is alive. But once the remote user disconnects and later reconnects reconnects, this route is marked unreachable due to the check via ping. So routing stops as there is no backup route. Is there way that route gets automatically enabled as soon as the interface comes back online after brief outage.

I could write a simple monitor script, but is there a setting I might have missed to allow automatic reenabling the route?

5 A S  dst-address=10.0.28.0/22 gateway=<l2tp-remoteserver> 
        gateway-status=<l2tp-remoteserver> reachable check-gateway=ping
        distance=1 scope=30 target-scope=10

Thanks,
Skip

Rather than have a static route, why not just use the “routes” entry in your PPP secret config for this user? The route will be added and removed automatically as the user connects and disconnects.

I had misread the documentation. Yes this works! Thanks rmmccann.
I also found a bug in RouterOS when testing this out. If I updated the routes in /ppp secret, it corrupts the secret and we need to reset the secret. Not sure how to report this to Mikrotik.

Just for benefit of others:

/ppp secret
routes (string; Default: ) Routes that > appear on the server > when the client is connected. The route format is: dst-address gateway metric (for example, 10.1.0.0/ 24 10.0.0.1 1). Several routes may be specified separated with commas. This parameter will be ignored for OpenVPN.

I had misread it thinking routes will appear on client.

The cause of this behavior of the routes is hidden in this element : gateway=

Internally, the route uses an numeric id to identify the interface (you can see it in e.g. in SNMP). Now the fact that your interface is dynamically created on connect makes this identifier to change on reconnect, because on reconnect, the old interface is deleted and a new interface is created, having the same name. This will render your previous route invalid.

To work around this, either use IP criteria to route traffic (e.g. gateway = 192.168.5.6) or create a static l2tp server binding for that connection. In that way, the interface will not change its ID dynamically, will be there even in disconnected state, and the route will be correct all the time.