WWAN Network Connectivity

From Gentoo-en
Jump to: navigation, search

This guide is written for people who want to use their UMTS/HSPA/EVDO Card with Gentoo Linux. The first part of this guide will tell you what kernel options you will need to get the hardware working. The next part will be the configuration for the datacard to establish a ppp connection to your provider. A couple of configuration examples are given for different providers.

Kernel configuration

USB to Serial converter for the Modem is necessary. To establish the PPP connection to the provider, ppp support also has to be enabled in the kernel.

Linux Kernel Configuration: 2.6.27-gentoo-r8 - USB and PPP setup
Device Drivers ->
    USB support  --->
        <M> OHCI HCD support (If not use Intel or VIA chipset)
        <M> UHCI HCD (most Intel and VIA) support (If use Intel or VIA chipset)
        <M> USB Serial Converter support  --->
            [*] USB Generic Serial Driver
            <M> USB driver for GSM and CDMA modems
    Network device support  --->
        <*> PPP (point-to-point protocol) support
        <*> PPP support for async serial ports

Recompile the kernel and reboot or/and load the newly enabled modules.

Hardware detection

After loading the necessary modules, plug the modem and wait for a few seconds and check that ttyUSB* devices are created.

dmesg
 usbserial: USB Serial support registered for GSM modem (1-port)
 option: USB Driver for GSM modems: v0.7.2
 option 4-1:1.0: GSM modem (1-port) converter detected
 usb 4-1: GSM modem (1-port) converter now attached to ttyUSB0
 option 4-1:1.1: GSM modem (1-port) converter detected
 usb 4-1: GSM modem (1-port) converter now attached to ttyUSB1

In this case ttyUSB0/1 are created, this might differ if you already have others usb/serial controllers pluged. Check that devices are actually created.

ls -l /dev/ttyUSB*
 crw-rw---- 1 root uucp 188, 0 2009-03-15 17:48 /dev/ttyUSB0
 crw-rw---- 1 root uucp 188, 1 2009-03-15 17:48 /dev/ttyUSB1

Vendor and Product ID can be found by typing lsusb command

lsusb
 Bus 004 Device 003: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem

Last thing to do regarding hardware is to make sure that the user has access to serial port, it has to be a member of the uucp group.

In some cases you'll need to use sys-apps/usb_modeswitch software to disable an embedded usb storage

Software

KDE kppp

You need have net-dialup/ppp first.

emerge -av ppp
emerge -av kppp

In Model table, add a new model at /dev/ttyUSB0 (or others), Flow control set to Hardware, termination = CR and speed = 460800. Add extra command at Modem table if you need enter PIN password

 AT+CPIN= [your PIN]

Add a new account and tel number please refer for wvdail session as your telcom setting. For Chunghwa Telcom is

 *99#

Input both Username and password are dummy.

Vodafone

Vodafone provide a nice UI interface write in python, but only one version seems to work (sometimes) with gentoo

 https://forge.betavine.net/frs/download.php/267/vodafone-mobile-connect-card-driver-for-linux-2.0.beta3.tar.gz

wvdial

You need have net-dialup/ppp first.

emerge -av ppp

To establish the connection emerge wvdial if not done yet and edit its configuration file with root priviledges. If /etc/wvdial.conf does not exist you can run wvdialconf to generate one. Below is an example of a configuration used for SFR network in France, you will have to search for a configuration that suits your provider:

nano /etc/wvdial.conf
File: /etc/wvdial.conf
[Dialer Defaults]
Baud = 460800
ISDN = false
Init1 = AT+CPIN=6541
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
Init3 = AT+CGDCONT=16,"IP","websfr"
Modem = /dev/ttyUSB0
Modem Type = Analog Modem
username=dummy
password=dummy
Phone = *99***16#

For Fonic in Germany, the following /etc/wvdial.conf may work for you:

File: /etc/wvdial.conf
[Dialer Defaults]
Dial Attempts = 1
Init1 = ATZ
Init3 = ATE0V1&D2&C1S0=0+IFC=2,2
Modem Type = Analog Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyUSB0
ISDN = 0
Carrier Check = no

[Dialer fonic-pin]
Init2 = AT+CPIN=<YOUR_PIN>

[Dialer fonic]
Init4 = AT+CGDCONT=1, "IP","pinternet.interkomm.de","",0,0
Username=fonic
Auto DNS = 1
Password=fonic
Dial Command = ATDT
Phone = *99#
Stupid Mode = 1

For Rogers Wireless in Canada with the Sierra Wireless AirPrime MC7700 WWAN card, the following /etc/wvdial.conf may work for you:

File: /etc/wvdial.conf
[Dialer Defaults]
Modem Type = Analog Modem
Modem = /dev/ttyUSB3
Baud = 9600
ISDN = 0
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

[Dialer Rogers]
Phone = *99#
Username = "wapuser1"
Password = "wap"
Stupid Mode = 1
Baud = 460800
Init3 = AT+CFUN=1
Init4 = AT+CGDCONT=1,"IP","internet.com"
Idle Seconds = 0

To connect your usb modem, first unlock it by transmitting the PIN:

wvdial fonic-pin # initialize the modem

Then, connect to your provider

wvdial fonic # connect to provider

For SFR in France you may have to use this /etc/wvdial.conf if the previous one doesn't work for you:

File: /etc/wvdial.conf
[Dialer Defaults]
Modem = /dev/ttyUSB0

[Dialer pin]
Modem = /dev/ttyUSB0
Baud = 115200
Dial Attempts = 2
Init1 = ATZ
Init2 = AT+CPIN=<YOUR_PIN>
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

[Dialer Vodafone]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","slsfr"
Modem Type = Analog Modem
Baud = 115200
New PPPD = yes
Modem = /dev/ttyUSB0
ISDN = 0
Dial Command = ATDT
Phone = "*99***1#"
Password = "slsfr"
Username = "slsfr"

Again, you have to the following to connect:

wvdial pin # initialize the modem
wvdial Vodafone # connect to internet

This is for Australia's Network 3 (Three):

File: /etc/wvdial.conf
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Check Def Route = on
Phone = *99#
Modem Type = Analog Modem
Stupid Mode = 1
Baud = 9600
Dial Command = ATDT
Dial Attempts = 3
Modem = /dev/ttyUSB0
ISDN = 0
Password = dummy
Username = dummy

[Dialer connect]
Init2 = ATZ
Init3 = ATE0V1&D2&C1S0=0+IFC=2,2
Init4 = AT+CGDCONT=1,"IP","$apn"
ISDN = 0
Modem = /dev/ttyUSB1
Modem Type = Analog Modem
Baud = 460800

This is for Finland's Network Saunalahti:

File: /etc/wvdial.conf
[Dialer Defaults]
Init = AT+CGDCONT=1,"IP","internet.saunalahti"
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Stupid Mode = 1
Modem Type = Analog Modem
Phone = *99***1#
ISDN = 0
Username = " "
Password = " "
Modem = /dev/ttyUSB0
Baud = 9600

For Chunghwa Telcom (中華電信) Taiwan :

File: /etc/wvdial.conf
[Dialer Defaults]
Phone = *99#
APN = internet
Username = pummy
Password = pummy
Stupid Mode = 1
Dial Command = ATDT
Modem = /dev/ttyUSB0
Baud = 460800
Init1 = ATZ
Init2 = AT+CPIN=<YOUR_PIN> (if necessary)
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ISDN = 0
Modem Type = Analog Modem 

For Vodafone Italy :

File: /etc/wvdial.conf
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","web.omnitel.it","",0,0
Phone = *99***1#
Modem Type = Analog Modem
Baud = 9600
New PPPD = yes
Modem = /dev/ttyUSB_utps_modem
Init = ATZ0
ISDN = 0
Username = ininfluente
Password = ininfluente
Carrier Check = yes
Stupid Mode = yes

Now it's time to establish the connection, open a console with your user and run wvdial.

wvdial
 --> WvDial: Internet dialer version 1.60
 --> Initializing modem.
 --> Sending: AT+CPIN=6451
 AT+CPIN=6451
 OK
 --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2
 ATQ0 V1 E1 S0=0 &C1 &D2
 OK
 --> Sending: AT+CGDCONT=16,"IP","websfr"
 AT+CGDCONT=16,"IP","websfr"
 OK
 --> Modem initialized.
 --> Sending: ATDT*99***16#
 --> Waiting for carrier.
 ATDT*99***16#
 CONNECT
 --> Carrier detected.  Waiting for prompt.
 --> Don't know what to do!  Starting pppd and hoping for the best.
 --> Starting pppd at Sun Mar 15 18:16:10 2009
 --> Warning: Could not modify /etc/ppp/pap-secrets: Permission denied
 --> --> PAP (Password Authentication Protocol) may be flaky.
 --> Warning: Could not modify /etc/ppp/chap-secrets: Permission denied
 --> --> CHAP (Challenge Handshake) may be flaky.
 --> Pid of pppd: 7930
 --> Using interface ppp0
 --> pppd: ¨·[06][08]½[06][08]Ø·[06][08]
 --> pppd: ¨·[06][08]½[06][08]Ø·[06][08]
 --> pppd: ¨·[06][08]½[06][08]Ø·[06][08]
 --> pppd: ¨·[06][08]½[06][08]Ø·[06][08]
 --> pppd: ¨·[06][08]½[06][08]Ø·[06][08]
 --> local  IP address 10.162.164.227
 --> pppd: ¨·[06][08]½[06][08]Ø·[06][08]
 --> remote IP address 10.64.64.64
 --> pppd: ¨·[06][08]½[06][08]Ø·[06][08]
 --> primary   DNS address 172.20.2.39
 --> pppd: ¨·[06][08]½[06][08]Ø·[06][08]
 --> secondary DNS address 172.20.2.10
 --> pppd: ¨·[06][08]½[06][08]Ø·[06][08]

Connection is now established, you can check that the network interface is up and it has an ip address:

ifconfig
 ppp0      Link encap:Point-to-Point Protocol
           inet addr:10.162.164.227  P-t-P:10.64.64.64  Mask:255.255.255.255
           UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
           RX packets:44 errors:0 dropped:0 overruns:0 frame:0
           TX packets:55 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:3
           RX bytes:17688 (17.2 KiB)  TX bytes:6282 (6.1 KiB)

The modem should have a fixed green light if connected in 2G, a blue light if connected in 3G, you should now be connected to the internet.

Gnome Network Manager

  1. Edit Connections in Network Manager icon
  2. Select Mobile BroadBand Tab and add a new connection
  3. Select your operator

For Vodafone Italy change the original APN in:

web.omnitel.it

See also