Tuesday, July 1, 2014

How to use a huawei unlocked 3g modem from another carrier Fortigate by changing the APN string

In this post we will use a huawei E160X 3g-usb-modem that was previously used with the celluar
carrier vodafone.

For more information on modems, please see the following page

To use this modem, we must ensure it's unlocked. If not, we would need to generate a huawei unlock code by using a  online code generator. But b4 we do that, we will query the modem to see if it's unlock.

 The AT commad AT^CARDLOCK? will tell you if your modem is indeed locked.

1= locked
2= unlocked

( NOTE:  see the orange rectangle  in the below output )

If your modem is lock  stop and generate a unlock code and try to unlock it;

note: google  search for huawei unlock code generator, for a website that genertes unlocks based on the IMEI number for the modem.The IMEI is the equivalent of a fingerprint for the modem


A simple method for issuing  AT commands, is to attach the modem to a PC & by using  an async terminal program. The execution of a few modem "AT" commands will provide you some good information.


Alternative;  use the diag sys modem cmd command via the fortigate command-line.

(e.g issuing the  modem ATI command "ATtention Inquiry " )
The above output gives you the following information. Alternatively you could have gotten the same output and more by using the  query command.

NOTE: I placed some highlights that we will discuss later on in this post.

The APN dataset  is very very important. It identifies what data Acces Point by Name that you are attempting to connect to. In this modem the default strings  count is 1,2,3. So it has 3  APN defined for IP and the "internet.vodafone.net" is the APN name . If this APN is defined incorrectly, you will not get an establish data connectivity much less an ip_address. We will change the 1st APN string in this posting.

In my case,  the APN is "netgetesa" for the carrier orange-getesa. Some devices can identify the APN automatically, but others need assistance by the extra issuance of a AT init string. So we will have to correct this by providing an modem AT command.

We also will need the phone# to dial and in some case a username.

In our case, we will  issue this using the following modem configuration for the  carrier GETESA

  • APN = netgetesa
  • phone = *99#

If all is done correctly, we should  have the status showing the modem has established and has made a successful call.

Here's a few common AT comands with a brief summary. Almost all AT suppored 3/4g-modems, support these commands.

ATH  = hangup
ATE  =  Echo back to the screen anything that we type so we can see it on the sreen
ATZ  = reset
AT+CPIN=   =  insert my pin ( e.g AT+CPIN=0000 will insert the pin of  0 0 0  0 )
AT&V   =  get carrier network status ( great to determine if the carrier is activce, if you have a signal,etc......)
AT+CGDCONT=1,"namehere"   =  define APN string #1
( note change the #1 to #2 or #3 if you want to change the other strings)
ATI  = inquiry the products
A/  = repeat last successful command ( great when you have a long cmd string and don't want to retype it )

NOTE: sample AT commands outputs

Ken Felix
Freelance Network/Security Engineer
kfelix  -----a----t---- Socpuppets ---dot---com

   ^    ^
=( $ $ )=
     /  \


  1. There are many ways to unlock a Huawei modem and I sort the safe way to unlock mine, through permanent unlock codes from Superunlockcodes.com

  2. Unlock for free your devices (modem and phone) for to use any network worldwide. You do not need any technical knowledge to unlock, go to Mobile Unlock Solution Thanks....

  3. FreedomPop is the first ABSOLUTELY FREE mobile phone provider.

    With voice, SMS & data plans priced at £0.00/month.