PPP dial-up Internet access (1)

Source: Internet
Author: User

Because of the needs of project development on an embedded platform, PPP dial-up Internet access is implemented on the ARM platform. Speaking of the PPP dial-up Internet access on this Linux platform, many people may feel very simple. There are many success stories on the Internet! Yes, you are right, but I still want to give my opinion, that is, this simple PPP dialing has been tossing me for a long time, and I am sorry to say it. However, it seems that this process has learned a lot and gained a lot of analytical skills. Now it is successfully transplanted to the arm Development Board. The close-up log is here to share my summary over this period of time:

There are three common methods on the Internet:
1. Use smart PPP dialing software wvdial:
2. Use three scripts: PPP-on, PPP-on-dialer, and PPP-off.
And many successful online Cases
Note: The two methods have their own advantages and disadvantages. The first method is intelligent and stable. He does not need a chat program. He uses the integrated wvdial toolkit to directly connect to the ISP, which is secure and stable and can be disconnected and automatically redial. The second method is to use the chat program, but many parameters need to be configured by themselves. Although flexible, if a dialing error occurs, if you do not know the specific mechanism of PPP dial-up implementation and the meaning of each parameter, you will be very difficult. If you are lucky, your running environment exactly matches the local mobile ISP configuration, congratulations, you are on the Internet, but unfortunately you have not learned anything. If you want to know about the PPP mechanism, you can try 2nd methods, observe the information in/var/log/messages.

3. Use the pppd call somescript command:

This method is used. The configuration files related to PPP dialing are listed and explained below;
Note: The GPRS module I use is Huawei gtm900a/B. The internal settings of different modules are different, so some parameter configurations in the configuration file are different, in addition, the environment of your PC or arm Development Board and the signal of the location are related to mobile ISP. In case of problems, consider these potential factors. Troubleshooting is a boring process, but in turn, this process will gain a lot.

By default, the GPRS-connect-chat file is created in the/etc/PPP/directory. The content is as follows (each parameter is explained in detail in the PPP-howto. It is a combination sequence of "expected/sent" for each parameter line of the chat process during the PPP underlying session. When some classic errors such as "LCP: timeout sending config-requests", "Serial Line is not 8 bit clean... "," Serial Line is looped back ", and so on. Refer to the two documents mentioned in method 2 or Google. Note: The reason why the solution cannot be exactly given is that the same error message is printed. I call it a phenomenon. The same phenomenon may be caused by many reasons, you need to perform troubleshooting on your own .)

#/Etc/PPP/GPRS-connect-chat
Timeout 15
Abort '/nbusy/R'
Abort '/Nno answer/R'
Abort '/nringing/R/n/R/nringing/R'
# ''At
# 'OK-++/C-OK' ATH0
Timeout 40
''/Rat
OK ats0 = 0 # These are standard AT commands. We recommend that you check the AT command manual of the module.
OK ate0v1
OK at + cgdcont = 1, "ip", "cmnet" # Set the ISP access gateway to China Mobile's cmnet. If you want more access resources
OK atdt * 99 *** 1 # China Mobile GPRS access number?
Connect ''++ ++ ++
The/etc/PPP/peers/GPRS file is created to provide configuration parameters for the pppd process. For details, see the output content of MAN 8 pppd, if the problem occurs, this will be a very important reference page. The content is as follows: #/etc/PPP/peers/GPRS
# Usage: root> pppd call GPRS
/Dev/s3c2410_serial1 # change it to your own port name
115200 # change to the serial port baud rate
Nocrtscts
# Maybe your serial port needs crtscts and hardware throttling. This is determined by your serial port. Generally, the serial port of an embedded system does not contain hardware throttling, and nocrtscts is not required.
Modem # This parameter allows the pppd process to wait for the CD (carrier detect) signal sent back by the module, which is opposite to the local signal.
# Noauth
Debug # output the debugging information to/var/log/messages. After successful debugging, remove it to reduce the garbage generation.
Nodetach
# Hide-Password
Usepeerdns # The following three parameters are generally indispensable
Noipdefault
Defaultroute
User smsong # Set the access user name, which is used in chap-secrets or pap-secets.
0.0.0.0: 0.0.0.0 # Set the local IP address and the remote IP address to 0 so that the access ISP can assign a local IP address.
Ipcp-Accept-local # requires peer, that is, the ISP, to assign a dynamic IP address to itself.
# Ipcp-Accept-remote
# LCP-Echo-failure 12
# LCP-Echo-interval 3
Noccp # The compression control protocol is not required. It is possible that the Peer end does not need the protocol.
# Novj
# Novjccomp
Persist # ensure that you do not exit when the connection is disconnected and try to re-open the connection
Connect '/usr/sbin/chat-S-v-F/etc/PPP/GPRS-connect-chat'
# Pppd calls the chat session process to access the peer ISP, starts the peer pppd, and then cooperates with the peer pppd
# Negotiate network parameters and chap/PAP authentication. After successful authentication, IP addresses at the NCP layer are allocated. ++ ++ ++
#/Etc/PPP/chap-secets
# Secrets for authentication using chap
# Client server secret IP addresses
####### RedHat-config-network will overwrite this part !!! (BEGIN) ################ RedHat-config-network will overwrite this part !!! (End) ########### smsong * 123456 *
In some regions, GPRS may use pap authentication to access users. Therefore, in the same level directory, create the pap-secets file, similar to chap-secets, the content contains four items: 2nd and 4th, which are generally represented by an asterisk. You need to place these two files in/etc/PPP.
++ ++ ++ After the ppp0 connection is established, you can use Ctrl + C or the following script program PPP-off to disconnect the PPP connection #/etc/PPP-off
#! /Bin/sh
######################################## ##############################
#
# Determine the device to be terminated.
#
If ["$1" = ""]; then
Device = ppp0
Else
Device = $1
FI ####################################### ###############################

Related Article

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.