Community discussions

MikroTik App
 
User avatar
robmaltsystems
Long time Member
Long time Member
Topic Author
Posts: 534
Joined: Fri Jun 21, 2019 12:04 pm

LTE failover - am I going crazy?

Tue May 11, 2021 10:09 pm

I've implemented failover on a Mikrotik HAP that had two broadband connections and I achieved that with scripting etc. Remember it well :-)

However, I'm pretty sure that I plugged a USB LTE modem into the USB port of a basic system and it just sort of worked, i.e. if WAN on ether1 failed, it switched over to LTE. But I've just tried that on a new system and there is no automatic failover.

Is my memory playing tricks and you always have to do *some* configuration changes to get LTE failover to work on a basic reset router?
 
User avatar
robmaltsystems
Long time Member
Long time Member
Topic Author
Posts: 534
Joined: Fri Jun 21, 2019 12:04 pm

Re: LTE failover - am I going crazy?

Tue May 11, 2021 11:35 pm

I think it's coming back to me... failover "works" if you add the LTE interface to the WAN list (so very little configuration) and then unplug the wired ethernet cable. At this point, the ether1 entry disappears from the routing table leaving the lte1 route with distance 2. At this point traffic then flows down through the LTE interface.

I think this was my memory of it "working" with no configuration/minimal configuration.

Of course, this isn't very good failover as unplugging the cable is not a real life failure (possible but unlikely) and a more likely failure is that the wired link will still be up and the link fails somewhere down the line. So ether1 still in the routing list and as it has distance 1, the router will try and send data down that interface.

Hence the requirement for the variety of monitoring scripts/monitors solutions to ensure that traffic can flow down ether1 and if not, force failover to lte. My next question/post might be about the best solution to this as there seems to be many ways to skin this particular cat (what a horrible phrase!).
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2978
Joined: Mon Apr 08, 2019 1:16 am

Re: LTE failover - am I going crazy?

Wed May 12, 2021 12:03 am

Have a look at this ... viewtopic.php?f=23&t=157048

If there is no incoming traffic, then you don't even need the routing marks : viewtopic.php?f=23&t=157048#p827694
 
User avatar
eworm
Forum Guru
Forum Guru
Posts: 1070
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: LTE failover - am I going crazy?

Wed May 12, 2021 12:33 am

I would use my script Notify on host up and down for that. The primary use is to notify, but it can run up and down hooks. It has a simple state machine, that does not trigger on first error (but is configurable).

Given you have installed the script and created a scheduler, this is what you need on top:
/ip route add distance=1 gateway=10.0.0.1 routing-mark=via-en
/ip route add comment="toggle via netwatch-notify" distance=1 gateway=10.0.0.1
/ip firewall mangle add action=mark-routing chain=prerouting dst-address=1.0.0.1 new-routing-mark=via-en
/tool netwatch add comment="notify, hostname=check-en, down-hook=/ ip route disable [ find where comment=\\\"toggle via netwatch-notify\\\" ], up-hook=/ ip route enable [ find where comment=\\\"toggle via netwatch-notify\\\" ]" host=1.0.0.1
Note that 1.0.0.1 is always routed via gateway 10.0.0.1 and thus unavailable if lte takes over. Just use an address that is reliable but does not matter for you.
 
User avatar
robmaltsystems
Long time Member
Long time Member
Topic Author
Posts: 534
Joined: Fri Jun 21, 2019 12:04 pm

Re: LTE failover - am I going crazy?

Wed May 12, 2021 1:01 am

Thanks all - the requirement here is for a wedding venue where they want to go cashless when they are allowed to re-open next week in the UK but need a failover in case the BT leased line goes down. My plan is to put the card readers and till on their own little subnet normally supplied by the BT leased line but failing over to the LTE modem if monitoring down the ethernet port fails. I love the power/low cost that Mikrotik offers here.

I'll look at the links tomorrow. Next problem is that I've bought a Huawei e3372h-320 which doesn't work with RouterOS v6.x - fine with v7 but that's a different problem. All part of the learning curve!
 
User avatar
robmaltsystems
Long time Member
Long time Member
Topic Author
Posts: 534
Joined: Fri Jun 21, 2019 12:04 pm

Re: LTE failover - am I going crazy?

Wed May 12, 2021 1:11 am

I love RouterOS more each day. I asked myself - I wonder if the router could send an email when the link fails. Yup - baked in SMTP client :-)
 
User avatar
eworm
Forum Guru
Forum Guru
Posts: 1070
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: LTE failover - am I going crazy?

Wed May 12, 2021 1:14 am

Use my scripts and it will even send Telegram messages. 😉

This is from testing the configuration I posted above:
Screenshot_2021-05-12_00-15-25.png
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: Bing [Bot], holvoetn and 76 guests