Analysis of Linux under the net
Owlbird
Since it is a dial-up Internet, it is not possible to mention the PPP (Point-to-Point Protocol) protocol. The PPP protocol provides a way to transfer the datagram through the serial point. It consists of three parties: a kind of serial The package datagram, the extended connection control protocol LCP, and the family network control protocol NCP used to establish and configure different network layer protocols. Packaging scheme is provided by kernel driver code to provide basic LCP, authentication support And to establish and configure IP network control protocol NCP. A PPP session is divided into four steps: connection establishment, connection quality control, network layer protocol configuration, connection termination; provides password authentication protocol (PAP) or invitation of handshake certification protocol ( CHAP) to ensure connection safety. Using PPP You can connect your Linux PC to a PPP server and access the network resources connected to the server as you are directly connected to the network. You can also set your Linux PC as a PPP server, so that other computers can dial your computer and access resources in your area network. Of course, for our end users, it is an application of a Server / Client model. This article mainly discusses how the client dials online. After all, for the user of the desktop system, PPP is an important part of daily life. Here I think everyone may have an easy-to-use deep-style "admiration" for the dial-up adapter under Windows. Here I don't want to discuss it. Microsoft provides TAPI to let the programmers under Windows write a dialing program. Not a difficult thing, but under Linux? Whether it is the WvDial under GNOM or KPPP under KDE, they are more direct and more easy to operate with pure script PPP-ON, saying that they are not a graphic dial script, because they eventually call PPPD. The function is powerful but not good. Someone told me that Kppp and Windows's dial-up adapter function is almost, but I want to tell you that Kppp's dependence of the PPPD program is larger than Kppp as a separate dial program, even the option value under / etc / ppp / options on KPPP It is also not ignored. Process about Linux under this dialing: (actually suitable for all dialing processes under Linux, of course, the actual process is not as simple, if you are interested, please read the source code) 1. PPPD program call CHAT session 2.chat session program is responsible Dial, start the server-side PPPD program, verify the identity, then the CHAT session program ends 3. Continue the work of the CHAT session program by the PPPD program, handshake with the server-side PPPD program, establish the PPP connection PPP-ON script contains PPPD programs, and PPP The -on-dimer script contains a CHAT session. If the PPPD program is completed, the connection is established, the connection quality control, the network layer protocol configuration, the connection termination is terminated, then the CHAT program is completed, and if it is dial-in Server-side Requires Password Authentication Protocol (PAP) or Invite Handshake Certification Protocol (CHAP) to ensure connection security, you must also configure Pap-Secrets or chap-secrets files in / etc / ppp directory.
About PPP-ON, PPP-ON-DIALER Pure Script Dialing Configuration A complete PPP-ON file is as follows: (The example and ppp-on-Dialer files are provided with 163 straight train) Telephone = 163 # ISP Internet phone number account = 163 # account name Password = 163 # Login password local_ip = 0.0.0.0 # Local IP address, 0.0.0.0 Indicates REMOTE_IP = 0.0.0.0 # remote IP address by ISP, typically 0.0.0.0 Netmask Subnet Mask = 255.255.255.0 # export TELEPHONE ACCOUNT PASSWORD / DIALER_SCRIPT = / etc / ppp / ppp-on-dialer / exec / usr / sbin / pppd lock modem crtscts / dev / ttyS0 115200 / asyncmap 0 kdebug 4 / $ lOCAL_IP : $ Remote_ip NoIpDefault Netmask $ NETMASK Default / Connect $ DIALER_Script & This file is required to pay attention to: a. Note "/" indicates a complete end. b. Try to set the KDebug level as much as possible, as the level of detail of file / var / log / messages is determined according to the level of kdebug. A complete PPP-ON-DIARER file is as follows: Exec chat -v / timeout 3 / abort '/ nbusy / r' / abort '/ nno answer / r' / abort '/ nringing / r / n / r / nring / r '/ Abort' / NUSERNAME / PASSWORD INCORRECT / R '/ This line can shorten the verification time of incorrect account password' '/ RAT /' OK - / C-OK 'ATH0 / TIMEOUT 30 / OK ATDT163 / SERNAME : - SERNAME: 163 / Assword: 163 / Do you say right? File configuration is correct, but there are many problems. I still do a specific analysis with practical problems (premise: no matter the cats in the cat, check the command: Echo "Echo ATDT 163"> / dev / modem), type in the / etc / ppp directory. After the PPP-ON command, the following error appears: 1. Trown, no dial tone.
Workaround: First check the permissions of the PPP-ON-DIALER file, set to ChMod 7 PPP-ON-DIALER and then view the PPP-ON-DIALER file, "/" after each line "/" exists last View the countdown third line OK ATDT $ Does the telephone number of Telephone set correctly, note that the actual phone number is required, not a variable 2. The following prompt appears in / var / log / messages file: 21: 13: 32 Ken PPPD [657]: CCP Terminated by peer21: 13:32 Ken PPPD [657]: Compression Disabled by peer. Or directly appear (Repeated N as the following prompt) Note: Chat -V representation of the PPP-ON-DIALER file indicates the client with The server-side session information written to the / var / log / messages file if you want to view this session information, type tail -f / var / log / messages or tailf / var / log / messages, which is correct Configuring dial-up scripts is useful. Solution: First check if the account password is correct, then it may be the problem of the Chat session itself. Let's take a look at the example: Chengdu Tianfu Hotline 163 Tips under Minicom: ****** **************************************************** QUIDWAY A8010 Internet Server * Welcome !! ***************************************************** PLEASE INPUT UserName : Please Input Password: Chengdu Tianfu Hotline 169 Tips under Minicom: *** Welcome To Tianfu Online Eeying01-11! *** Login: Password: You may notice what is different! That is, the different dial-up servers are different for the account password input prompt. Friends who have used Windows Dial Terminal may know, then why Windows dialk does not have this problem, because this is the problem of the CHAT program itself: Can't prompt to the account password according to the dial-up server Different, send account and password, solution: Use Minicom to get the correct prompt, the root trix prompts the last two lines of the PPP-ON-Dialer file, here is the prompt of Chengdu Tianfu Hotline 163,169 in Minicom: 163: Sername: - Sername: 163 / Assword: 163/169: Ogin: - Ogin: liujien / assword: liujien / This is over, no, the configuration here also wants according to your ISP requirements (hint), Go to the correct tips with minicom, but you have to brave your ISP to modify the risk of the account password prompt, so I advise you to give up the Chat session. Because Kppp, WVDial does not exist this problem. Thechat session program is Force, and wvdial, kppp is guess. With this problem I read the documentation file of PPP-2.4.1 source code, in fact, the author is already in PPP-2.3.11 Plugins PassPrompt has been provided (Note: PPP-2.3.10 has been supported, the big house with redhat6.2 with the PPP-2.3.11 RPM package, as for the PPP provided on the plug-in general domestic Linux website The source package is included), which is provided to third-party programs to send account passwords to your ISP call function.
The English is as follows: a New `Passprompt 'Plugin Is Included, thanks to Alan Curry, Which Makes It Possible for Pppd To Call An External Program To Get The Pap Password To Send To The Peer. How do I use this Plugin? Compiling PassPrompt.c files in the directory containing pppd.h header gcc -c -o passprompt.c gcc -shared -o passprompt.o, you can get a PASSPROMPT.SO sharing link file, copy to / ETC / PPP / PLUGINS directory, modify the / etc / ppp / options file, join a line plugin /etc/ppp/plugins/passprompt.so, then you can modify the PPP-ON file to point DIALER_Script to the script file you want to specify, You can download a third-party program on the web. I provide you with a simple way. You can install the WVDial dial program, then configure the /etc/wvdial.conf file under GNOME, create a new script in the / etc / ppp directory, name WVDial, the content is as follows WvDial 163 (163 is the phone number you want to dial), then CHMOD 7 WVDial, modify the PPP-ON file, such as: Dialer_script = / etc / ppp / wvdial / 3. The client has got an IP address (you can see with ifconfig command) ), The web page cannot be browsed through the domain name, and can be passed through the IP address. Workaround: General Measures: Go to the manual for ISP to you, get the IP address of the domain name server, modify the /etc/resolv.conf file as follows: Nameserver 61.139.2.69 (I am in Chengdu 163), you can also in Windows The DNS server address can also be obtained with the ipconfig / all command because the default settings of Windows are set to: Automatically obtain the DNS server address. The software author gives us the way: What was new in ppp-2.3.6. *********************************** Added option `USEPeerDNS ' Thanks to Nick Walker
The software author provides an option similar to the Windows Dial-up program: usepeerDNs, if your ISP provides DNS server addresses, will be in the /etc/ppp/resolv.conf file and /etc/resolv.conf file Write the main domain name server address and the secondary domain server address, as follows: Nameserver 61.139.2.69nameserver 202.103.4.5 How to set: Modify the / etc / ppp / options file, add a line "usepeerDNS" post: Here the author throws the jade, for Linux scripts The dial-up Internet has nothing to do with more in-depth discussion, just analyzing a few common problems and provides a relatively simple solution. I hope everyone can read some software authors to provide us with the English description documents, because of domestic Some materials are too old, don't be patient to read MAN Pages, they are useful, not to read some websites of some websites is a good choice. If you have different opinions to my article, please write a letter, I will enlighten, thank you .owlbird studio copyright, if you want to reprint, please contact us Owlbird@163.com