Linux pppd GRPS Configuration

Source: Internet
Author: User

The TD Module I used is lc63 **. I just got the board in the last few days and spent nearly a month tossing it. This board called and there was no problem accessing the Internet.

 

First, it is necessary to introduce the PPP protocol, which is the basis for TD Internet access:

PPP is a point-to-point connection protocol. After the connection is established, an IP address is assigned to the two points, which can be used for communication between the two points. The original "dial-up Internet access" method of the Internet is called it. Most people forget PPP because the most popular Internet connection method is Ethernet. There is also a "Variant" of PPP, called pppoe, that is, PPP on Ethernet, which adds a reason why PPP is forgotten.

 

Let's talk about a common method of connecting PPP to the Internet.
PC -- modem -- PPP -- remotehost -- Internet
The PC can connect to the modem in some way, and the modem is responsible for converting digital signals into electrical signals (this is a bit vague, probably audio or pulse ), A group of "at" commands have been used to communicate with a remote host. This host is connected to the Internet and is mainly responsible for sending packets to your PC and forwarding them again. The downstream process is the opposite of the process described above. From this process, the main problems of PC configuration are as follows:

* How to configure the modem
* How to configure the AT command communication script

These two problems correspond to each other using two simple tools in Linux. The Modem configuration can be completed using pppd, And the AT command communication script can be handed over to chat.

Currently, the pppd module is provided in common Linux systems. If not, you can download and manually compile the module, and then generate executable files (pppd, chat, etc) put it in the/usr/sbin/folder.

 

Configure the pppd of the system as follows:

After installing pppd, generate the/etc/PPP/directory and modify the/etc/PPP/peers/cmnet file (if this file is not available, you can create it manually. The file name is not set to cmnet ):

/Dev/ttyusb1
115200
Modem
Nocrtscts
Nocdtrcts
Local
Debug
Nodetach
# Nobsdcomp
# Nodeflate
# Novj
Usepeerdns
Defaultroute
Noipdefault
Ipcp-Accept-Local
Ipcp-Accept-remote
Lock
Connect '/usr/sbin/chat-S-v-F/etc/PPP/chat/CMTC-ISP'

 

If you do not understand these commands, you can easily find them on the Internet:

Modify the/etc/PPP/chat/CMTC-ISP file (if the chat directory is not in my system, manually create a CMTC-ISP ):

Abort 'busy'
Abort 'no carrier'
Abort 'error'
Abort '+ CME error: 100'
""
OK at + cgdcont = 1, "ip", "cmnet", 0, 0
OK at + cgeqreq =, 2048, 0, "0e0", "0e0 ",
OK
OK
OK ats0 = 0
OK
OK
OK ATD * 98*1 #
Connect

There are some AT commands in this file, and there are many online commands.

 

Run pppd call cmnet to start the pppd script program. In case of any exceptions, the following content will be returned:

 

Abort on (busy)
Abort on (no carrier)
Abort on (error)
Abort on (+ CME error: 100)
Send (at ^ m)
CT (OK)
^ M
OK
-- Got it

Send (at + cgdcont = 1, "ip", "cmnet", 0, 0 ^ m)
CT (OK)
^ M
^ M
OK
-- Got it

Send (at + cgeqreq =, 2048, "0e0", "0e0", ^ m)
CT (OK)
^ M
^ M
OK
-- Got it

Send (at ^ m)
CT (OK)
^ M
^ M
OK
-- Got it

Send (at ^ m)
CT (OK)
^ M
^ M
OK
-- Got it

Send (ats0 = 0 ^ m)
CT (OK)
^ M
^ M
OK
-- Got it

Send (at ^ m)
CT (OK)
^ M
^ M
OK
-- Got it

Send (at ^ m)
CT (OK)
^ M
^ M
OK
-- Got it

Send (ATD * 98*1 # ^ m)
Secondary CT (CONNECT)
^ M
^ M
^ Orig: 1, 2 ^ m
^ M
+ PCD: 1, 1 ^ m
^ M
^ Orig: 1, 2 ^ m
^ M
+ PCD: 1, 1 ^ m
^ M
^ Orig: 1, 2 ^ m
^ M
+ PCD: 1, 1 ^ m
^ M
^ Orig: 1, 2 ^ m
^ M
+ PCD: 1, 1 ^ m
^ M
^ Orig: 1, 2 ^ m
^ M
+ PCD: 1, 1 ^ m
^ M
^ Orig: 1, 2 ^ m
^ M
+ PCD: 1, 1 ^ m
^ M
^ Orig: 1, 2 ^ m
^ M
+ PCD: 1, 1 ^ m
^ M
^ Orig: 1, 2 ^ m
^ M
+ PCD: 1, 1 ^ m
^ M
^ Orig: 1, 2 ^ m
^ M
+ PCD: 1, 1 ^ m
^ M
^ Orig: 1, 2 ^ m
^ M
+ PCD: 1, 1 ^ m
^ M
^ Orig: 1, 2 ^ m
^ M
+ PCD: 1, 1 ^ m
^ M
^ Orig: 1, 2 ^ m
^ M
+ PCD: 1, 1 ^ m
^ M
Connect
-- Got it

Serial Connection established.
Using Channel 1
Using interface ppp0
Connect: ppp0 <-->/dev/ttyusb1
Sent [LCP confreq id = 0x1 <asyncmap 0x0> <magic 0x8181f1b> <pcomp> <accomp>]
Rcvd [LCP confreq id = 0x28 <MRU 1500> <asyncmap 0 xffffffff> <auth Pap> <magic 0x11223344> <pcomp> <accomp>]
No auth is possible
Sent [LCP confrej id = 0x28 <auth Pap>]
Rcvd [LCP confack id = 0x1 <asyncmap 0x0> <magic 0x8181f1b> <pcomp> <accomp>]
Rcvd [LCP confreq id = 0x29 <MRU 1500> <asyncmap 0 xffffffff> <magic 0x11223344> <pcomp> <accomp>]
Sent [LCP confack id = 0x29 <MRU 1500> <asyncmap 0 xffffffff> <magic 0x11223344> <pcomp> <accomp>]
Sent [CCP confreq id = 0x1 <deflate 15> <deflate (old #) 15>]
Sent [ipcp confreq id = 0x1 <compress VJ 0f 01> <ADDR 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>]
Rcvd [LCP protrej id = 0x2a 80 FD 01 01 00 0C 1A 04 78 00 18 04 78 00]
Protocol-reject for 'Compression control Protocol' (0x80fd) unbound ed
Sent [ipcp confreq id = 0x1 <compress VJ 0f 01> <ADDR 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>]
Rcvd [ipcp confreq id = 0x2b <ADDR 192.168.0.1>]
Sent [ipcp confack id = 0x2b <ADDR 192.168.0.1>]
Rcvd [ipcp confrej id = 0x1 <compress VJ 0f 01> <ms-dns3 0.0.0.0>]
Sent [ipcp confreq id = 0x2 <ADDR 0.0.0.0> <ms-dns1 0.0.0.0>]
Rcvd [ipcp confnak id = 0x2 <ADDR 10.170.57.106> <ms-dns1 211.136.17.108>]
Sent [ipcp confreq id = 0x3 <ADDR 10.170.57.106> <ms-dns1 211.136.17.108>]
Rcvd [ipcp confack id = 0x3 <ADDR 10.170.57.106> <ms-dns1 211.136.17.108>]
Local IP address 10.170.57.106
Remote IP address 192.168.0.1
Primary DNS address 211.136.17.108

 

I also searched for some information in Google, and found that some TD users need a user name and password. I can access the Internet without any need, and I don't know why.

If pppd call cmnet successfully returns the IP address and DNS, pppd is successful. If the eth0 device in the system is started

Disable the ifconfig eth0 down command to avoid conflict between the two Internet ports.

Set the route of the ppp0 port to the default route of the system. The command is as follows:

Route del default

Route add default ppp0

Save the obtained DNS to/etc/resolve. in the conf file, nameserver 211.136.17.108 (Note: If this DNS is provided in the TD device documentation, you can put it in resolve before running pppd. CONF file)

Now that pppd is successfully started, many people will use the ping command to check whether the network is connected, but the Ping won't work. Because every time we run the pppd program, the returned IP address is a dynamic IP address in the network, which can be connected to the public network, but cannot be returned from the public network. We only need to test whether the network is connected through a browser. Set the network proxy as follows: 10.0.0.172 80. Enter the URL to access the website.

 

There is also a small problem:

 

I didn't think about this USB serial module at first, which led to the following error when running pppd call cmnet:

Serial Connection established.
Couldn't get channel number: Inappropriate IOCTL for Devic

It took a long time to understand the problem of USB serial.

So we need to re-compile this module, which involves the Linux driver problem. If you do not understand the Linux driver, you need to find some books to take a look.

1. Download the kernel (Note: The downloaded kernel version is not necessarily the same as the system kernel version, and the downloaded kernel version is different from the System Version). decompress the kernel

2. Copy the current Kernel configuration file to the kernel source code directory,
CP/boot/config-$ (uname-R)/usr/src/linux-2.6.28 /. config (find a configuration file starting with config in the/boot directory, copy it to the decompressed kernel directory, and change the file name :. config)

3. Create a configuration file for the compilation module.
CD/usr/src/linux-source-2.6.24/& make oldconfig

You can use make oldconfig to reduce unnecessary options and use the current system configuration as the default configuration for the new kernel. You can also run make menuconfig and other commands.

4. Modify USB serial. c In the kernel source code
Modify usbserial. C and modify buffer_size = 4096 in the usb_serial_probe () function. It seems that there are four areas to be modified.

5. Compile the modified module (all USB serial port modules are compiled here, but at least much faster than the entire kernel)
Make-C/lib/modules/$ (uname-R)/build M =/usr/src/linux-2.6.28/Drivers/USB/serial

/Lib/modules/.../build is the system directory, for example,/lib/modules/2.6.32.10-90. fc12.i686. PAE/build.

The following directory is the directory of the currently compiled usbserial module.

6. Back up the currently used USB serial. Ko and copy the USB serial. Ko generated in the previous step to/lib/modules/kernel/Drivers/USB/serial/
If you cannot find the location of USB serial. KO in the kernel, you can use the locate USB serial. Ko command to find the location.

 

The general process and problems are like this. Finally, we have done it !!!!!!!!!!

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.