Community discussions

MikroTik App
 
ecastellani
just joined
Topic Author
Posts: 16
Joined: Sat Feb 23, 2019 7:47 pm
Location: Italy

LTE auto-APN

Thu Apr 04, 2019 2:08 pm

Hi,

I need to provide SXTLTE pre-configured and often I don't know which operator will work best.. the guys that will have to manage the antenna are not skilled on mikrotik so I would like to provide a black box able to select the correct APN for each provider.
I can configure TIM/VODAFONE/H3G-WIND/ILIAD APNs but HOW can I handle the select APN depending on the inserted SIM?

The "B" plan would be to precheck the operator code in ICCID or IMSI (not impossible but a bit tricky via script)..

The "A" plan is.. a feature able to select itself magically the right APN :lol:

Any idea, suggestion.. script.. ?

thanks in advance
 
ecastellani
just joined
Topic Author
Posts: 16
Joined: Sat Feb 23, 2019 7:47 pm
Location: Italy

Re: LTE auto-APN

Thu Apr 04, 2019 4:05 pm

shame on me..

have to test it but I just realized that the LTE inferface itself allows to select multiple APN Profiles..
 
uberdome
Frequent Visitor
Frequent Visitor
Posts: 97
Joined: Fri Oct 31, 2014 5:50 pm

Re: LTE auto-APN

Sat Feb 15, 2020 5:33 am

I'm looking to accomplish the same goal. I did not attempt to configure multiple APNs on the same interface, but I'm interested to know how it worked for you.

Does it just try all the APNs until one works? I didn't see a way to favor one or the other by any metric.

What was your eventual solution?
 
uberdome
Frequent Visitor
Frequent Visitor
Posts: 97
Joined: Fri Oct 31, 2014 5:50 pm

Re: LTE auto-APN

Sat Feb 15, 2020 5:36 am

Well, I spoke too soon. I tried and my card does not work with multiple APNs.

I am still interested to know what solution you came up with. I'm currently expecting to use a script to identify the 4th, 5th, and 6th characters of the IMSI to match the carrier, but I don't want to take the time if there is a better way.
 
User avatar
SiB
Forum Guru
Forum Guru
Posts: 1888
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: LTE auto-APN

Sat Feb 15, 2020 2:48 pm

uberdome
if there is a better way.
No build-in function who will be set a proper APN settings via selected source like proper sim-slot, imei or result of ISP (scan feature).
All that must be done by simple scheduler script with one IF and set proper APN if current is differ.
Source of information:
Image

As you can see you can easy grab your sim slot and other command to select proper APN - your can create it many, not change apn value inside the same one.
 
uberdome
Frequent Visitor
Frequent Visitor
Posts: 97
Joined: Fri Oct 31, 2014 5:50 pm

Re: LTE auto-APN

Sat Feb 15, 2020 3:22 pm

...As you can see you can easy grab your sim slot and other command to select proper APN - your can create it many, not change apn value inside the same one.
I'm using LHG R systems, so I only have one sim slot. Like the original question, I'm interested to make a seamless installation effort so the installer can just put in one of our SIM options and have it connect correctly. I don't want the installer to go in and run commands or change settings because they won't be trained to do so.

Were you suggesting a script scheduler for changing the APNs on a single SIM?
 
User avatar
SiB
Forum Guru
Forum Guru
Posts: 1888
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: LTE auto-APN

Sat Feb 15, 2020 4:05 pm

uberdome
I'm using LHG R systems... I don't want the installer to go in and run commands or change settings because they won't be trained to do so.
Then do nothing and should just work or upgrade ROS with boot-fw.
Default APN should be blank that means it should receive the APN directly from ISP. This should be best for you.
MikroTik as vendor have few modems and this is just work or it's fix if not work properly e.g.

You can see history of changes at https://mikrotik.com/download/changelog ... lease-tree
.
What's new in 6.47beta32 (2020-Feb-10 11:45):
- Make sure LTE APN Profile name does not match any of the DHCP server's names if LTE passthrough is used.
*) lte - do not allow using empty APN Profile names;
*) lte - use APN from network when blank APN used on R11e-4G;

What's new in 6.45beta62 (2019-Jun-13 10:13):
*) lte - allow setting empty APN;
*) lte - use default APN name "internet" when not provided;
.
Try with your differ ISP:
[marcin.przysowa@SXTR_LTE6] > /interface lte apn set [find default] apn="" ;

uberdome
Were you suggesting a script scheduler for changing the APNs on a single SIM?
.
Only when default configuration not works with your differ ISP in your region.. because each your ISP use differ APN settings and not send to MT the SIB message from eNB. In Poland all ISP works with default apn=* means anythink you provide is works as default apn=internet. That means I can not write wrong apn, all what I write give me a connection.Of course you can have own APN from ISP then you must give this specific one in configuration.
You can create a separate WebFig www access for all your installer and only one field they can see after logon into WebFix - the APN settings.
You can create a script who will be checking the current operator or other field who describe you a ISP and proper apn for them.
All this can be done only when default apn is not work.

You can write to support@mikrotik.com and ask vendor about that but remember to provide your country and most often APN.
I think the best universal way is to check the IMSI (International Mobile Subscriber Identity) number who have got at first digits the MNC (Mobile Network Code) means number of your ISP.
You must found a source of detection the ISP like: at+cimi or info feature or filter logs etc. and after that just set proper apn. This should be 2-3 lines of code script.
 
uberdome
Frequent Visitor
Frequent Visitor
Posts: 97
Joined: Fri Oct 31, 2014 5:50 pm

Re: LTE auto-APN

Sat Feb 15, 2020 4:37 pm

Then do nothing and should just work or upgrade ROS with boot-fw.
Default APN should be blank that means it should receive the APN directly from ISP. This should be best for you.
MikroTik as vendor have few modems and this is just work or it's fix if not work properly e.g.
...
Try with your differ ISP:
[marcin.przysowa@SXTR_LTE6] > /interface lte apn set [find default] apn="" ;
This might be how to get it to work! I didn't realize they added this feature on the last testing release. I will try it.

Do you know how to check what APN was used from the ISP to confirm if it is the correct one?

Only when default configuration not works with your differ ISP in your region.. because each your ISP use differ APN settings and not send to MT the SIB message from eNB. In Poland all ISP works with default apn=* means anythink you provide is works as default apn=internet. That means I can not write wrong apn, all what I write give me a connection.Of course you can have own APN from ISP then you must give this specific one in configuration.
In the US, there are multiple APNs often on the same ISP. If you choose the wrong APN, your service will be limited in the wrong way, or you will not be allowed to connect. This is why I'm trying to get it just right.

You can write to support@mikrotik.com and ask vendor about that but remember to provide your country and most often APN.
I think the best universal way is to check the IMSI (International Mobile Subscriber Identity) number who have got at first digits the MNC (Mobile Network Code) means number of your ISP.
You must found a source of detection the ISP like: at+cimi or info feature or filter logs etc. and after that just set proper apn. This should be 2-3 lines of code script.
If the first option does not work, I will be using a script to just check the IMSI since we only work with 2 vendors and they have different MNC numbers in the IMSI. This is the method I've been expecting, I just haven't followed through.
 
User avatar
SiB
Forum Guru
Forum Guru
Posts: 1888
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: LTE auto-APN

Sat Feb 15, 2020 6:45 pm

uberdome
.
Do you know how to check what APN was used from the ISP to confirm if it is the correct one?
What? If you have a proper APN then you can connect to internet and receive any IPv4 or IPv6 address from ISP. Many commangs or logs can proof that.
When I set apn="" then have connection but I haven't in logs any information about receive apn and I cannot answer you.
.
[marcin.przysowa@SXTR_LTE6] > put [interface lte get lte1 running ]
true
[marcin.przysowa@SXTR_LTE6] > put ([interface lte info lte1 once as-value ]->"session-uptime")
02:14:20
.
In the US, there are multiple APNs often on the same ISP. If you choose the wrong APN, your service will be limited in the wrong way, or you will not be allowed to connect. This is why I'm trying to get it just right.
.
Then you must set it manually.
You should ask your ISP what APN you should use and create a easy script who will be set this on base some parameters.
Maybe you should receive SMS with counter of used MB/GB and then change the APN to have other offer from ISP - some ISP do that policy and on differ APN give differ limitation.
I am EMEA\Poland and don't know your US networks and ISP politics.
I can only with write a proper and shortest and most optimal script but you must give me information to build a proper IF loop.
.
If the first option does not work, I will be using a script to just check the IMSI since we only work with 2 vendors and they have different MNC numbers in the IMSI. This is the method I've been expecting, I just haven't followed through.
In my opinion is the best way.
You should check what will be with your lhgr with wrong apn and empty apn. No connection but imsi will be show at Cellular tab or status registration in network itself or nothing until apn will be correct.
I cannot check this in my country.
Best table is:
https://en.wikipedia.org/wiki/Mobile_Ne ... erica_-_US
https://www.4gapn.com/us/en/us-mobile <- with MCC,NNC,APN

You should check some of them in reality of IMSI codes.

In my example in PL my IMSI is:
260121000490483
Scan give me MCC-MNC: 26001
and other's ISP in PL have got just other one digits.
.
[marcin.przysowa@SXTR_LTE6] > interface lte scan lte1
Flags: C - current, A - available, F - forbidden
OPERATOR MCC-MNC ACCESS-TECHNOLOGY RSSI RSRP RSRQ
CP 26001 Evolved 3G (LTE) -73dBm -104dBm -15.5dB
Play 26006 Evolved 3G (LTE)
Orange 26003 Evolved 3G (LTE)
TM PL 26002 Evolved 3G (LTE)
.
But we have got the Virtual ISP who share the same FOUR MCC-MNC and I must (in old days) provide a correct APN value. Now all ISP use just "internet" as default apn and I can plug any SIM card from any ISP. You must try empty apn and if this not work then only manual settings give you a connection.
 
uberdome
Frequent Visitor
Frequent Visitor
Posts: 97
Joined: Fri Oct 31, 2014 5:50 pm

Re: LTE auto-APN

Sun Feb 16, 2020 4:32 am

I'm running 6.47beta32. It turns out, it won't let me run a blank APN. After a reboot, it fills it with "internet".

I'm also not running the R11e-4G, so auto APN from the network may not work, but since it fills the APN with "internet" anyhow, I can't seem to use it. I will check with support because this feels odd.

When I asked about "How do you check the APN that is used", since vendors use multiple APNs, it would be important to identify if the correct APN was provided by the network. I'm using the Quectel EC25 in this case, and I found I can run the command "AT+CGDCONT?" and it will tell me the currently connected APN. If I can get the network-APN to work as you suggested, then I will be able to check and verify it is the correct one.

Thank you for your help so far, I'm going to check with support before trying further.
 
User avatar
SiB
Forum Guru
Forum Guru
Posts: 1888
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: LTE auto-APN

Sun Feb 16, 2020 4:50 am

At r11e-lte6 this command works too.
.
[marcin.przysowa@SXTR_LTE6] > interface lte at-chat 0 input="at+cgdcont\?"
  output: +CGDCONT: 5,"IP","internet.cp.mnc012.mcc260.gprs","37.109.59.226",0,0,,,,
[marcin.przysowa@SXTR_LTE6] > put ([interface lte at-chat 0 input="at+cgdcont\?" wait=no as-value ]->"output")
+CGDCONT: 5,"IP","internet.cp.mnc012.mcc260.gprs","37.109.59.226",0,0,,,,
.
internet.cp it's my APN who is currently not set, apn="" but command show that long value.

Who is online

Users browsing this forum: Drean and 11 guests