Use a backup gateway if needed on the same LAN (but different IP)

Hi, I’ve a particular situation, the router is located where the 4G signal doesn’t arrive, Use a 10 meters USB externder and place the LTE dongle near the window can’t be done too, the only way I have is to connect a 4G router to the LAN in another room.
My idea is to assign this router another IP domain, add an IP address to the main Mikrotik and configure a static route with higher distance to this backup gateway. I’ve some questions about it, how can I proceed?
May I need a script that ping a specific IP, the next hop, with TTL=1 (is it possible to ping with TTL=1?), or ping using the source IP of the primary connection (possibile?) anything else (better 2 different address and check if both fail).. and if the answer doesn’t come activate the default router on the backup, and deactivate the primary one? While keep always pinging with primary source adress and if start reply back replace the default route as before.

Also, any chance to notify about this process? would be lovely to receive a telegram message, but how? I may send a trap SNTP to a windows workstation, that can be connected to a telegram bot.. with node red is possible, but a bit huge for just a small thing like this.
Thank you for answers

You do not need a script. Read about “recursive routing”, “check-gateway”, etc.

Is this an XY problem?
As far as I read this, the first router is still functioning, when the Internet connection drops , and the LTE path should be followed, for the time needed.
This is a classic failover case, where the internet line is backed up with the path via the LTE router. If the LTE interface is local or only reachable via via, makes no difference.
In such case the clients keep using the first router as the default gateway. First router which does the failover via the LTE router if needed. The clients don’t need to know where that LTE router is, and don’t (be able to) use the LTE router. (For the first router the LTE router could be defined as on the WAN side, even if it sits together with the clients on the same ethernet interface).

Not as easy to understand as Node Red, but a setup with a lot of possibilities : http://forum.mikrotik.com/t/advanced-routing-failover-without-scripting/136599/1

Thanks, I need time to read that guide, yes it is a tipical failover, but it should be reached by the LAN.. I’m reading you’re writing about the first main router can configure a virtual LTE interface that mirrors the real LTE one of another mikrotik, placed on the same LAN, which is able to trigger it on demand.
If I can imagine it easier, it’s just necessary to place the LTE of the second router on a new separated bridge, and connect it to a VLAN providing the pure LTE domain to the primary router, there is maybe eventually the chance to failover to a second bridge, where LTE is connected, it can work.
The second router I need for capsman, so the main brigde should be in the LAN domain.

About the other question, how to get noticed if failover occours, which way you use? You send an email?
Thanks

The LTE router is just as another ISP router for the first router. That second bridge is indeed what could be needed (if bridged connection is needed, it could also be routing). Using VLAN or a VPN tunnel is a clear way to separate the traffic on the LAN cable. Clients will always go over the first router for the LAN/WAN transition (SRC-nat or masquerade, FW rules, etc), even if the current WAN connection is the LTE, and the traffic already goes over the first LAN bridge in the LTE router.

For collecting all information in one place, I use syslog of DUDE. For important things, like UPS main power down, the LOG sends e-mail. (LOG action = email) on any logging router.