Community discussions

MikroTik App
 
oldcrow
just joined
Topic Author
Posts: 21
Joined: Sun Jul 15, 2018 11:04 am

lte apn default route and distance

Tue Dec 18, 2018 11:48 am

HI Gurus
I am very impressed with automagic lte usb dongle config but would like to adjust the route distance as the lte created has a distance of 0 in my route table and my primary internet defaults to 1..
I have briefly managed this previously but lost it on upgrades/reboots/interface restarts.
The mikrotik wiki implies that configuring the apn will do what I want by setting default-route-distance "Since v6.2, sets distance value applied to auto created default route, if add-default-route is also selected".
How do I get the default route to apply this change? Selecting add-default-route in apn and lte1 interface does not seem to do it.
Or is the wiki wrong and I am stuck with an automatic route that overrides all settings?
Thanks
oldcrow
 
oldcrow
just joined
Topic Author
Posts: 21
Joined: Sun Jul 15, 2018 11:04 am

Re: lte apn default route and distance

Tue Dec 18, 2018 1:25 pm

Oops forgot details
6.43.7 stable and hAP ac lite
sorry
 
oldcrow
just joined
Topic Author
Posts: 21
Joined: Sun Jul 15, 2018 11:04 am

Re: lte apn default route and distance

Wed Jan 02, 2019 12:10 pm

Hi all

Bought another dongle and installed on spare hap ac lite (destined for boat far away dongle to be used currently on boat in third hap), and this one works according to distance set on lte interface not apn interface(both primary lte and apn have distance parameters to set. Works 6.4.34 and 6.4.38.
The wiki implies apn should take priority if add-default-route is enabled (but does not seem to).
Difference between routers is the second one does not have an ethernet connection to the internet so lte is primary (or only) interface not secondary. Maybe this causes an issue for the default route script. .

Regards
oldcrow
 
oldcrow
just joined
Topic Author
Posts: 21
Joined: Sun Jul 15, 2018 11:04 am

Re: lte apn default route and distance

Sun Jan 06, 2019 2:55 pm

Hi all, quick work around script based via netwatch
open to improvements corrections


Simple guide to lte failover without load sharing for those of us with limited mobile data plans

Assumptions
Main provider is "ISP1" - DNS 111.111.111.211, configured on ether1
lte provider irrelevant as long as it works, I assume your lte is named lte1


Use tools - Ping 111.111.111.211 using interface ether1 to make sure it works and
lte1 to make sure it doesn't
If it does ping from lte1 then
Add (IP) address 111.111.111.211 (leave network field blank)
ensure you set interface to your ether1 (or equivalent DSL/cable WAN interface),


Netwatch
Address 111.111.111.211, pick a ping time that will not annoy your provider (i minute say) and set a long timeout like 1000 ms

Up script, - you only need to turn the lte off once so check if is off already first

:if ![/interface get value-name=disabled [/interface find name=lte1]] do= (
:/interface disable lte1;
:log warning "ISP1 back, lte disabled";
)
you could also use :log info but I like the blue colour, stands out.

Down script - you only need turn lte on once otherwise it will fill up the log and can make the usb 4g dongle renegotiate

:if [/interface get value-name=disabled [/interface find name=lte1]] do=(/interface enable lte1;
:log warning "ISP1 down -> 4G enabled";
)

If you had a running lte before enabling netwatch it should shortly become disabled
hope you never need to see if it works!
Cheers
oldcrow

Who is online

Users browsing this forum: blejzu, BrateloSlava, Omerik and 61 guests