<code id='0hvaq'><strong id='0hvaq'></strong></code>
    1. <i id='0hvaq'></i>
      1. <tr id='0hvaq'><strong id='0hvaq'></strong><small id='0hvaq'></small><button id='0hvaq'></button><li id='0hvaq'><noscript id='0hvaq'><big id='0hvaq'></big><dt id='0hvaq'></dt></noscript></li></tr><ol id='0hvaq'><table id='0hvaq'><blockquote id='0hvaq'><tbody id='0hvaq'></tbody></blockquote></table></ol><u id='0hvaq'></u><kbd id='0hvaq'><kbd id='0hvaq'></kbd></kbd>
      2. <span id='0hvaq'></span>
          <i id='0hvaq'><div id='0hvaq'><ins id='0hvaq'></ins></div></i>

            <acronym id='0hvaq'><em id='0hvaq'></em><td id='0hvaq'><div id='0hvaq'></div></td></acronym><address id='0hvaq'><big id='0hvaq'><big id='0hvaq'></big><legend id='0hvaq'></legend></big></address><dl id='0hvaq'></dl>

            <fieldset id='0hvaq'></fieldset>
          1. <ins id='0hvaq'></ins>

            Linux下建立GPRS无线Modem拨号方法

            • 时间:
            • 浏览:6
            • 来源:124软件资讯网

              1.将无线Modem接到Pc机的串口1(/dev/ttyS0)上  。

              2.首先使用minicom(强烈建议在linux的图形用户界面下新建一个Terminal  ,然后运行minicom) ,将速率设置成为57600、8N1 ,Hardware Flow Control.

              3.运行AT ,看是否会返回OK.若是没有返回则讲明串口设置有问题  ,或者Saro Modem的串口速率设置有问题;

              4.输入AT+CSQ  ?看信号质量怎样  ,若是效果类似+CSQ: 22  ,99(逗号前的数字在12~31之间)为正常  。

              5.输入AT+CGDCONT=1 ,“IP” ,“cmnet”  ,看是否会返回OK.这条下令的作用是设置Apn(会见接入点名)  。若是您的Apn是其他值 ,请响应地将cmnet替换掉即可  。例如假设您的Apn是gdyd.yl  ,请输入AT+CGDCONT=1  ,“IP” ,“gdyd.yl”;

              6.输入ATDT*99***1#看是否会返回CONNECT.正常情形下应当返回CONNECT  ,而且后面应当泛起一些数据;

              7.退出minicom软件 。

              8.运行wvdialconf /etc/wvdial.conf.可以看到系统自动最先查找modem ,而且将乐成找到Modem安装在ttyS0上  ,而且速率为57600 ,如下图示:

              [root@test ppp]# wvdialconf /etc/wvdial.conf

              Scanning your serial ports for a modem.

              ttyS0<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 4800 baud

              ttyS0<*1>: ATQ0 V1 E1 -- failed with 4800 baud, next try: 9600 baud

              ttyS0<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 19200 baud

              ttyS0<*1>: ATQ0 V1 E1 -- failed with 19200 baud, next try: 57600 baud

              ttyS0<*1>: ATQ0 V1 E1 -- OK

              ttyS0<*1>: ATQ0 V1 E1 Z -- OK

              ttyS0<*1>: ATQ0 V1 E1 S0=0 -- OK

              ttyS0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK

              ttyS0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK

              ttyS0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK

              ttyS0<*1>: Modem Identifier: ATI – Siemens Mc35 Gprs Modem

              ttyS0<*1>: Max speed is 57600; that should be safe.

              ttyS0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK

              Found a modem on /dev/ttyS0.

              Modem configuration written to /etc/wvdial.conf.

              ttyS0: Speed 57600; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"


              若是效果和上面差别  ,请多试频频  ,系统最后总会乐成找到Modem的
              9.vi /etc/wvdial.conf  ,将这个文件修改为如下:

              [Dialer Defaults]

              Modem = /dev/ttyS0

              Baud = 57600

              Init1 = ATZ

              Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

              ISDN = 0

              Modem Type = Analog Modem

              Phone = *99***1#

              Username =

              Password =


              10.编辑 /etc/chap-secrets和/etc/pap-secrets

              将两个文件中的内容都改为

              “” * “”

              注重 ,第一对引号用户名  ,*号讲明对服务器名没有限制 ,第二对的引号内为校验密码  。

              11.运行wvdial ,可以看到效果如下:

              [root@test ppp]# wvdial

              --> WvDial: Internet dialer version 1.53

              --> Initializing modem.

              --> Sending: ATZ

              ATZ

              OK

              --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

              OK

              --> Modem initialized.

              --> Sending: ATDT*99***1#

              --> Waiting for carrier.

              ATDT*99***1#

              CONNECT

              --> Carrier detected. Waiting for prompt.

              ~[7f]}#@!}!}!} }7}"}&} } } } }#}%B#}%}%}&I=}3[18]}(}"}^}#~

              --> PPP negotiation detected.

              --> Starting pppd at Thu May 13 17:47:11 2004

              --> pid of pppd: 19535


              12.另开一个Terminal  ,运行ifconfig可以看到接口中已经泛起了ppp0装备 ,如下图所示:

              ppp0 Link encap:Point-to-Point Protocol

              inet addr:220.192.68.149 P-t-P:220.192.64.1 Mask:255.255.255.255

              UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1

              RX packets:3 errors:0 dropped:0 overruns:0 frame:0

              TX packets:4 errors:0 dropped:0 overruns:0 carrier:0

              collisions:0 txqueuelen:3

              RX bytes:66 (66.0 b) TX bytes:84 (84.0 b)


              可以看到已经获得了动态地址220.192.68.149

              13.这时间需要手工添加一条默认路由:route add default ppp0  ,添加完成后可以ping远端的一个地址试试是否真的上网了  ,例如说在公网上可以ping 166.111.8.238 ,应该会通;

              14.若是要挂断ppp联接  ,很简朴  ,只要切换到wvdial所在的Terminal  ,然后按Ctrl + C即可  ,也可以给kill掉wvdial 历程  ,效果如下:

              Caught signal #2! Attempting to exit gracefully...

              --> Disconnecting at Thu JULY 13 17:58:26 2004

              [root@test ppp]# ppp0 Link encap:Point-to-Point Protocol