Linux系统通过手机GPRS上网设置简介( 二 )

<*1>: ATQ0 V1 E1 S0=0 &C1 &D2FCLASS=0 -- OK
Found an USB modem on /dev/ttyACM0.
;Modem configuration written to /etc/wvdial.conf.
;/etc/wvdial.conf: Can"t write "/etc/wvdial.conf.tmp8517": Permission denied
;/etc/wvdial.conf: Can"t write "/etc/wvdial.conf" ("/etc/wvdial.conf"): Bad file descriptor
;ttyACM0: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2FCLASS=0"
;$
(4)
;运行 sudo gedit /etc/wvdial.conf
;修改其内容,Baud保持4.(3)中程序自动创建的值,Username和Password的值到手机的网络设置查看
;本例使用CMNET连接,文件内容如下
[Dialer Defaults]
;Init1 = ATZ
;Init2 = AT&FE0V1&C1S0=0
;Init3 = AT cgdcont=1,"IP","CMNET","",0,0
;Modem Type = USB Modem
;ISDN = 0
;Phone = *99***2#
;New PPPD = yes
;Modem = /dev/ttyACM0
;Username = 172
;Password = 172
;Baud = 460800
;Idle Seconds = 3000
;Auto DNS = 1
;Stupid Mode = 1
;Dial Command = ATD
;Ask Password = 0
;FlowControl = NOFLOW
(5)
;禁用eth0等网络联连接
;另:如果是在Debian Gnome环境下,右上角的网络连接工具,“启用联网一项反选
(6)
;运行 sudo wvdial
;让Linux通过手机上网,正常情况如下
$ sudo wvdial
;--> WvDial: Internet dialer version 1.60
;--> Cannot get information for serial port.
;--> Initializing modem.
;--> Sending: ATZ
;ATZ
;OK
;--> Sending: AT&FE0V1&C1S0=0
;AT&FE0V1&C1S0=0
;OK
;--> Sending: AT cgdcont=1,"IP","CMNET","",0,0
;OK
;--> Modem initialized.
;--> Idle Seconds = 3000, disabling automatic reconnect.
;--> Sending: ATD*99***2#
;--> Waiting for carrier.
;CONNECT
;--> Carrier detected.; Starting PPP immediately.
;--> Starting pppd at Mon May 18 21:16:57 2009
;--> Pid of pppd: 8931
;--> Using interface ppp0
;--> pppd: [10][18]1
;--> pppd: [10][18]1
;--> pppd: [10][18]1
;--> pppd: [10][18]1
;--> pppd: [10][18]1
;--> local; IP address 10.55.0.37
;--> pppd: [10][18]1
;--> remote IP address 10.10.88.48
;--> pppd: [10][18]1
;--> primaryDNS address 211.136.20.203
;--> pppd: [10][18]1
;--> secondary DNS address 211.136.17.107
;--> pppd: [10][18]1
收到local IP address说明网络连接成功,终端里按Ctrl C终止网络连接
(7)
;验证上网效果
$ sudo /sbin/ifconfig
;eth0;;;Link encap:Ethernet; HWaddr 00:F0:CF:81:F7:00
;;;inet6 addr: 2001:da8:2004:2009:2f0:cfff:fe81:f700/64 Scope:Global
;;;inet6 addr: fe80::2f0:cfff:fe81:f700/64 Scope:Link
;;;UP BROADCAST RUNNING MULTICAST; MTU:1500; Metric:1
;;;RX packets:79280 errors:0 dropped:0 overruns:0 frame:0
;;;TX packets:9418 errors:0 dropped:0 overruns:0 carrier:0
;;;collisions:0 txqueuelen:1000
;;;RX bytes:14814054 (14.1 MiB); TX bytes:1465054 (1.3 MiB)
;;;Interrupt:16 Base address:0xc000
lo;;;;;Link encap:Local Loopback
;;;inet addr:127.0.0.1; Mask:255.0.0.0
;;;inet6 addr: ::1/128 Scope:Host
;;;UP LOOPBACK RUNNING; MTU:16436; Metric:1
;;;RX packets:875 errors:0 dropped:0 overruns:0 frame:0
;;;TX packets:875 errors:0 dropped:0 overruns:0 carrier:0
;;;collisions:0 txqueuelen:0
;;;RX bytes:132997 (129.8 KiB); TX bytes:132997 (129.8 KiB)
ppp0;;;Link encap:Point-to-Point Protocol
;;;inet addr:10.55.0.37; P-t-P:10.10.88.48; Mask:255.255.255.255
;;;UP POINTOPOINT RUNNING NOARP MULTICAST; MTU:1500; Metric:1
;;;RX packets:7 errors:0 dropped:0 overruns:0 frame:0
;;;TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
;;;collisions:0 txqueuelen:3
;;;RX bytes:208 (208.0 b); TX bytes:315 (315.0 b)
【Linux系统通过手机GPRS上网设置简介】

推荐阅读