Sunday, 28 September 2014

Configuring Basic 4G LTE Connectivity on the Cisco 819 Router

I've recently had the mixed fortune to have set up a couple of Cisco routers for 3G and 4G data services. It turns out to be surprisingly simple, although I found myself having to flit around between a handful of different documents to work out how to get it working. Luckily I was sat next to someone who previously worked in one of the UK's biggest mobile carriers while I was working on it, which saved me a bit of head scratching at times.

As a little bonus I had two different devices to work on - the first being an old Cisco 1841 router with a 3G WIC installed, the second being a Cisco 819 (4G LTE model). As it turns out the concepts are pretty similar but the syntax is moderately different between the two platforms, so in time I'll write up the process for each. This post and its accompanying video will explain the 4G version.



Building Blocks


While there are a few mobile-specific pieces of configuration, anyone who has previously worked on ISDN, async modems or ADSL on Cisco routers will probably find a lot of familiar concepts. Here are the main elements of a 3G / 4G configuration:

Cellular Profile 


This is where the APN address and authentication mode are configured. These are saved to the modem's NVRAM as soon as they are applied. Here's an example of how to set a cellular profile on the two different platforms:

Router#cell 0 lte profile create 1 three.co.uk none

PDP Type = IPv4
Access Point Name (APN) =
Username =
Password =
Authentication = NONE

Profile 1 already exists with above parameters. Do you want to overwrite? [confirm]

Profile 1 will be overwritten with the following values:

PDP type = IPv4
APN = three.co.uk
Username =
Password =
Authentication = NONE

Are you sure? [confirm]
Profile 1 written to modem
Router#


Note that this example is for three, a UK mobile carrier which is interesting because the APN uses no authentication (and barfs if you try to authenticate with it). I found during my testing that an 819 router running IOS 15.2 does not have the option to use authentication type "none". Under 15.3 the option is there and works fine - luckily I had another 819 with 15.3 installed which worked and so a) I knew that's what the problem was and b) I could copy the image across!

Also note that this is applied at the exec prompt rather than in config mode.

Most carriers use CHAP authentication, these just require the authentication type and credentials added to the command, for example:

cell 0 lte profile create 1 everywhere chap eesecure secure

The number "1" here indicates which slot on the modem will be used to store the profile. This is significant later on because there may be multiple APNs configured and the router needs to know which to use when connecting.

Cellular Interface


The physical radio interfaces are referred to using the "Cellular" prefix, in this case Cellular0. The Cellular interface is where the dialer, authentication and IP details are normally configured - I say normally as there are many different ways to configure dialers depending on what kind of load balancing and resilience are required. For a typical 3G / 4G deployment, though, you will only have one physical interface and so the simplest way is to forget about pools and put the config straight onto that.

Here is an example configuration showing the key elements:

interface Cellular0
 ip address negotiated
 encapsulation slip
 dialer in-band
 dialer-group 1
!
dialer-list 1 protocol ip permit
ip route 0.0.0.0 0.0.0.0 Cell0


The key thing to notice here is that unlike the old 3G config there is no "*98*1#" type diaper string. If you want to use alternative profiles you have to mess around with config under the "controller cellular 0" context.

The rest is fairly standard dialer stuff, in this example I've made the dialer-list so that any IP traffic will cause it to connect.

Note that the encapsulation specified on this 4G interface is SLIP. When 4G is not available it will fall back to 3G (which uses PPP encapsulation) - it does this transparently and does not need the encap changed.

Sundry Config

At this point the router should be able to connect to the cellular network. For most purposes, though, you will need to either set up NAT or some sort of VPN tunnel for the connection to be of any use. These are set up the same way as for any other setup.

Testing and Diagnostics

How can you tell whether the cellular connection is coming up? The first clue is that log entries similar to the following should appear:

%LINK-3-UPDOWN: Interface Cellular0, changed state to up

If the above log entries don't appear it could be because the modem is not ready yet. The modems in the 819 routers I was playing with took an incredibly long time to boot. The following logs indicate that the modem has (finally) booted up:

%CISCO800-2-MODEM_UP: Cellular0 modem is now UP.
%CISCO800-6-SIM_STATUS: SIM in slot 0 is present

However at this point the modem will still need to attach to the cellular network, which can take a little time. To check whether the modem is attached to the radio network, use the following commands:

Router#show cell 0 radio
Radio power mode = ON
Channel Number = 1667
Current Band = LTE
Current RSSI = -60 dBm
Current RSRP = -84  dBm
Current RSRQ = -4  dB
Current SNR = 10.6  dB
LTE Technology Preference = AUTO
LTE Technology Selected = LTE

Router#show cell 0 network
Current System Time = Sun Jan 6 0:1:30 1980
Current Service Status = Normal
Current Service = Packet switched
Current Roaming Status = Home
Network Selection Mode = Automatic
Network = 3
Mobile Country Code (MCC) = 234
Mobile Network Code (MNC) = 20
Packet switch domain(PS) state = Attached
Registration state(EMM) = Registered
Location Area Code (LAC) = 107
Cell ID = 9150878
Primary Scrambling Code = 65535


Note that the band and channel need to be populated, the network should display the expected carrier name and the packet service should show as attached. The actual band and service type will vary depending on carrier, coverage, area and equipment used.

If the radio interface is up but a data connection cannot be established then all the usual debugs may be used:

debug dialer (to verify it is trying to dial)
debug chat (sometimes useful to deduce whether APN is configured correctly)
debug cellular 0 messages callcontrol (shows the cellular network assigning the IP and DNS)

Note on Earlier Releases


Prior to IOS 15.3 you had to define your own chat string and apply it to the line - later releases do this automatically. If your "debug chat" output shows anything about "ATDT" or expecting "CONNECT" then this probably applies to you. Making and applying the chat script is pretty simple:

chat-script lte "" "AT!CALL" TIMEOUT 20 "OK"
line 3
 script dialer lte
!

Basically this says to define a script called "lte" which waits for nothing, sends "AT!CALL" to the modem and expects to get "OK" in return within 20 seconds. Then that script gets attached to line 3, which in the 819 router is the 4G cellular modem.

References


Cisco 4G configuration guide
YouTube clip accompanying this post


17 comments:

  1. Can you post an article about configuring 4G on Cisco ISR2 routers such as Cisco 2921 routers?

    http://www.keyboardbanger.com

    ReplyDelete
    Replies
    1. Hi,

      I'm afraid while I could possibly lay my hands on a 2900 router, I don't have an EHWIC-4G-LTE card to play with. The 819 is an ISR G2 router so the config would be identical other than the interface unit number - you should be able to just replace any references to "cellular 0" with "cellular 0/0/0" (or wherever your EHWIC is installed).

      Foeh

      Delete
  2. Hi, I have gone through your walk through (and video) a few times but I am struggling with the final ping check coming back. I am connecting using a new EE sim - here is the info from the show cell commands.

    Envision#show cell 0 radio
    Radio power mode = ON
    Channel Number = 1667
    Current Band = LTE
    Current RSSI = -68 dBm
    Current RSRP = -95 dBm
    Current RSRQ = -8 dB
    Current SNR = 19.0 dB
    Radio Access Technology(RAT) Preference = AUTO
    Radio Access Technology(RAT) Selected = LTE

    Envision#show cell 0 network
    Current System Time = Sun Jan 6 1:18:0 1980
    Current Service Status = Normal
    Current Service = Packet switched
    Current Roaming Status = Home
    Network Selection Mode = Automatic
    Network = EE
    Mobile Country Code (MCC) = 234
    Mobile Network Code (MNC) = 30
    Packet switch domain(PS) state = Attached
    Registration state(EMM) = Registered
    Tracking Area Code (TAC) = 10833
    Cell ID = 4381696
    Primary Scrambling Code = 65535

    Profile 1 = ACTIVE* **
    --------
    PDP Type = IPv4
    PDP address = 178.109.107.78
    Access Point Name (APN) = everywhere
    Authentication = PAP
    Username: eesecure
    Password: secure
    Primary DNS address = 109.249.185.224
    Secondary DNS address = 149.254.201.126

    * - Default profile
    ** - LTE attach profile

    When I try to do my Ping check I get the following log

    Envision#ping 8.8.8.8
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
    *Dec 21 20:15:57.895: Ce0 DDR: place call
    *Dec 21 20:15:57.895: Ce0 DDR: Dialing cause ip (s=10.10.10.1, d=8.8.8.8)
    *Dec 21 20:15:57.895: Ce0 DDR: Attempting to dial lte
    *Dec 21 20:15:57.895: CHAT3: Attempting async line dialer script
    *Dec 21 20:15:57.895: CHAT3: Dialing using Modem script: lte & System script: none
    *Dec 21 20:15:57.899: CHAT3: process started
    *Dec 21 20:15:57.899: CHAT3: Asserting DTR
    *Dec 21 20:15:57.899: CHAT3: Chat script lte started
    *Dec 21 20:15:57.899: CHAT3: Sending string: AT!CALL
    *Dec 21 20:15:57.899: CHAT3: Expecting string: OK
    *Dec 21 20:15:57.951: CHAT3: Completed match for expect: OK
    *Dec 21 20:15:57.951: CHAT3: Chat script lte finished, status = Success
    *Dec 21 20:15:58.155: cellwan_api_handle_profile_ip_addr_get_resp valid 1 length 4 session active 1
    *Dec 21 20:15:58.155: cellwan_api_handle_profile_ip_addr_get_resp valid 1 length 4 session active 1
    *Dec 21 20:15:58.155: Cellular0 DirectIP: Primary DNS address 109.249.185.224 added
    *Dec 21 20:15:58.155: Cellular0 DirectIP: Secondary DNS 149.254.201.126 added
    *Dec 21 20:15:58.179: Cellular0 DirectIP: Primary DNS address 109.249.185.224 added
    *Dec 21 20:15:58.179: Cellular0 DirectIP: Secondary DNS 149.254.201.126 added.
    *Dec 21 20:15:59.951: %LINK-3-UPDOWN: Interface Cellular0, changed state to up
    *Dec 21 20:15:59.951: Ce0 DDR: Dialer statechange to up
    *Dec 21 20:15:59.951: Ce0 DDR: Dialer call has been placed
    *Dec 21 20:15:59.951: Cellular0 DirectIP: Install negotiated IP interface address 178.109.107.78
    *Dec 21 20:15:59.951: Ce0 DDR: dialer protocol up
    *Dec 21 20:16:00.951: %LINEPROTO-5-UPDOWN: Line protocol on Interface Cellular0, changed state to up....
    Success rate is 0 percent (0/5)

    My subsequent ping's also get 0 percent and two minutes later I get a time out message

    *Dec 21 20:18:05.895: Ce0 DDR: idle timeout
    *Dec 21 20:18:05.895: Ce0 DDR: disconnecting call
    *Dec 21 20:18:07.895: %LINK-5-CHANGED: Interface Cellular0, changed state to reset
    *Dec 21 20:18:08.895: %LINEPROTO-5-UPDOWN: Line protocol on Interface Cellular0, changed state to down
    *Dec 21 20:18:10.895: Cellular0 DirectIP: Remove negotiated IP interface address
    *Dec 21 20:18:10.895: Cellular0 DirectIP: Primary DNS address 109.249.185.224 removed
    *Dec 21 20:18:10.895: Cellular0 DirectIP: Secondary DNS 149.254.201.126 removed
    *Dec 21 20:18:10.935: Cellular0 DirectIP: Remove negotiated IP interface address
    *Dec 21 20:18:10.943: Cellular0 DirectIP: Remove negotiated IP interface address
    *Dec 21 20:18:12.895: %LINK-3-UPDOWN: Interface Cellular0, changed state to down
    *Dec 21 20:18:22.895: Ce0 DDR: re-enable timeout

    Any ideas?

    ReplyDelete
    Replies
    1. Hi, Mark.

      Sorry for the delay in getting back to you. I've seen similar behaviour to this when a SIM has been either out of data allowance or has not been activated yet. There may be SMS received on there to indicate what the problem is (commands under "cell 0 lte sms", if I remember correctly). I expect you've already tried but it may be worth setting up your LAN side and NAT config to see whether you hit a captive portal when you try to browse, alternatively you could try putting the SIM into another device (i.e. a mobile handset).

      Please let me know what it was when you get to the bottom of it!

      Thanks,

      Foeh

      Delete
  3. first of all ask provider to activate the simcard and check it for sure, it save so much time of tshooting, next remember - if you use new modems, they only able to do encapsulation slip, and you do not need to create chat script by yourself, just create static route through Cellular interface nad try to ping it, then IOS automatically create neccesary chat-script, just look it in the configuration and use its name for Line 3 -> script dialer -||-
    and for sure you need valid apn username and password with chap authentication(in most cases) and ipv4 mode profile for Cellular modem

    ReplyDelete
    Replies
    1. 100% with you on checking the SIM. Just stuff it in a mobile handset to rule out provisioning issues.

      As I say above, in IOS 15.3 and above it creates the chat script for you. It may have been a bug in the 15.2 IOS that shipped with my device but that release didn't create chat scripts.

      My carrier is 3 UK, they don't care what APN you use, what authentication scheme or what password. For a little while I was accidentally connecting with EE's APN config on the 3 network. Pretty odd and I know that other carriers (tested Vodafone and EE) require the proper settings in order to connect.

      Delete
  4. Hi,
    Your blog is very helpful and I appreciate it. I an looking forward to creating DMVPN with 4G as failover or backup. In all th configs I saw on your blog nothing show that. Can you post an article about configuring 4G on Cisco ISR2 routers as a failover or backup. Thanks

    ReplyDelete
    Replies
    1. Hi,

      The 819 config is basically applicable to the ISR G2s, it's just that the interface number will change.

      Cisco's LTE deployment guide is pretty good and has DMVPN examples: http://www.cisco.com/c/dam/en/us/td/docs/routers/access/interfaces/software/deployment/guide/c07-731484-00-ngewan.pdf

      Good luck :)

      Delete
  5. Hi,
    Your blog is very helpful and I appreciate it. I am looking forward to creating DMVPN with 4G as failover or backup. In all the configs I saw on your blog nothing shows that. Can you post an article about configuring 4G on Cisco ISR routers as a failover or backup. Thanks

    ReplyDelete
  6. Foeh,
    Thanks for the response and the attachment. I will read through and let you know later.
    Thanks

    ReplyDelete
  7. I Have few Cisco C841M-4X/K9 with flash:c800m-universalk9-mz.SPA.155-3.M.bin. All the location are having similar issue, Radio band goes to Unknown State. I tried forcefully giving technology as GSM, after reboot again the Band is getting selected as auto or unknown.

    Radio power mode = ON
    Channel Number = 0
    Current Band = Unknown
    Current RSSI = -78 dBm
    Current ECIO = -14 dBm
    Technology Preference = AUTO
    Technology Selected = HSDPA (Downlink) and HSUPA (Uplink)

    ReplyDelete
    Replies
    1. Hi,

      I'm afraid I've not seen this problem before - are the SIMs definitely valid?

      Delete
  8. Hi,

    getting below error while changing the tech to lte from auto.

    cisco#cellular 0/0/0 lte technology lte
    Warning: Not all PDP contexts are in shutdown state
    Please shutdown all the interfaces manually and re-enter this command.

    Can you please have a look.

    Thanks

    ReplyDelete
  9. I'm new to configuring Modems, I have a Cisco 829 and I'm trying to ping out to the internet (8.8.8.8) but no luck. I can send a successful SMS message but can't ping. I noticed that my default profile 1 is Inactive - could that me the issue and how do I resolve it?

    IR800#sh cellular 0 all
    Hardware Information
    ====================
    Modem Firmware Version = SWI9X15C_05.05.58.00
    Modem Firmware built = 2015/03/04 21:30:23
    Hardware Version = 1.0
    Device Model ID: MC7354
    Package Identifier ID: 1102037_9903214_MC7354_05.05.58.00_00_Cisco_005.009_000
    International Mobile Subscriber Identity (IMSI) = 302720602281326
    International Mobile Equipment Identity (IMEI) = 356734060025982
    Integrated Circuit Card ID (ICCID) = 89302720403041396069
    Mobile Subscriber Integrated Services
    Digital Network-Number (MSISDN) =
    Current Modem Temperature = 38 deg C
    PRI SKU ID = 9903214, PRI version = 05.09, Carrier = 4

    Profile Information
    ====================

    Profile 1 = INACTIVE* **
    --------
    PDP Type = IPv4
    Access Point Name (APN) = LTESTATICIP.APN
    Authentication = None

    Profile 2 = INACTIVE
    --------
    PDP Type = IPv4
    Access Point Name (APN) =
    Authentication = None

    Profile 16 = INACTIVE
    --------
    PDP Type = IPv4
    Access Point Name (APN) = Broadband
    Authentication = None

    * - Default profile
    ** - LTE attach profile


    Configured default profile for active SIM 0 is profile 1.

    ReplyDelete
    Replies
    1. Do you have a route statement sending data to your cell interface?
      ip route 0.0.0.0 0.0.0.0 Cellular0

      Delete
  10. Any idea why data would be passing fine over the cell interface but I'm unable to send SMS?

    OUTGOING_SMS_ERROR: Cellular0 failed to send an outgoing SMS.

    ReplyDelete
  11. hi, how do you configure this router for fixed landline first then failover to the 4G? i don't need the landline to dial out just need to enter the ip, dns details etc as we have EFM Hatteras thanks

    ReplyDelete