Ubuntu里无线上网卡的使用经验

包含网卡/无线网的网络问题和ADSL/校园网/宽带拨号支持及代理/共享等网络使用问题
头像
robust
帖子: 294
注册时间: 2006-07-04 21:56

Ubuntu里无线上网卡的使用经验

#1

帖子 robust » 2008-11-01 10:48

这里的无线上网指的是使用GPRS/EDGE/UMTS/HSDPA/PHS等上网方式,而不是指WLAN(802.11?)。水平有限,只能将用过的几种设备使用过程描述一下,仅供参考。

一、预备知识

手机上网(GPRS/EDGE/UMTS/HSDPA)
手机上网的一个重要参数是接入点(APN),移动的接入点分为cmnet和cmwap,cmnet可以直接访问网络,cmwap则需要通过WAP网关来访问网络,这里网关可以理解为代理服务器。目前,中国移动的WAP网关地址为10.0.0.172,对外提供HTTP代理协议(80和8080端口)和WAP网关协议(9201端口)。类似,联通的接入点对应的是uninet和uniwap,且联通的网络兼容移动的接入点。
一般cmwap用于手机,cmnet则用于PC。但有一些移动卡是cmwap封顶,但cmnet按流量计费,这时PC也可以通过cmwap上网,但要设置应用程序的网关,例如将浏览器的代理服务器设为10.0.0.172:80。
我们一般管手机上网叫GPRS上网,实际移动的EDGE网络也已经覆盖很好了,使用起来并没有很大区别,设置方法基本相同,将来3G上网也一样,主要看网络和终端设备的支持情况。从2G到3G,上网速度越来越快,介于中间的就叫2.5G。GPRS是2.5G、EDGE是2.75G、UMTS叫3G、HSDPA就叫3.5G。

小灵通上网
小灵通上网分为PIAFS方式和分组(Packet)方式,不同的速率和上网方式体现为拨号号码后缀不同:
32k PIAFS ##3
64k PIAFS ##4
32k Packet ##61
128k Packet ##64
如果接入号码是16900,采用128k分组方式上网,则接入码为16900##64。
小灵通上网方式一般是需要用户名和密码的,如果不清楚需要咨询提供服务的运营商。

二、华为E630

华为E630是一款PCMCIA上网卡,支持从GSM拨号到HSDPA,从2G到3.5G的无上网。Ubuntu 8.10对这个上网卡支持的已经很好了,插上后就可以识别硬件,但识别成了E620:
insert-e630.jpg
添加”移动宽带“连接:
e630-1.png
e630-2.png
选择运营商:
e630-3.png
但如果选择,联通(China Unicom),向导并没有配置正确的APN,需要手工将APN设为uninet。因为联通的APN与移动兼容,也可以将运营商选成China Mobile。选择China Mobile时,APN默认为cmnet,cmwap封顶的千万别忘了修改。
e630-4.png
确定保存以后,就可以随时连接”移动宽带“了(还很超前,可能只有3G网络才能算移动宽带):
e630-6.png
e630-6.png (24.51 KiB) 查看 24187 次
但连接成功后,并没有替换局域网的默认网关,配置中也没有找到类似replacedefaultroute的选项,配置文件还不知道在哪里。但只要局域网连接中没有网关,或者停掉就可以使用无线上网了。如果是Ubuntu 8.10之前的版本,可以使用pppconfig、kppp或wvdial等进行配置和使用。
使用cmwap上网的,可能需要将浏览器的代理服务器设为10.0.0.172:80。

三、华为T618手机上网

华为T618是一款3G手机,在香港叫U626,支持GPRS和UMTS。我是使用USB线连在电脑上实现无线上网。原来这个手机只要使用usb线插入电脑后,/dev下就会出现ttyUSB0和ttyUSB1两个文件设备。但在一次修理后,这样不行了,估计是换了手机主板,ubuntu不能识别了。后来通过网上查找资料,找到了一种解决方法。

首先用lsusb命令验证手机是否被正确识别,并查找相关信息:

代码: 全选

# lsusb | grep Huawei
Bus 003 Device 003: ID 12d1:1204 Huawei Technologies Co., Ltd.

# lsusb -v -s 003:003

Bus 003 Device 003: ID 12d1:1204 Huawei Technologies Co., Ltd.
  ............
  idVendor           0x12d1 Huawei Technologies Co., Ltd.
  idProduct          0x1204
  bcdDevice            0.00
  iManufacturer           1 HUAWEI Technologies  
  iProduct                2 HUAWEI Mobile                
  iSerial                 0
  ............
记下idProduct和idVendor的值

创建/etc/udev/rules.d/50-huawei-t618.rules文件
内容如下:

代码: 全选

SUBSYSTEM=="usb", SYSFS{idProduct}=="1204", SYSFS{idVendor}=="12d1", RUN+="/sbin/modprobe usbserial vendor=0x12d1 product=0x1204"
再重新插入手机的usb线,验证一下,如下就说明配置成功了:

代码: 全选

# ls /dev/ttyU*
/dev/ttyUSB0  /dev/ttyUSB1
如果手机一插上就识别出ttyUSB0设置,以上操作就可以省略。
配置连接,图型界面的network-manager里并没有找到选择设备的选项,只好使用字符界面的pppconfig了。由于接入点配置在手机里面,所以也不涉及APN参数。就不贴图了,把选项列举一下:

代码: 全选

sudo pppconfig
(1)选Create
(2)Provider Name:我用的是t618
(3)DNS:Dynamic,自动获得动态的DNS
(4)Authentication Method:CHAP
(5)Username和Password是不需要的
(6)Speed:如果是GPRS用115200就够了,EDGE就230400,UMTS就460800。HSDPA没用过,可能需要在后面再加一下0。
(7)Pulse or Tone:Tone
(8)Phone Number:*99#
(9)Choose Modem Config Method:否
(10)Manually Select Modem Port:/dev/ttyUSB0
(11)Finished Write files and return to main menu.
上网用:pon t618,下网用:poff就可以了。

还是存在不能替换默认网关的问题。如果想要自动成为默认网关,可以修改/etc/ppp/peers/t618,增加一行:

代码: 全选

replacedefaultroute
四、ZTE mv68小灵通上网卡

这也是一个PCMCIA卡。这个卡让我困惑了很长时间,因为插上后并没有出现ttyUSB0设备,lsusb也什么也没找到。其实只要看下dmesg:

代码: 全选

[ 763.480084] pccard: PCMCIA card inserted into slot 0
[ 763.483463] pcmcia: registering new device pcmcia0.0
[ 763.570883] 0.0: ttyS1 at I/O 0x2f8 (irq = 3) is a TI16750
设备就是ttyS1,不像huawei E630属于usbserial。
再用pppconfig配置拨号连接就可以了。与前面说的GPRS上网类似,不同的主要是电话号码、设备名,一般需要一个公用的用户名和口令。

五、Ubuntu 可以直接识别的手机

Nokia 5610手机在Ubuntu 8.10直接就识别了。用network-manager直接配置就行了,参考“二”。
dmesg的信息如下:

代码: 全选

[  198.800061] usb 3-2: new full speed USB device using uhci_hcd and address 3
[  198.978126] usb 3-2: configuration #1 chosen from 1 choice
[  200.463524] cdc_acm 3-2:1.1: ttyACM0: USB ACM device
[  200.466265] usbcore: registered new interface driver cdc_acm
[  200.467494] cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters
[  200.595880] usbcore: registered new interface driver cdc_ether
[  200.603561] usb 3-2: bad CDC descriptors
[  200.604715] usbcore: registered new interface driver rndis_host
[  200.645824] usb 3-2: bad CDC descriptors
[  200.646787] usbcore: registered new interface driver rndis_wlan
设备名称为/dev/ttyACM0。没弄清bad CDC是什么问题,不影响使用不管了。

LG HB620T是一款低端的WCDMA 3G手机,支持7.2M的HSDPA,在Ubuntu 9.04中直接驱动起来。(因为是在不同的时间测试,所以系统版本也在更新,不保证适应于其他版本)

六、在Ubuntu 9.04中使用Option GT Max无线网卡
补充于2009年4月5日,Ubuntu 9.04 (Jaunty)还是beta版。
Option Globetrotter GT Max是一款免驱的PCMCIA上网卡,支持HSDPA。所谓免驱,就是插入后首先识别为CDROM,里面是Win下的驱动,装完驱动后就识别为网卡。同样,Linux中也识别为CDROM,但毫无用处。
这次跟前面所用的方法不同,因为找到一个很好用的程序:Vodafone Mobile Connect Card driver
主页地址:https://forge.betavine.net/projects/vodafonemobilec/
需要安装两个软件包: usb-modeswitch和 vodafone-mobile-connect
但网站中提供的vodafone-mobile-connect还有些问题,我使用的是另一个版本:
(参考:http://www.betavine.net/bvportal/forums ... da5f883eff
http://www.spheresystems.co.uk/vodafone ... 18_all.deb
而usb-modeswitch是官方版本: https://forge.betavine.net/frs/download ... 6_i386.deb
安装完两个软件包,再插入网卡就不识别为CD了。
运行: sudo vodafone-mobile-connect-card-driver-for-linux 就可以了。

现阶段,Ubuntu 9.04的network-manager还是不稳定,gprs经常拨不上去。但odafone-mobile-connect-card-driver-for-linux拨号却很容易。而且可以发短信(支持sim卡的通信录),流量统计功能也不错,还可以看到信号强度。该程序同样支持华为E630。
上个图:
Screenshot-Vodafone Mobile Connect Card driver for Linux.png
Screenshot.jpg
七、在9.10中使用Option GT MAX (gx0201)
现在的版本是9.10b4,network manager可以直接支持gx0201。
上次由 robust 在 2009-08-14 20:13,总共编辑 9 次。
头像
robust
帖子: 294
注册时间: 2006-07-04 21:56

Huawei E630 From Gentoo Linux Wiki

#2

帖子 robust » 2008-11-01 14:54

(这是以前参考文章,刚才又去看已经没了,从google的快照贴过来,以免以后找不到)
Contents

* 1 Introduction
* 2 Prologue
* 3 Kernel prerequesits
* 4 Software
* 5 Links

[edit] Introduction

This is my first How-to so bear with me :-)

This guide is written for people who want to use their UMTS/HSDPA 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. In my case it's T-Mobile Austria.


[edit] Prologue

I got a HSDPA data card for my work and was bored that I've to switch to win if I want to use the card. So I thought I'll give it a try and try to get it to work with Gentoo. After googling around I discovered that there were hardly any tutorials about that card. What I discovered (from Win) was, that the card is/uses it's own USB Controller, where the UMTS/HSDPA modem is connected to.
[edit] Kernel prerequesits

To use this PC Card, see this guide.

Because of the USB Controller you need the OHCI. Furthermore you need USB to Serial converter for the Modem.

代码: 全选

Linux Kernel Configuration: USB Support

Device Drivers  --->
   USB support  --->
      <M> OHCI HCD support
      <M> USB Serial Converter support  --->
         [*] USB Generic Serial Driver
         <M> USB driver for GSM and CDMA modems
This was my worst Problem, cause I've a Centrino Notebook which uses the UHCI support, so I thought, the USB thing has to be ok. With these options enabled, the Hardware should work.

To check this, lspci should show the USB Contoller:

# lspci -v | grep NEC
04:00.0 USB Controller: NEC Corporation USB (rev 43) (prog-if 10 [OHCI])
04:00.1 USB Controller: NEC Corporation USB (rev 43) (prog-if 10 [OHCI])

And the USB Device should show up as well:

# lsusb
Bus 006 Device 002: ID 12d1:1001

# lsusb -v -s 006:002
Bus 006 Device 002: ID 12d1:1001
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x12d1
idProduct 0x1001
bcdDevice 0.00
iManufacturer 1 HUAWEI Technologies
iProduct 2 HUAWEI Mobile
iSerial 0
bNumConfigurations 1

If the card is correctly recognized there the usbserial module should create new tty devices:

# find /dev/ | grep ttyU
/dev/ttyUSB2
/dev/ttyUSB1
/dev/ttyUSB0

This is your HSDPA Card.

If this links aren't created you should try to load usbserial with this command:

1. modprobe usbserial vendor=0x12d1 product=0x1001

Vendor and Product ID can be found by typing lsusb command

After this operation links to usb should appear ind /dev/tts directory

To establish the PPP connection to the provider, ppp support has to be enabled in the kernel:

代码: 全选

Linux Kernel Configuration: PPP Support

Device Drivers  --->
  Network device support  --->
    <M> PPP (point-to-point protocol) support
    <M> PPP support for async serial ports
[edit] Software

To initialize the card, enter the PIN code and login into the network, there is a small program on sourceforge which does that: Linux UMTS/GPRS command-line tool

Download that tool and install it by typing make and make install in the source directory.

To Log into the Network, show Homenetwork and Signal strength:

# comgt
Trying list of devices
SIM ready
Waiting for Registration..(120 sec max)
Registered on Home network: "23203",2
Signal Quality: 17,99

Ok, your card is ready, now you need to establish a PPP connection to your provider. I'm using kppp, but you can use any pppd frontend you want. This is my configfile for kppp:

File: /home/chris/.kde/share/config/kppprc

代码: 全选

[Account0]
AccountingEnabled=0
AccountingFile=
Authentication=3
AutoDNS=1
AutoName=0
BeforeConnect=xterm -e /usr/local/bin/comgt -x -d /dev/ttyUSB2
BeforeDisconnect=
CallbackPhone=
CallbackType=0
Command=
DNS=
DefaultRoute=1
DisconnectCommand=
Domain=
ExDNSDisabled=0
Gateway=0.0.0.0
IPAddr=0.0.0.0
Name=web'n'walk
Password=1234
Phonenumber=*99***1#
ScriptArguments=
ScriptCommands=
StorePassword=1
SubnetMask=0.0.0.0
Username=user
VolumeAccountingEnabled=0
pppdArguments=defaultroute,crtscts,modem,noipdefault,usepeerdns,novj,debug

[General]
AutomaticRedial=0
DefaultAccount=web'n'walk
DefaultModem=HUAWAI
DisconnectOnXServerExit=1
DockIntoPanel=1
NumberOfAccounts=2
NumberOfModems=3
PPPDebug=0
QuitOnDisconnect=0
RedialOnNoCarrier=0
ShowLogWindow=1

[Graph]
Background=255,255,255
Enabled=true
InBytes=0,0,255
OutBytes=255,0,0
Text=0,0,0

[Modem0]
AnswerResponse=CONNECT
AnswerString=ATA
BusyResponse=BUSY
BusyWait=0
ConnectResponse=CONNECT
DLPResponse=DIGITAL LINE DETECTED
Device=/dev/ttyUSB0
DialString=ATD
Enter=CR
EscapeGuardTime=50
EscapeResponse=OK
EscapeString=+++
FlowControl=Hardware [CRTSCTS]
HangUpResponse=OK
HangupString=+++ATH
InitDelay=50
InitResponse=OK
InitString=AT+CFUN=1
InitString1=AT+CGDCONT=1,"IP","gprsinternet","",0,0
Name=HUAWAI
NoCarrierResponse=NO CARRIER
NoDialToneDetection=ATX3
NoDialToneResp=NO DIALTONE
PreInitDelay=50
RingResponse=RING
Speed=460800
Timeout=82
ToneDuration=70
UseLockFile=1
Volume=0
VolumeHigh=M1L3
VolumeMedium=M1L1
VolumeOff=M0L0
WaitForDialTone=1

[WindowPosition]
WindowPositionConWinX=487
WindowPositionConWinY=498
WindowPositionStatWinX=815
WindowPositionStatWinY=485
Don't forget to change the Access Point Name (APN) value on the InitString1=AT+CGDCONT=1,"IP","gprsinternet","",0,0 line from "gprsinternet" to the actual Internet APN. If you don't know the Internet APN, ask your service provider.

Now you have to start Kppp and simply push on connect. If you haven't entered the PIN yet, a window pops up where you have to enter it. After that, the card gets initialized and the PPP connection gets established. In your panel you can see a little icon (world) which shows you the activity. By right clicking on it you can get the actual status of your connection and disconnect from the network.

This HOWTO should also work for Huawei E620 and E618 data cards, however with that card you may experience lock-ups after you insert and reboots after you remove the card. In that case, you have to get a newer hardware revision of the card.

EDIT: Chris Wiggins had to remove the wait for dial tone option which was causing pppd to die unexpectedly with exit status 1:

KPPP > Configure > Modems > Huawei > Modem > Uncheck wait for dialtone before dialing


I hope this will help you. Here are two links where I got information:
[edit] Links

I've found this two tutorials on the net.

* HOWTO by Samiux
* HOWTO by Tazz_Tux

Discussion forum about the Huawei E620 Data Card problems:

* HUAWEI E620/Laptop Hangs (Vodacom3G)?

---KeX- 14:52, 1 February 2007 (UTC)
Retrieved from "http://gentoo-wiki.com/Huawei_E630"
Category: UMTS
头像
想入非非
帖子: 8078
注册时间: 2008-07-14 22:42
来自: Beijing
联系:

Re: Ubuntu里无线上网卡的使用经验

#3

帖子 想入非非 » 2008-11-01 15:21

好详细的说明。。。多谢分享 :em02
Ubuntu User
头像
meteormatt
帖子: 693
注册时间: 2008-02-24 14:15
系统: Ubuntu
来自: 江苏
联系:

Re: Ubuntu里无线上网卡的使用经验

#4

帖子 meteormatt » 2008-11-09 21:17

这个是方向

怀念以前的老台式机。可惜现在租的地方没条件用了。目前只能用笔记本和手机了。
ubt
帖子: 19
注册时间: 2008-11-06 21:00

Re: Ubuntu里无线上网卡的使用经验

#5

帖子 ubt » 2008-11-17 16:46

我从xp转向ubuntu一段时间了,但是我不能cdma无线拨号上网,正郁闷呢。
我的Wireless Modem 是采用高通六系列的,pc接口,该怎么弄呢?
谢谢!~!
头像
robust
帖子: 294
注册时间: 2006-07-04 21:56

Re: Ubuntu里无线上网卡的使用经验

#6

帖子 robust » 2008-12-28 21:55

突然发现Linux比Windows用起来还方便。
上网卡放在公司里,周六周日想用一下无线上网,想起老婆的Nokia 5610运行EDGE。笔记本上除了Ubuntu装的是windows 2003,没想到折腾半天没装上驱动,驱动居然不支持2003。 :em20
但在Ubuntu 8.10里太方便了,插上直接就用。 :em11
yangzhonglei
帖子: 20
注册时间: 2007-11-26 13:48

Re: Ubuntu里无线上网卡的使用经验

#7

帖子 yangzhonglei » 2009-02-17 23:25

我的是移动edge无线网卡,Ubuntu8.10没有检测到这个无线p卡,该怎样去设置呢?一头雾水。
头像
robust
帖子: 294
注册时间: 2006-07-04 21:56

Re: Ubuntu里无线上网卡的使用经验

#8

帖子 robust » 2009-02-21 21:39

yangzhonglei 写了:我的是移动edge无线网卡,Ubuntu8.10没有检测到这个无线p卡,该怎样去设置呢?一头雾水。
先开机,再插入卡,dmesg最后几行是什么?
头像
robust
帖子: 294
注册时间: 2006-07-04 21:56

Re: Ubuntu里无线上网卡的使用经验

#9

帖子 robust » 2009-04-05 23:41

为了搞定option gt max,找到一个不错的程序:vodafone-mobile-connect-card-driver,补充进来。
程序对我手头的option gt max和华为E630支持得都很好,推荐一下。
头像
wangdu2002
帖子: 13284
注册时间: 2008-12-13 19:39
来自: 物华天宝人杰地灵

Re: Ubuntu里无线上网卡的使用经验

#10

帖子 wangdu2002 » 2009-04-05 23:50

楼主辛苦了,好东西,顶之! :em11
行到水穷处,坐看云起时。
海内生明月,天涯共此夕。
--------------------吾本独!
头像
friend.ethan
帖子: 687
注册时间: 2008-05-13 20:40
来自: 江南西道

Re: Ubuntu里无线上网卡的使用经验

#11

帖子 friend.ethan » 2009-04-07 13:05

好资料,搜藏备用
头像
robust
帖子: 294
注册时间: 2006-07-04 21:56

Re: Ubuntu里无线上网卡的使用经验

#12

帖子 robust » 2009-04-26 22:09

还是option gt max (gx0201),升级了固件到2.5.11,前面的方法又不行了。
用下面的方法可以搞定,但这个hsoconnect软件经常不响应:
http://peck.org.uk/HSOconnect-Ubuntu-8.04.html
hock
帖子: 7
注册时间: 2006-11-09 19:13

Re: Ubuntu里无线上网卡的使用经验

#13

帖子 hock » 2009-04-28 0:33

做个记号
roadd
帖子: 53
注册时间: 2009-04-26 0:36

Re: Ubuntu里无线上网卡的使用经验

#14

帖子 roadd » 2009-04-28 11:37

能指导我试试中兴mu350怎么设置吗?我装的9.04,插上后提示连不上ZTEMODEM。
头像
robust
帖子: 294
注册时间: 2006-07-04 21:56

Re: Ubuntu里无线上网卡的使用经验

#15

帖子 robust » 2009-04-29 22:26

roadd 写了:能指导我试试中兴mu350怎么设置吗?我装的9.04,插上后提示连不上ZTEMODEM。
我用过的每个网卡都是上网搜索看了其他人的说明,反复试验才弄好的。mu350没用过,不敢发表意见,更谈不上指导。

建议先看看dmesg和lsusb的输出结果。
回复