Thursday, July 10, 2008

Setting Up StarHub Maxmobile (Huawei E270) on RHEL 5.1

There are posts from other people saying that this can be easily configured in ubuntu. However, that doesn't really applies on RHEL 5.1. Unfortunately, I am using RHEL 5.1 on my laptop as preconfigured by our IT helpdesk. I have no intention to reinstall a ubuntu or Fedora as I will have to figure out how to configure other stuff like VPN, email, etc all over again.

RHEL is mainly a server OS. I think most people don't use RHEL on desktop/laptop except redhat employees. I have spent some time figuring out how to configure the Huawei e270 modem and getting it work on RHEL. I think it might be useful to share the information here in case some people need to do the same.

First thing first, you need to make sure that the modem is recognized properly. Most often the modem is recognized as a USB storage instead.
1) Download usb_modeswitch from http://www.draisberghof.de/usb_modeswitch/ and extract the files to /opt/usb_modeswitch, for example.
2) Plug in Huawei E270 modem and execute the following command as root.

# /opt/usb_modeswitch-0.9.4/usb_modeswitch -v 0x12d1 -p 0x1003 -H 1

You may need to execute the same command a few times until you see the following message:

Looking for default devices
Found default devices (1)
Prepare switching, accessing latest device
OK, Huawei control message successfully sent.
-> See /proc/bus/usb/devices (or call lsusb) for changes. Bye

3) Now if you execute "ls /dev/ttyUSB*", you should able to see a list of USB devices.


Second step is to dial-in to StarHub 3G network. Login as root and execute the following commands:

# chmod -c a+rwx /etc/wvdial.conf
# chmod -c a+rwx /etc/ppp/pap-secrets
# chmod -c a+rwx /etc/ppp/chap-secrets

Edit the file /etc/wvdial.conf and add the following content:

[Dialer hsdpa]
Modem = /dev/ttyUSB0
Modem Type = Analog Modem
Baud = 460800
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 =
Phone = *99#
Username = star
Password = hub
Ask Password = off
Dial Command = ATDT
Stupid Mode = on
Compuserve = off
Force Address =
Idle Seconds = 0
DialMessage1 =
DialMessage2 =
ISDN = off
Check Def Route = on
Auto DNS = on

After these are done, execute the command "wvdial hsdpa" and you should be able to see the following output:

--> WvDial: Internet dialer version 1.54.0
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Thu Jul 10 15:32:48 2008
--> pid of pppd: 5031
--> Using interface ppp0
--> local IP address 10.13.165.229
--> remote IP address 10.64.64.64
--> primary DNS address 203.116.1.78
--> secondary DNS address 203.116.254.150

Good luck!