Cellular Quectel modems 01
This article will contain example on how to configure Quectel cellular modem in using PPP interface in RouterOS v6.xx
Article covers following models:
- Possibly others also.
- In RouterOS v6.xx all of these modems will use PPP interface for communication, which means that maximum achievable connection speed for all of them is limited to around 35Mbps (limit of serial interface).
- In RouterOS v7.xx for modems that support MBIM drivers like EC20 model, LTE interface support will be possible and it will allow to achieve full LTE connection potential.
EC20 compatibility details
To get EC20 working in RouterOS device you will have to make sure that it is configured to use UC20 hardware id's vendor-id 0x05c6 device-id 0x9003.
This can be achieved by sending modem AT command: at+qcfg="usbid",1478,36867
In RouterOS this can be done by using serial-terminal and logging into modem by channel which supports use of AT commands. To see if channel in which you logged in support at command simply type in "AT" and press enter. If reply is "OK!" then you can send AT command over that channel. IF there is no response or some non-related info being printed then you need to try another channel.
Check if you see usb port added by modem, and channel amount that it has:
Then use that usb port with one of it's channels via serial-terminal command.
/system serial-terminal port=(usbX) channel=(X)
After mentioned command that changes hw it's has been issued, you need to exit serial terminal and reboot the router. After the startup modem will be found with required HW id's.
- All the related documents are possible to obtain on Quectel website: http://www.quectel.com/
- Latest firmwares and technical questions replies are available on: email@example.com
Configuration example / Comments
This example will be covered in CLI (command line interface) configuration method. Some additional screenshots will be included so quick view for Winbox would also be there for reference.
1. Prepare modem for use in your Router
- These steps should be performed while router is powered off! Or else there is a chance of damaging the modem or router.
- Insert sim in sim-card slot that is on your router.
- Add required antennas to modem (if required) and insert it in mini-pcie slot.
- Power on the router.
- Ideally we always recommend to keep router fully updated: HOWTO upgrade RouterOS
2. Check if router sees the added device
Now let's check if router sees the device that you just added and can work with it.
- Check if ROS sees the modem with command: "/interface print"
[admin@MikroTik] > interface print Flags: D - dynamic, X - disabled, R - running, S - slave # NAME TYPE ACTUAL-MTU L2MTU 0 R ether1 ether 1500 1600 1 X wlan1 wlan 1500 1600 2 R ppp-out1 ppp-out 1500
We can see that interface #2 is ppp-out1, it will be the modem that you just added (presuming that it is not ppp interface from some other modem/configuration that you added previously).
Additional info to check (if required/needed).
- Ports, command: "/port print"
[admin@MikroTik] > port print Flags: I - inactive # DEVICE NAME CHANNELS USED-BY BAUD-RATE 0 1:2 usb1 5 PPP <ppp-out1> 9600
- If ROS sees modem as USB device, command: "/system resource usb print"
[admin@MikroTik] > /system resource usb print # DEVICE VENDOR NAME SPEED 0 2:1 Linux 3.3.5 ohci_hcd Tile-Gx OHCI 12 Mbps 1 1:1 Linux 3.3.5 ehci_hcd Tile-Gx EHCI 480 Mbps 2 1:4 Quectel, Incorporated UMTS/HSPA Module 480 Mbps
- IF you want to use modem in one of RB9xx series devices with MiniPCIe slot and system does not see modem. It's worth checking
if this device modem has shared USB port. Some of RB9xx series share one usb data like between USB port and MiniPCIe slot. And to make mPCIe modem that requires USB connection to work you will need to switch to required value.
More info in Switching USB type switching
3. Configure the modem
Modem configuration part.
- Check ppp-client menu for required interfaces, command: "/interface ppp-client print"
[admin@MikroTik] > /interface ppp-client print Flags: X - disabled, R - running 0 R name="ppp-out1" max-mtu=1500 max-mru=1500 mrru=disabled port=usb1 data-channel=3 info-channel=2 apn="internet.example.com" pin="" user="" password="" profile=default phone="" dial-command="ATDT" modem-init="" null-modem=no dial-on-demand=no add-default-route=yes default-route-distance=0 use-peer-dns=yes keepalive-timeout=30 allow=pap,chap,mschap1,mschap2
- Configure ppp interface, command example:
/interface ppp-client set 0 dial-on-demand=no use-peer-dns=yes add-default-route=yes \ data-channel=3 info-channel=2 apn=internet.example.com
break down of this command:
dial-on-demand=no <--- This option specifies if modem should be active only when someone is trying to use it or all the time. use-peer-dns=yes <--- use DNS servers that are provided by your cellular service provider. add-default-route=yes <--- Should default route be added (YES, if this is going to be the only WAN interface on your router). data-channel=2 <--- Data channel over which you will access your wan connection. info-channel=3 <--- Info channel used for gathering debug info on modem and connection quality. apn=internet.example.com <--- Access point name provided to you by your operator, ... pin <---Pin code if required by sim which you are going to be using.
This part will depend on what you need to configure, first five options will be a requirement. Starting with APN other options like pin, etc configuration becomes dependent on what your cellular ISP requires. to get all available options in console while inputing press tab.
- After executing previous command to check if modem has connected you can run the same: "/interface ppp-client print" command and check if ppp interface have running flag "R". Or run monitor command: "/interface ppp-client monitor 0"
[admin@MikroTik] > /interface ppp-client monitor 0 status: connected uptime: 34m12s encoding: connect-speed: 115200 mtu: 1500 mru: 1500 local-address: x.x.x.x remote-address: 0.0.0.0
And gotten IP address from ISP.
[admin@MikroTik] > /ip address print Flags: X - disabled, I - invalid, D - dynamic # ADDRESS NETWORK INTERFACE 0 ... 1 D x.x.x.x/32 x.x.x.x ppp-out1 <----
4. Additional configuration
One last configuration piece to allow access from LAN to WAN, command: "/ip firewall nat add chain=srcnat out-interface=ppp-out1 action=masquerade"
Now to confirm that every thing has been configured correctly I suggest to run ping to some web resource from both your router and PC that is connected to lan. As if there is some problems this step might indicate where you should look for the.
[admin@MikroTik] > export ... /interface ppp-client add apn=internet.example.com data-channel=3 dial-on-demand=no disabled=no \ info-channel=3 name=ppp-out1 port=usb1 /ip firewall nat add action=masquerade chain=srcnat out-interface=ppp-out1 ... [admin@MikroTik] >