Difference between revisions of "Cisco 1941 with EHWIC-3G-HSPA+7 card configuration"

From Ever changing code
Jump to navigation Jump to search
(Created page with "The main resources of this tutorial are coming from http://routing-bits.com/2010/05/12/hwic-3g-gsm/ === Preamble === Three components are required to use a 3G data connection...")
 
Line 40: Line 40:
   rxspeed 21600000
   rxspeed 21600000
   txspeed 5760000
   txspeed 5760000
=== NAT and cellular routing ===
Local lan is connected to Gi0/1 and all traffic is NAT overload'ed through Cellular0/0/0 interface. There ip 192.168.100.254/24 is a default gateway for local LAN hosts.
interface GigabitEthernet0/1
  ip address 192.168.100.254 255.255.255.0
  ip nat inside '<--- NAT needed when coming from private addresses'
  ip virtual-reassembly in
  duplex auto
  speed auto
!
interface Cellular0/0/0
  description WAN link to Vodafone-APN
  ip address negotiated '<--- The NAS will issue your card an IP address'
  ip nat outside
  ip virtual-reassembly in
  encapsulation slip '<--- new modem cards are using native slip protocol to communicate with the router '
  dialer in-band
  dialer string hspa '<--- Again uses the chat-script'
  dialer-group 1 '<--- References the dialer-list (interesting traffic)'
  async mode interactive
!
interface Cellular0/0/1
  no ip address
  encapsulation slip
!
ip forward-protocol nd
!
ip nat inside source list 2 interface Cellular0/0/0 overload
ip route 0.0.0.0 0.0.0.0 Cellular0/0/0 '<--- Static route to cellular interface required by Cisco for proper packet routing'
!
access-list 2 permit any
dialer-list 1 protocol ip permit '<--- Specifies interesting traffic to bring up the dialer'

Revision as of 13:00, 28 August 2013

The main resources of this tutorial are coming from http://routing-bits.com/2010/05/12/hwic-3g-gsm/

Preamble

Three components are required to use a 3G data connection: a SIM, a radio modem, and a router. The SIM identifies the subscriber (that is you the human) for billing and so forth. The radio modem does the hard work in providing physical layer (Layer1) access to the local 3G base station. The router typically uses PPP as the Layer2 data link to the provider’s Network Access Server (NAS), and from there is connected to the provider’s Layer3 network (which may be a private VPN, or public Internet).

The cellular modem must establish a data call, then once connected a PPP session is established to the providers NAS. The cellular modem still requires age-old AT commands to make that call, and additionally to interrogate the SIM, etc. Cisco IOS provides an interface to a handful of modem features via the “cellular” exec command and a chat script(s). Note that AT commands can only be issued when the modem is idle (not in a call).

The modem is configured with at least one “profile” which stores an Access Point Name (APN) and optionally a username and password. This profile is then “dialled” to establish the connection similar to using a traditional phone number. These modem profiles are stored on the modem and NOT on the routers NVRAM or flash. Note that a modem profile and an IOS dialer profile are two separate things.

The EHWIC-3G-HSPA+7 is just a Sierra Wireless MC8705 AirPrime modem sold in a EHWIC form factor with a Cisco Logo on it. The modem is presented in Cisco IOS as two interfaces:

Low-speed asynchronous “control” interface which communicates with the modem.

line x/x/x

High-speed synchronous interface connecting to the cellular providers network.

interface cellular x/x/x

Configure APN

APN configuration is stored on the modem nvram not on the router it self. Cisco IOS provides interface to manipulate the modem and modem profiles with following syntax:

cellular 0/0/0 gsm create profile create 1 <apn name> chap <username> <password> ipv4

Both working profiles for Vodafone contract are below, the first one with CHAP auth seems to be quicker to establish connection:

cellular 0/0/0 gsm profile create 1 internet chap web web ipv4
cellular 0/0/0 gsm profile create 2 internet pap web web ipv4

Define Vodafone provider AT command in a chat-script

Syntax:

chat-script <dialer_name> "" "AT!SCACT=1,<apn_profile_number>" TIMEOUT 60 "OK"

Live command:

chat-script hspa "" "AT!SCACT=1,1" TIMEOUT 60 "OK"

Configure line interface

This line interface information sets low-speed asynchronous “control” interface which communicates with the modem. The line x/x/x number is the same as cellular x/x/x interface number.

line 0/0/0			'<---This will depend on what slot the card uses'
 exec-timeout 0 0
 script dialer hspa 		'<---Calls the chat-script'
 script activation hspa	'<---activates the script it did not work without and it is not documented anywhere'
 modem InOut
 no exec
 rxspeed 21600000
 txspeed 5760000

NAT and cellular routing

Local lan is connected to Gi0/1 and all traffic is NAT overload'ed through Cellular0/0/0 interface. There ip 192.168.100.254/24 is a default gateway for local LAN hosts.

interface GigabitEthernet0/1
 ip address 192.168.100.254 255.255.255.0
 ip nat inside 		'<--- NAT needed when coming from private addresses'
 ip virtual-reassembly in
 duplex auto
 speed auto
!
interface Cellular0/0/0
 description WAN link to Vodafone-APN
 ip address negotiated 	'<--- The NAS will issue your card an IP address'
 ip nat outside
 ip virtual-reassembly in
 encapsulation slip 		'<--- new modem cards are using native slip protocol to communicate with the router '
 dialer in-band
 dialer string hspa 		'<--- Again uses the chat-script'
 dialer-group 1 		'<--- References the dialer-list (interesting traffic)'
 async mode interactive
!
interface Cellular0/0/1
 no ip address
 encapsulation slip
!
ip forward-protocol nd
!
ip nat inside source list 2 interface Cellular0/0/0 overload
ip route 0.0.0.0 0.0.0.0 Cellular0/0/0 '<--- Static route to cellular interface required by Cisco for proper packet routing'
!
access-list 2 permit any 
dialer-list 1 protocol ip permit	'<--- Specifies interesting traffic to bring up the dialer'