Ppp script source code sharing (1)

Source: Internet
Author: User

PPP dialing settings are available on many platforms. Here we will focus on the PPP script content that has been tested on the L350 and N300 platforms. Now let's take a look at the specific content. I hope it will be applied to everyone.

 
 
  1. /apps/etc/ppp >: uname -a  
  2. Linux netaccess 2.6.22.1 #17 Thu Jan 7 18:03:30 EST 2010 armv5tejl unknown 

Pppd reads related configuration files from/etc/ppp. Since these configuration files are often modified during debugging, a symbolic link is established to our Nandflash partition:

 
 
  1. /apps/etc/ppp >: ls -l /etc/ppp   
  2. lrwxrwxrwx    1 root     root           13 Nov 20  2009 /etc/ppp -> /apps/etc/ppp 

When pppd is used as a ppp server, the following configuration files are used. In the following documents, we will introduce them in detail:

 
 
  1. /apps/etc/ppp >: ls  
  2. chap-secrets     gprs-start-chat  options          options.ttyS1    pap-secrets 

Pppd running parameter file/etc/ppp/options

This file specifies the pppd running parameter. If the parameter specified by the command line appears in the configuration file when running pppd, pppd uses the configuration in/etc/ppp/options. For pppd-supported parameters, run the man command query (man pppd) on linux in our PC)

[Guowenxue @ localhost ~] $ Man 8 pppd
PPPD (8) PPPD (8)

NAME
Pppd-Point-to-Point Protocol Daemon

SYNOPSIS
Pppd [options]

/Apps/etc/ppp>: cat options
# Tty Options
/Dev/ttyS1 # For example, you can comment out/dev/ttyS1 and use the command line # pppd/dev/ttyS1 run to specify;
115200
# Lock
Modem
Nocrtscts # No hardware Traffic Control

# Login
Nodetach # If updetach is specified, the dial is successfully placed in the background for running. If it is nodetach, it is executed on the foreground.

Debug

# Auth options
Auth # enable Authentication
+ Pap # Use pap Certification
-Chap # do not support chap authentication

# The connect_tty function in source code ppp-2.4.3/pppd/tty. c will execute this script. This mainly refers to the dialing response to the client.
Connect "/usr/sbin/chat-v-E-V-f/etc/ppp/gprs-start-chat"

# Lcp options
# Passive
Asyncmap 0
Lcp-echo-failure 3
Lcp-echo-interval 5
Ipcp-accept-local
Ipcp-accept-remote


# Proxyarp
Netmask 255.255.255.0
Ms-dns 10.78.28.10
Ms-dns 10.78.28.11
Nodefaultroute

Gprs-start-chat script

For chat usage, you can use the man command on a Linux PC to query: $ man 8 chat

 
 
  1. /Apps/etc/ppp>: cat gprs-start-chat
  2. ABORT 'busy'
  3. ABORT 'no carrier'
  4. ABORT 'no dialtone'
  5. ABORT 'error'
  6. TIMEOUT 0
  7.  
  8. '''Atz' // first send ATZ reset modem
  9. 'OK' 'ate0' // After receiving the OK message, use ATE0 to remove the echo.
  10. 'Ring ''ata '// wait for the client to dial. If the client starts to dial, the Modem sends a response signal ATA after receiving the RING.
  11. 'Connect ''' // After receiving the CONNECT signal, it enters the next LCP process.


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.