Wednesday, July 22, 2020

Mikrotik Connect USB Modem

Currently there are usb ports available in almost all mikrotik routers. Using this USB port we can connect USB storage or pen drive with mikrotik router. Again in the same way we can connect USB Modem. However, the modem must be mikrotik compatible. A list of modems that are compatible with mikrotik routers can be found at the link below.


In addition to the models mentioned in the list, it also supports almost all the modems available in the market. As we have used a simple modem in this tutorial, which is not in the compatible list of mikrotik. However, this modem supports by router. If a modem is compatible with the mikrotik router, then the router will show the information of that modem in its USB list, when the modem is connecting to the router,. It will also create a "PPP Client Apapter" for him. We used a modem from Qualcomm and it shows up in the middle of the list.


To view this USB list, we first go to System -> Resource. We can see this list by clicking on the USB button there.


In addition to showing in this list, the router will create a “PPP Client” adapter for our modem and show it in the PPP interface list. However, this interface will remain disabled.


If a modem does not automatically detect by router, then we must assume that, this modem is not mikrotik compatible.

Now we will open the adapter to connect the modem and provide the APN information of the modem.


This APN information can be obtained from the SIM operator. Another thing we need to note is, whether the modem port is automatically detected. If not, then we have to manually select it.


Then we go to "Advanced Mode". For that, you just have to click on the “Advanced Mode” button.


After accessing the “Advanced Mode” we will go to the “PPP” tab. There we have to enter a dial number in the “Phone” field. Usually the number is "* 99 #". The number may also change from country to country. You can get this number from SIM operators. However, in most countries the number is "* 99 #".


If you want to use the connection of this modem as secondary, then you have to increase the value of routing distance of this connection.

Suppose, we are connected to the internet in two ways. The first is broadband cable connection and the second is GSM Modem connection. Of course, modem connection will be much slower than cable connection. So we all want all the traffic on the internet to be forwarded with cable connection. If for some reason the cable connection is disconnected, then all traffic will be forwarded with the modem connection. To do this we will use the value of routing distance. The lower the value, the more the network will be counted first. The value next to it is second and the value after it is third, thus it will be given priority. In this scenario, the routing distance of broadband cable connection will be 1 and the value of routing distance of GSM modem connection will be 2. The value of this routing distance can be configured from the "Route Configuration" window.


In this tutorial, we have only used GSM modem for internet connection, so we are not changing the value of routing distance. That means there is 1.


After enabling and applying, the status of our adapter will change to "waiting for packets".


If everything is OK, after a while the status will be changed by "Link established" and then "connected".


At this stage our modem is now connected to the Internet. Now, to share this internet connection with users, we need to configure Source NAT using PPP client adapter. To configure NAT, we will go to “IP -> Firewall”. From there we will select “NAT”.


Now we will add a “src nat” rule by clicking on the “add (+)” button. Here we will select “srcnat” in the “Chain” field and have to select the PPP client adapter in the “Out Interface” field.


Now we will select "masquerade" as action.


Done. From now on all users will be able to connect to the internet using GSM modem.

2 comments:

  1. Very nice and informative post. This post cleared my all confusion about this item. I really like this and also like your blog. zyxel c3000z

    ReplyDelete
    Replies
    1. Thank you. If you like my blog then share it with your network.

      Delete