Step 4: complete Linux ppp dialing

Source: Internet
Author: User

In some systems, we can perform an experiment on ppp dialing settings. Here we will focus on the content and process of the ppp dial-up linux on the Liod platform. Hardware Platform: yidao Liod Platform Based on PXA270), operating system: Embedded Linux. The following describes how to perform ppp dialing on the Liod platform to implement GPRS internet access.

Step 1: If the kernel does not support ppp dialing, recompile the kernel and add support for ppp,

 
 
  1. <*> PPP (point-to-point protocol) support  
  2. [*]    PPP multilink support (EXPERIMENTAL)  
  3. <*>    PPP support for async serial ports  
  4. <*>    PPP support for sync tty ports  
  5. <*>    PPP Deflate compression  
  6. <*>    PPP BSD-Compress compression 

Then re-burn the new kernel image!

Step 2: Download The ppp-2.4.1 source package and generate the pppd and chat programs required for dialing.

Source code download URL: http://samba.org/ftp/ppp/old site, currently cannot use the ftp://ftp.samba.org/pub/ppp)

Decompress the source code package, enter the directory, and perform cross-compilation. The cross compiler used here is arm-linux-gcc (version 3.3.2)

 
 
  1. # Cd/root/gprs/ppp-2.4.1 here suppose ppp unzipping is under the/root/gprs/directory)
  2. #./Configure
  3. # Make CC = arm-linux-gcc

The dialing program is/root/gprs/ppp-2.4.1/pppd, And/root/gprs/ppp-2.4.1/chat program for debugging convenience, I create a new directory named pppdial on the CF card and copy the pppd and chat programs to this directory! The storage space on the Development Board is limited, so here I use the CF card to expand the storage capacity)

Step 3: configure the dialing script

Put/root/gprs/ppp-2.4.1/scripts/Under the ppp-on, ppp-on-dialer, the three ppp-off scripts are modified and copied to/mnt/cf/pppdial/. The modified scripts are as follows:

1. The content of the ppp-on script to be modified:

 
 
  1. TELEPHONE=*99***1#      # The telephone number for the connection  
  2. ACCOUNT=                       # The account name for logon (as in 'George Burns')  
  3. PASSWORD=                    # The password for this account (and 'Gracie Allen')  
  4. LOCAL_IP=0.0.0.0             # Local IP address if known. Dynamic = 0.0.0.0  
  5. REMOTE_IP=0.0.0.0          # Remote IP address if desired. Normally 0.0.0.0  
  6. NETMASK=255.255.255.0 # The proper netmask if needed  
  7.  
  8. # Export them so that they will be available at 'ppp-on-dialer' time.  
  9. export TELEPHONE ACCOUNT  
  10. DIALER_SCRIPT=/mnt/cf/pppdial/ppp-on-dialer  
  11.  
  12. # Initiate the connection  
  13.  
  14. exec /mnt/cf/pppdial/pppd debug lock nocrtscts   /dev/ttyS1 19200 \  
  15. asyncmap 20A0000 escape FF kdebug 0 $LOCAL_IP:$REMOTE_IP \  
  16. noipdefault netmask $NETMASK defaultroute connect $DIALER_SCRIPT usepeerdns 

2. Modify the ppp-on-dialer script:

 
 
  1. #!/bin/sh  
  2. #  
  3. # This is part 2 of the ppp-on script. It will perform the connection  
  4. # protocol for the desired connection.  
  5. #  
  6. exec /sbin/chat -v       \  
  7. TIMEOUT   5     \  
  8. ABORT   '\nBUSY\r'    \  
  9. ABORT   '\nNO ANSWER\r'    \  
  10. ABORT   '\nRINGING\r\n\r\nRINGING\r' \  
  11. ''   AT+CGDCONT=1,IP,CMNET          \  
  12. 'OK'             AT     \  
  13. 'OK-+++\c-OK' ATH0     \  
  14. TIMEOUT   30     \  
  15. OK   ATDT$TELEPHONE    \  
  16. CONNECT 

3. Add the/etc/ppp/resolv. conf file to the Liod board.

 
 
  1. nameserver 211.136.20.203  
  2. nameserver 211.136.18.171 

Step 4: connect to gprs

The gprs module connects to the Bluetooth serial port (/dev/ttyS1) on the Board through the serial port, because the ffuart of the Liod board is used for debugging the serial port, even if you log on to the Liod through telnet, however, if the serial port 0 is used to connect to the GPRS module, dialing will fail. this is because debugging information is output from serial port 0, which may interfere with the dialing process.

Disable the default network device: ifconfig eth0 down

Mount the cf card on the Liod platform and switch to/mnt/cf/pppdial/. Now you can dial the ppp!

Pppd Dialing:./ppp-on

(Note: Disable eth0 before dialing. Otherwise, even if the IP address can be obtained through dialing, the Internet cannot be accessed due to a route error)

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.