Set up a GPRS wireless Modem dialing method in Linux

Source: Internet
Author: User
& Nbsp; 1. connect the wireless Modem to the serial port 1 (/dev/ttyS0) of the PC. 2. first, use minicom (we strongly recommend that you create a new Terminal in the linux graphical user interface, and then run minicom) to set the speed to 57600, 8N1, and HardwareFlowControl.3. run AT to see if OK is returned  

1. connect the wireless Modem to the serial port 1 (/dev/ttyS0) of the PC.

2. first use minicom (we strongly recommend that you create a new Terminal in the linux graphical user interface and then run minicom) to set the speed to 57600, 8N1, and Hardware Flow Control.

3. run AT to check whether OK is returned. If no result is returned, the serial port settings are incorrect, or the serial port rate settings of the Saro Modem are incorrect;

4. enter AT + CSQ? Check the signal quality. if the result is similar to + CSQ: (the number before the comma is 12 ~ Between 31) is normal.

5. enter AT + CGDCONT = 1, "IP", "cmnet" to check whether OK is returned. This command is used to set the Apn (access name ). If your Apn is another value, replace the cmnet value accordingly. For example, if your Apn is gdyd. yl, enter AT + CGDCONT = 1, "IP", "gdyd. yl ";

6. enter ATDT * 99 *** 1 # to check whether CONNECT is returned. Under normal circumstances, CONNECT should be returned, and some data should appear later;

7. exit the minicom software.

8. run wvdialconf/etc/wvdial. conf. The system automatically finds the modem and installs it on ttyS0 at a rate of 57600, as shown in:

        
         [root@test ppp]# wvdialconf /etc/wvdial.confScanning your serial ports for a modem.ttyS0<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 4800 baudttyS0<*1>: ATQ0 V1 E1 -- failed with 4800 baud, next try: 9600 baudttyS0<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 19200 baudttyS0<*1>: ATQ0 V1 E1 -- failed with 19200 baud, next try: 57600 baudttyS0<*1>: ATQ0 V1 E1 -- OKttyS0<*1>: ATQ0 V1 E1 Z -- OKttyS0<*1>: ATQ0 V1 E1 S0=0 -- OKttyS0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OKttyS0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OKttyS0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OKttyS0<*1>: Modem Identifier: ATI ? Siemens Mc35 Gprs ModemttyS0<*1>: Max speed is 57600; that should be safe.ttyS0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OKFound 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"
        

If the result is different from the preceding one, try multiple times. The system will always find the Modem.

9. vi/etc/wvdial. conf:

        
         [Dialer Defaults]Modem = /dev/ttyS0Baud = 57600Init1 = ATZInit2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0ISDN = 0Modem Type = Analog ModemPhone = *99***1#Username = Password =
        

10. edit/etc/chap-secrets and/etc/pap-secrets.

Change the content of both files

"" * ""

Note that the first pair of quotation marks is the user name. * indicates that there is no limit on the server name, and the second pair of quotation marks are used to verify the password.

11. run wvdial. The result is as follows:

        
         [root@test ppp]# wvdial--> WvDial: Internet dialer version 1.53--> Initializing modem.--> Sending: ATZATZOK--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0OK--> 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. open another Terminal and run ifconfig. you can see that the ppp0 device has appeared in the interface, as shown in:

        
         ppp0 Link encap:Point-to-Point Protocolinet addr:220.192.68.149 P-t-P:220.192.64.1 Mask:255.255.255.255UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1RX packets:3 errors:0 dropped:0 overruns:0 frame:0TX packets:4 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:3RX bytes:66 (66.0 b) TX bytes:84 (84.0 b)
        

We can see that the dynamic address 220.192.68.149 has been obtained.

13. at this time, you need to manually add a default route: route add default ppp0. after adding the route, you can ping a remote address to check whether the Internet is actually accessed. for example, you can ping 166.111.8.238 on the public network;

14. to stop the ppp connection, you only need to switch to the Terminal of wvdial and press Ctrl + C. You can also kill the wvdial process. The result is as follows:

        
         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
        

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.