\documentclass[letterpaper]{article}
\nonstopmode
\akai
\usepackage{linuxdoc-sgml}
\usepackage{qwertz}
\usepackage{url}
\usepackage[latin1]{inputenc}
\usepackage{t1enc}
\usepackage[english]{babel}
\usepackage{epsfig}
\usepackage{null}
\def\addbibtoc{
\addcontentsline{toc}{section}{\numberline{\mbox{}}\relax\bibname}
}%end-preamble
\setcounter{page}{1}
\title{PPP HOWTO ÖÐÒë°æ}
\author{×÷Õß: Robert Hart {\ttfamily \onlynameurl{hartr@interweft.com.au}}\\ 
ÒëÕß: \onlynameurl{Asd L. Chen}
\& \onlynameurl{C.W.Huang}}
\date{v3.0, 31 March 1997.
·­ÒëÈÕÆÚ: 25 August - 9 October 1997}
\abstract{Õâ·ÝÎÄ¼þÕ¹Ê¾ÈçºÎ°ÑÄãµÄ Linux PC Á¬½Óµ½Ò»Ì¨ PPP ËÅ·þÆ÷ÉÏ£¬ÈçºÎÊ¹ÓÃ PPP °ÑÇøÓòÍøÂ·Á¬½áÔÚÒ»Æð²¢ÇÒÌá¹©Ò»ÖÖ°ÑÄãµÄ Linux µçÄÔÉè¶¨Îª PPP ËÅ·þÆ÷µÄ·½·¨£®±¾ÎÄÍ¬Ê±Ìá¹©°ïÖúÕì´íÎÞ·¨Õý³£ÔË×÷µÄ PPP Á¬½á£®}


\begin{document}
\maketitle
\tableofcontents
{\bfseries °æÈ¨ÉùÃ÷}



±¾ÎÄ¼þµÄÉ¢²¼±ØÐëÒÀ¾Ý GPL (GNU Public License)£®



{\bfseries É¢²¼}



Ò»µ©Õâ·ÝÎÄ¼þÓÐÐÂµÄ°æ±¾²úÉú¾Í»áÌùµ½ comp.os.linux.answer ÌÖÂÛÈº£®
Ò²¿ÉÒÔÔÚ´ËÈ¡µÃ HTML ¸ñÊ½µÄÎÄ¼þ:

\begin{itemize}
\item \nameurl{http://sunsite.unc.edu/LDP/HOWTO/}{Linux Howto Index}
\item \nameurl{http://www.interweft.com.au/other/ppp-howto/ppp-howto.html}{PPP-HOWTO}
\end{itemize}




ÆäËü¸ñÊ½(SGML, ASCII, postscript, DVI)µÄÎÄ¼þ¿ÉÒÔ´ÓÕâÀïÈ¡µÃ:
\nameurl{ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/other-formats}{Howtos - other formats}.

ÒòÎª sunsite.unc.edu  µÄ¸ºÔØ·Ç³£µØÖØ£¬ÇëÊ¹ÓÃ×î¿¿½üÄãµÄÊÊµ±Ó³Éä(mirror)½Úµã£®



{\bfseries ¸ÐÐ»}



²»¶ÏµØÓÐÐí¶àÈËÌá¹©ÎÒÐ´×÷´ËÎÄ¼þµÄÐ­Öú£®
ÌØ±ð¸ÐÐ» Al Longyear ¶Ô PPP ±¾ÉíµÄÖ¸µ¼(Èç¹ûÕâÀïÓÐÈÎºÎ´íÎó£¬ÄÇÊÇÎÒµÄ¶ø²»ÊÇËûµÄ)£¬
Greg Hankins(Linux HOWTOs µÄÎ¬»¤ÈË)ÒÔ¼° Debi Tackett (MaximumAccess.com) 
Ðí¶àÔÚÐÎÊ½£¬ÄÚÈÝË³Ðò£¬Âß¼­Óë½âÊÍÇåÎú¶ÈµÄÓÐÓÃ½¨Òé£® 



×îáá£¬¶Ôì¶Ðí¶àÒÔµç×ÓÓÊ¼þÌá¹©ÎÒÒâ¼ûµÄÈË£¬¸ÐÐ»Äú£®
¾ÍÏñËùÓÐ HOWTO µÄ×÷ÕßÒ»Ñù£¬°ïÖúËûÈËËù»ñµÃµÄÂú×ã¸Ð¾ÍÊÇÎÒÃÇËùÊÕµ½µÄ±¨³ê£¬¶øÕâÒÑ×ã¹»£®
¾­ÓÉÐ´×÷Õâ·Ý HOWTO ÎÄ¼þÎÒ³¥»¹Ò»Ð¡²¿·ÝÈËÇéÕ®£¬ÕâÊÇÎÒ£¬ÒÔ¼°ËùÓÐÆäâÅ Linux µÄÊ¹ÓÃÕß£¬
Ëù»ýÇ·¸øÎªÎÒÃÇ×«Ð´ÓëÎ¬»¤Õâ¸ö×÷ÒµÏµÍ³µÄÈËµÄ£®




\section{¼ò½é}

PPP £¨µã¶ÔµãÐ­¶¨£©ÊÇÔÚ´®ÁÐÁ¬½áÉÏÅÜ IP £¨Íø¼ÊÍøÂ·Ð­¶¨£©ÒÔ¼°ÆäËüÍøÂ·Ð­¶¨µÄÒ»ÖÖ»úÖÆ£¬
´®ÁÐÁ¬½á¿ÉÒÔÊÇÖ±½ÓµÄ´®ÁÐÁ¬½Ó£¨Ê¹ÓÃ null-modem ÀÂÏß£©»òÊÇÊ¹ÓÃÊý¾Ý»úÒÔ¼°µç»°ÏßÂ·ËùÔì³öµÄÁ¬½á
(µ±È»Ò²°üÀ¨Èç ISDN µÄÊýÎ»ÏßÂ·)£®

Ê¹ÓÃ PPP, Äã¿ÉÒÔ°ÑÄãµÄ Linux PC Á¬½Óµ½Ò»Ì¨ PPP  ËÅ·þÆ÷ÉÏ²¢´æÈ¡¸ÃËÅ·þÆ÷ËùÁ¬½ÓµÄÍøÂ·×ÊÔ´£¨¼¸ºõ£©¾ÍÈçÍ¬ÄãÊÇÖ±½ÓÁ¬½ÓÔÚ¸ÃÍøÂ·ÉÏÒ»°ã£®

ÄãÒ²¿ÉÒÔ°ÑÄãµÄ Linux PC ÉèÎªÒ»Ì¨ PPP  ËÅ·þÆ÷£¬ÕâÑùÒ»À´ÆäËüµçÄÔ¾Í¿ÉÒÔ²¦ÈëÄãµÄµçÄÔ²¢ÇÒ´æÈ¡ÔÚÄãÇøÓòÍøÂ·ÀïµÄ×ÊÔ´£®

ÒòÎª PPP  ÊÇÒ»ÖÖµã¶Ôµã (peer-to-peer) µÄÏµÍ³£¬Òò´ËÄãÒ²¿ÉÒÔÊ¹ÓÃÁ½Ì¨ Linux PC ÉÏµÄ PPP  °ÑÍøÂ·Á¬½áÔÚÒ»Æð£¨»òÊÇ°ÑÇøÓòÍøÂ·Á¬½áµ½Íø¼ÊÍøÂ·ÉÏ£©£®

×îÖ÷ÒªµÄ²îÒìµ±È»ÊÇËÙ¶È £­ ±ê×¼µÄÒÒÌ«ÍøÂ·Á¬ÏßÊÇÒÔ 10 Mbps£¨Ã¿Ãë°ÙÍòÎ»Ôª£©Õâ¸öÀíÂÛÉÏµÄ×î´ó¹áÍ¨Á¿ÔÚ¶¯×÷£¬
¶øÔÚÊý¾Ý»úÕâ·½Ãæ×î´óÊÇÒÔ 56 kbps£¨Ã¿ÃëÇ§Î»Ôª£©µÄËÙ¶ÈÔÚ¶¯×÷£®

Í¬Ê±£¬ÒÀ¾Ý PPP  Á¬ÏßµÄÐÍÌ¬£¬Ä³Ð©Ó¦ÓÃÒÔ¼°·þÎñÔÚÊ¹ÓÃÉÏ¿ÉÄÜ»áÓÐÐ©ÏÞÖÆ£®




\subsection{¿Í»§¶ËÒÔ¼°ËÅ·þ¶Ë}

PPP ÊÇÒ»ÖÖÍêÍêÈ«È«ÊÇ{\bfseries µã¶Ôµã}µÄÐ­¶¨£»²¦½ÓµÄ»úÆ÷ÒÔ¼°½ÓÊÜ²¦½ÓµÄ»úÆ÷Ö®¼ä£¨ÔÚ¼¼ÊõÉÏ£©²¢Ã»ÓÐ²îÒì£®
È»¶ø£¬ÎªÁËÇå³þÃ÷°×µÄÔµ¹Ê£¬ÒÔ{\bfseries ËÅ·þ¶Ë}Óë{\bfseries ¿Í»§¶Ë}µÄ·½Ê½À´Ë¼¿¼ÊÇºÜÓÐÓÃµÄ£®

µ±Äã²¦ÈëÒ»¸ö½ÚµãÒª½¨Á¢ PPP  Á¬ÏßÊ±£¬ÄãÊÇ{\bfseries ¿Í»§¶Ë}£®ÄãËùÁ¬ÏßµÄÄÇÌ¨»úÆ÷ÊÇ{\bfseries ËÅ·þ¶Ë}£®

µ±ÄãÔÚÉè¶¨Ò»Ì¨ Linux »úÆ÷Ê¹Æä½ÓÊÕ²¢´¦Àí²¦ÈëµÄ PPP Á¬ÏßÊ±£¬ÄãÕýÔÚÉèÁ¢Ò»Ì¨ PPP {\bfseries ËÅ·þ¶Ë}£®

ÈÎºÎ Linux PC ¶¼¿ÉÒÔÊÇ PPP  ËÅ·þ¶ËÒÔ¼°¿Í»§¶Ë £­ ÉõÖÁì¶Èç¹ûÄãÓÐÒ»¸öÒÔÉÏµÄ´®ÁÐ²º£¨ÒÔ¼°Êý¾Ý»ú£¬Èç¹ûÓÐ±ØÒª£©µÄ»°»¹¿ÉÒÔÍ¬Ê±°çÑÝÕâÁ½ÖÖ½ÇÉ«£®
ÈçÍ¬Ç°ÃæËùËµµÄ£¬¾Í PPP ¶øÑÔ£¬Ò»µ©Á¬Ïß½¨Á¢ÄÇ÷á¿Í»§¶ËÓëËÅ·þ¶ËÖ®¼ä²¢²»ÕæµÄÓÐÊ²÷á²îÒì£®

ÎªÁËÇå³þÃ÷°×µÄ¹ØÏµ£¬Õâ·ÝÎÄ¼þ°ÑÆôÊ¼ºô½Ð£¨¼´ "²¦Èë"£©µÄÄÇÌ¨»úÆ÷³Æ×÷{\bfseries ¿Í»§¶Ë}£¬
¶ø°Ñ»ØÓ¦µç»°£¬ºË¶Ô²¦ÈëÇëÇóÖ®ÑéÈÏ£¨ÀûÓÃÊ¹ÓÃÕß´úºÅ£¬ÃÜÂëÒÔ¼°ÆäËü¿ÉÄÜµÄ»úÖÆ£©µÄÄÇÌ¨»úÆ÷³Æ×÷{\bfseries ËÅ·þ¶Ë}£®

Ê¹ÓÃ PPP  ×öÎª¿Í»§¶Ë°ÑÄ³¸öµØ·½µÄÒ»Ì¨»ò¶àÌ¨»úÆ÷Á¬½áµ½Íø¼ÊÍøÂ·ÉÏ¿ÉÄÜÊÇ´ó²¿·ÝÈË¶¼¸ÐÐËÈ¤µÄÒ»µã
- ÕâÊÇ½«ËûÃÇµÄ Linux »úÆ÷×÷ÎªÒ»¿Í»§¶Ë£®

ÔÚÕâ·ÝÎÄ¼þÖÐËùÃèÊöµÄ³ÌÐò½«»áÈÃÄãÄÜ¹»½¨Á¢²¢×Ô¶¯»¯ÄãµÄÍø¼ÊÍøÂ·Á¬Ïß£®

Õâ·ÝÎÄ¼þÒ²½«ÔÚ°ÑÄãµÄ Linux PC ÉèÎª PPP {\bfseries ËÅ·þÆ÷}ÒÔ¼°Ê¹ÓÃ PPP À´Á¬½áÁ½¸öÇøÓòÍøÂ·£¨ÓÐÍêÕûµÄµÝËÍÉè¶¨£©ÕâÐ©·½Ãæ¸øÄãÖ¸Òý£¨Õâ³£³£±»³Æ×÷½¨Á¢¹ãÓòÍøÂ·Á¬½á£©£®




\subsection{²»Í¬ Linux Ì×¼þ¼äµÄ²îÒì}

ÓÐÕâ¶à²»Í¬µÄ Linux Ì×¼þ£¬ËûÃÇÓÐ×Ô¼ºµÄÌØÖÊÓëÐÐÎªÄ£Ê½£®

ÌØ±ðµØ£¬Linux (ÒÔ¼° Unix)µçÄÔÓÐÁ½ÖÖ²»Í¬µÄÆðÊ¼·½Ê½£¬½çÃæÉè¶¨µÈµÈ£®

ÕâÁ½ÖÖ·Ö±ðÊÇ {\bfseries BSD system initialisation} Óë {\bfseries System V system initialisation}£®
Èç¹ûÄã½øÈëÄ³Ð© Unix µÄÐÂÎÅÌÖÂÛÈº£¬Äã»á·¢ÏÖ¾­³£ÓÐË«·½Ö§³ÖÕßµÄÕ½Õù£®
Èç¹ûÄã¾õµÃÓÐÈ¤£¬¾Í¼ÓÈëÕâ¸öÀË·ÑÍøÂ·Æµ¿íµÄÐÐÁÐ!

×îÆÕ±éÊ¹ÓÃµÄÌ×¼þ¿ÉÄÜÊÇ

\begin{itemize}
\item Slackware\\ 
Ê¹ÓÃ BSD ÐÎÊ½µÄÏµÍ³ÆðÊ¼
\item Red Hat (and its former associate Caldera)\\ 
Ê¹ÓÃ SysV ÏµÍ³ÆðÊ¼(ÓÐÐ©ÐíµÄÐÞ¸Ä)
\item Debian\\ 
Ê¹ÓÃ SysV ÏµÍ³ÆðÊ¼
\end{itemize}




BSD ÐÎÊ½µÄÏµÍ³ÆðÊ¼Í¨³£½«ËüµÄÆô¶¯µµ°¸·ÅÔÚ {\ttfamily /etc/...}£¬ÕâÐ©µµ°¸ÊÇ:
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
        /etc/rc
        /etc/rc.local
        /etc/rc.serial
                (Ò²¿ÉÄÜÓÐÆäËüµµ°¸)
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




×î½ü£¬Ò»Ð© BSD ÏµÍ³µÄÆðÊ¼Ä£Ê½½«Ê¹ÓÃ {\ttfamily /etc/rc.d...} ×öÎªÆô¶¯µµ°¸µÄ´æ·ÅÄ¿Â¼£¬¶ø²»ÊÇ½«ËùÓÐµÄ¶«Î÷¶¼¶ªµ½ {\ttfamily /etc} ÏÂ£®

System V ÆðÊ¼Ä£Ê½½«Æô¶¯µµ°¸´æ·ÅÔÚ {\ttfamily /etc/...} »ò {\ttfamily /etc/rc.d/...} ¼°ÆäÏÂµÄÒ»¶Ñ×ÓÄ¿Â¼ÖÐ:

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
drwxr-xr-x   2 root     root         1024 Jul  6 15:12 init.d
-rwxr-xr-x   1 root     root         1776 Feb  9 05:01 rc
-rwxr-xr-x   1 root     root          820 Jan  2  1996 rc.local
-rwxr-xr-x   1 root     root         2567 Jul  5 20:30 rc.sysinit
drwxr-xr-x   2 root     root         1024 Jul  6 15:12 rc0.d
drwxr-xr-x   2 root     root         1024 Jul  6 15:12 rc1.d
drwxr-xr-x   2 root     root         1024 Jul  6 15:12 rc2.d
drwxr-xr-x   2 root     root         1024 Jul 18 18:07 rc3.d
drwxr-xr-x   2 root     root         1024 May 27  1995 rc4.d
drwxr-xr-x   2 root     root         1024 Jul  6 15:12 rc5.d
drwxr-xr-x   2 root     root         1024 Jul  6 15:12 rc6.d
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




Èç¹ûÄã³¢ÊÔÑ°ÕÒÄãµÄÒÒÌ«ÍøÂ·¿¨¼°ÍøÂ·µÝËÍÉè¶¨ÕæÕýµÄÅäÖÃµØ·½£¬ÄãÐèÒª×·×Ùµ½ÕâÐ©µµ°¸ÀïÕÒ³öÅäÖÃÖ¸ÁîµÄËùÔÚ£®




\subsection{Ì×¼þÏà¹ØµÄ PPP ÅäÖÃ¹¤¾ß}

ÔÚÄ³Ð©°²×°Ì×¼þ(Èç Red Hat Óë Caldera)£¬ÓÐÒ»¸öÒÔ X window Éè¶¨µÄ PPP ²¦½ÓÏµÍ³£®
Õâ·Ý HOWTO ²¢Î´°üº¬ÕâÖÖÓë×î¼þÏà¹ØµÄ¹¤¾ß£®Èç¹ûÄãÔÚÊ¹ÓÃÉÏÓÐÎÊÌâ£¬Ö±½ÓºÍÌ×¼þµÄ·¢ÐÐÈËÑ¯ÎÊ£®

¶Ôì¶ Red Hat 4.x µÄÊ¹ÓÃÕß£¬¿ÉÒÔÔÚ Linux µÄ×ÊÔ´ÇøÕÒµ½ \nameurl{http://www.interweft.com.au}{Red Hat PPP-TIP}£¬
Ò²¿ÉÔÚÖ§Ô®ÇøÕÒµ½ \nameurl{http://www.Red Hat.com}{Red Hat Software}£®




\section{IP ºÅÂë}

Ã¿Ò»¸öÁ¬ÉÏÍø¼ÊÍøÂ·µÄÉè±¸¶¼±ØÐëÓµÓÐËüÃÇ×Ô¼ºµÄ£¬Î¨Ò»µÄ IP ºÅÂë£®ÕâÐ©ÊÇÓÉÃ¿¸ö¹ú¼ÒµÄÓÐ¹Øµ¥Î»¼¯ÖÐÖ¸¶¨µÄ£®

Èç¹ûÄãÒª°ÑÇøÓòÍøÂ·Á¬ÉÏÍø¼ÊÍøÂ·£¬ÔÚÄãµÄÇøÓòÍøÂ·ÀïÄãËùÓµÓÐµÄËùÓÐµçÄÔ¼°Éè±¸¶¼{\bfseries ±ØÐë}Ê¹ÓÃ´ÓÖ¸¶¨¸øÄãµÄÍøÂ·¡õÎ§Àï·ÖÅäµÄ IP ºÅÂë£®
¼´Ê¹Á¬½ÓÁíÒ»¸öÇøÓòÍøÂ·£¨ÔÚÍø¼ÊÍøÂ·Ö®Íâ£©ÄãÒ²{\bfseries ¾ø²»ÄÜ}Æ¾¿ÕÈ¡ÓÃ IP ºÅÂë£®
Èç¹ûÄã'ÍµÀ´'µÄ IP ºÅÂë¿ªÊ¼¸ÉÈÅÆäËüÒÑ¾­Ê¹ÓÃÕâ¸ö IP µÄµçÄÔµÄ»°£¬×îÔãÊ±²»½ö²»»á¶¯£¬»¹½«»áÒýÆðÈ«ÌåÐÔµÄ´óÆÆ»µ£®

Çë×¢ÒâÔÚÕâÕû·ÝÎÄ¼þÀïËùÊ¹ÓÃµÄ IP ºÅÂë£¨ÓÐÒ»Ð©¸öÀýÍâ£©¶¼ÊÇ´Ó±£Áô¸øÃ»ÓÐ£¨²»Ôø£©Á¬ÉÏÍø¼ÊÍøÂ·µÄÍøÂ·ËùÊ¹ÓÃµÄ¡®Î´Á¬ÏßÍøÂ·ºÅÂë¡¯ÏµÁÐÀ´µÄ£®

ÓÐÒ»Ð©ÌØ±ðÁô¸ø²»Á¬½ÓÍø¼ÊÍøÂ·µÄÍøÂ·Ê¹ÓÃµÄ IP ºÅÂë£®ÕâÐ© IP ºÅÂëÒÀÐòÊÇ:

\begin{itemize}
\item 1 ¸ö A-µÈ¼¶ µÄÎ»Ö·\\ 
10.0.0.0 (netmask 255.0.0.0)
\item 16 ¸ö B-µÈ¼¶ µÄÎ»Ö·\\ 
172.16.0.0 - 172.31.0.0 (netmask 255.255.0.0)
\item 256 ¸ö C-µÈ¼¶ µÄÎ»Ö·\\ 
192.168.0.0 - 192.168.255.0 (netmask 255.255.255.0)
\end{itemize}




Èç¹ûÄãµÄÍøÂ·{\bfseries »¹Ã»}´ÓÄã¹ú¼ÒµÄÈ¨Ôðµ¥Î»·ÖÅäµ½ IP ºÅÂë£¬ÄÇ÷áÄãµÄ»úÆ÷Ó¦¸ÃÊ¹ÓÃÇ°ÃæËùÁÐÕâÐ©ÍøÂ·ºÅÂëÖÐµÄÒ»¸ö£®

ÕâÐ©ºÅÂë{\bfseries ÓÀÔ¶²»¸Ã}Ê¹ÓÃÔÚÍø¼ÊÍøÂ·ÉÏ£®

È»¶ø£¬ËüÃÇÈÔ¿ÉÊ¹ÓÃÔÚÒ»²¿Á¬½ÓÔÚÍø¼ÊÍøÂ·µÄ»úÆ÷ÉÏµÄÄÚ²¿ÒÒÌ«ÍøÂ·¿¨ÉÏ£®
ÒòÎª IP ºÅÂëÊÇ·ÖÅä¸øÍøÂ·½çÃæ£¬¶ø²»ÊÇµçÄÔ±¾ÉíµÄ£®
Òò´ËËäÈ»ÄãµÄÒÒÌ«ÍøÂ·½çÃæÊ¹ÓÃ 10.0.0.1 (ÀýÈç)£¬µ±ÄãÒÔ PPP Á¬ÉÏÍø¼ÊÍøÂ·Ê±£¬ÄãµÄ PPP ½çÃæ½«ÓÉËÅ·þÆ÷·ÖÅä¸øÁíÒ»¸ö(ºÏ·¨µÄ) IP ºÅÂë£®
ÄãµÄ PC ½«ÓÐÍø¼ÊÍøÂ·µÄÁ¬½ÓÄÜÁ¦£¬µ«ÆäËüÇøÓòÍøÂ·ÄÚµÄµçÄÔÔòÃ»ÓÐ£®

²»¹ý£¬Ê¹ÓÃ Linux  ÒÔ¼° ipfwadm  ÈíÌåµÄ IP Î±×°ÄÜÁ¦(Ò²½Ð×ö NAT - Network address Translation ÍøÂ·Î»ÖÃ×ª»»)£¬
Äã¾Í¿ÉÒÔ°ÑÄãµÄÇøÓòÍøÂ·ÉÏ²»¾ßºÏ·¨ IP ºÅÂëµÄ»úÆ÷Á¬ÉÏÍø¼ÊÍøÂ·£¨Ìá¹©µÄ·þÎñ»áÓÐÐ©ÏÞÖÆ£©£®

ÏëµÃµ½¸ü¶à×ÊÑ¶Çë²Î¿¼ 
\nameurl{http://sunsite.unc.edu/mdw/HOWTO/mini/IP-Masquerade}{Linux IP Masquerade mini HOWTO}£®

¶Ôì¶´ó²¿·ÖµÄÊ¹ÓÃÕß£¬¾­ÓÉ PPP  Á¬½Óµ¥Ò»»úÆ÷µ½Íø¼ÊÍøÂ··þÎñÌá¹©Õß(Internet Service Providers: ISP)£¬
È¡µÃÒ»¸ö IP ºÅÂë£¨»ò¸üÕýÈ·µÄËµ£¬Ò»¸öÍøÂ·ºÅÂë£©ÊÇÃ»ÓÐ±ØÒªµÄ£®

Èç¹ûÄãÏ£ÍûÁ¬½ÓÒ»¸öÐ¡ÐÍµÄÇøÓòÍøÂ·µ½Íø¼ÊÍøÂ·ÉÏ£¬Ðí¶àÍø¼ÊÍøÂ··þÎñÌá¹©Õß¿ÉÒÔ´ÓËûÃÇÒÑÓÐµÄ IP Î»Ö·¿Õ¼äÖÐÌá¹©¸øÄãÒ»¸ö´ÎÍøÂ·£¨ÌØ¶¨µÄÒ»¶Î IP ºÅÂë£©£®
»òÕß£¬Ê¹ÓÃ IP Î±×°ÄÜÁ¦£®¡¡

¶Ôì¶¾­ÓÉ ISP  Á¬½Óµ¥Ò» PC µ½Íø¼ÊÍøÂ·ÉÏµÄÊ¹ÓÃÕß£¬´ó²¿·ÖµÄÌá¹©ÕßÊ¹ÓÃ¶¯Ì¬µÄ IP Ö¸¶¨£®
ÕâÊÇËµ£¬Á¬Ïß³ÌÐòµÄÒ»²¿·ÝÖÐ£¬ÄãËùÁªÏµµÄ PPP ·þÎñ½«»á¸æËßÄãµÄ»úÆ÷Õâ´ÎÁ¬ÏßµÄÆÚ¼äÀï¸Ã PPP ½çÃæÓ¦¸ÃÊ¹ÓÃÊ²÷á IP ºÅÂë£®
Ã¿´ÎÄãÁ¬ÉÏ ISP ËùµÃµ½µÄºÅÂë²»»áÒ»Ñù£®

Ê¹ÓÃ¶¯Ì¬µÄ IP ºÅÂë£¬ÄãÃ¿´ÎµÄÁ¬Ïß{\bfseries ²»»á}¶¼È¡µÃÏàÍ¬µÄ IP ºÅÂë£®
Õâ¶ÔÔÚÄã Linux  »úÆ÷ÉÏµÄËÅ·þÐÍÌ¬Ó¦ÓÃ³ÌÊ½ÏñÊÇ sendmail, ftpd, httpd ÒÔ¼°ÖîÈç´ËÀàµÄÈíÌå¶øÑÔ»á²úÉúÎÊÌâ£®
ÕâÐ©·þÎñ¸ù»ùì¶Õâ²¿Ìá¹©·þÎñµÄµçÄÔÄÜÒÔÍ¬ÑùµÄ IP ºÅÂëÈ¡ÓÃ£®

ÓÉì¶¶¯Ì¬µÄ IP ºÅÂëÖ¸¶¨¶øÓÐËùÏÞÖÆµÄ·þÎñ£¨ÒÔ¼°½â¾öµÄ·½·¨£¬¿ÉÄÜµÄ»°£©ÉÔáá»áÔÚÕâ·ÝÎÄ¼þÖÐÌÖÂÛ£®




\section{Õâ·ÝÎÄ¼þµÄÄ¿µÄ}


\subsection{ÉèÁ¢ PPP ¿Í»§¶Ë}

Õâ·ÝÎÄ¼þÌá¹©ÏëÒªÊ¹ÓÃ Linux ÒÔ¼° PPP ²¦½Óµ½Ä³Ò»Ì¨ PPP ËÅ·þÆ÷²¢ÇÒÊ¹ÓÃ PPP ÉèÁ¢ IP Á¬ÏßµÄÈËÃÇÒ»Ð©Ö¸Òý£®
ÎÄ¼þÖÐ¼ÙÉè PPP  ÒÑ¾­±àÒëºÃ²¢ÇÒ°²×°ÔÚÄãµÄ Linux  »úÆ÷ÉÏ(µ«¼ò¶ÌµØº­¸ÇÖØÐÂÅäÖÃ£¯ÖØÐÂ±àÒëÄãµÄºËÐÄÒÔ±ã°üº¬ PPP  Ö§Ô®µÄ²¿·Ý)£®

ËäÈ» DIP£¨½¨Á¢ SLIP Á¬ÏßµÄ±ê×¼·½Ê½£©¿ÉÒÔÓÃÀ´´´Ôì PPP  Á¬Ïß£¬µ« DIP Ö¸Áî¸åÒ»°ã¶¼Ïàµ±µØ¸´ÔÓ£®
ÒòÎªÕâ¸öÔµ¹Ê£¬Õâ·ÝÎÄ¼þ²¢²»º­¸ÇÊ¹ÓÃ DIP À´½¨Á¢ PPP Á¬ÏßµÄ²¿·Ý£®

È¡¶ø´úÖ®µÄÊÇ£¬Õâ·ÝÎÄ¼þÃèÊö±ê×¼µÄ Linux PPP  ÈíÌå(chat/pppd)£®




\subsection{Ê¹ÓÃ PPP  Á¬½áÁ½¸öÇøÓòÍøÂ·»òÁ¬½áÒ»¸öÇøÓòÍøÂ·µ½Íø¼ÊÍøÂ·ÉÏ}

Õâ·ÝÎÄ¼þÌá¹©¹Øì¶Á¬½áÁ½¸öÇøÓòÍøÂ·»òÁ¬½áÒ»¸öÇøÓòÍøÂ·µ½Íø¼ÊÍøÂ·ÉÏµÄ£¨»ù±¾£©×ÊÑ¶£®




\subsection{ÉèÁ¢ PPP ËÅ·þÆ÷}

Õâ·ÝÎÄ¼þÌá¹©ÈçºÎÅäÖÃÄãµÄ Linux PC ×öÎª PPP  ËÅ·þÆ÷µÄÖ¸Òý£¨ÔÊÐíÆäËûÈË²¦½Óµ½ÄãµÄ Linux PC ²¢ÇÒ½¨Á¢ PPP  Á¬Ïß£©£®

ÄãÓ¦¸Ã×¢ÒâµÄÊÇÉè¶¨ Linux  ×÷Îª PPP  ËÅ·þÆ÷µÄ·½·¨ÓÐÎÞÊýÖÖ£®Õâ·ÝÎÄ¼þ£¨Ä¿Ç°£©¸øÄãÒ»ÖÖ·½Ê½ £­ 
×÷ÕßÓÃÀ´ËüÉèÁ¢Ò»Ì¨Ð¡ÐÍ PPP  ËÅ·þÆ÷£¨¹²ÓÐ 16 Ì¨Êý¾Ý»ú£©£®

Õâ¸ö·½Ê½ÒÑÖªÔË×÷Á¼ºÃ£®²»¹ý£¬Ëü²»Ò»¶¨ÊÇ×îºÃµÄ·½Ê½£®




\subsection{Ê¹ÓÃ PPP ì¶Ö±½ÓÀÂÏß(direct null modem)Á¬½á}

±¾ÎÄ¼þÌá¹©Ê¹ÓÃ PPP Á¬½áì¶Á½²¿ Linux PCs ì¶ null modem ÀÂÏßµÄ¼ò¶ÌÃèÊö£®
ÒÔ´Ë·¨Á¬½áÆäËü×÷ÒµÏµÍ³ì¶ Linux Ò²ÊÇ¿ÉÄÜµÄ£®
Èç¹ûÒªÕâÑù×ö£¬Äã±ØÐë²Î¿¼ÄãÒªÁ¬½áµÄ×÷ÒµÏµÍ³µÄÎÄ¼þ£®




\subsection{Õâ·ÝÎÄ¼þÄ¿Ç°ÉÐÎ´º­¸ÇµÄ...}

\begin{itemize}
\item ±àÒë PPP ÈíÌå\\ 
²Î¼ûËæ¸½ÄãÊ¹ÓÃµÄ pppd °æ±¾¶øÀ´µÄÎÄ¼þ£®
\item Á¬½ÓÒÔ¼°ÅäÖÃÊý¾Ý»úµ½ Linux ÉÏ(Ï¸½Ú)\\ 
Çë²ÎÔÄ Serial-HOWTO£¬ÒÔ¼°Êý¾Ý»úÏà¹ØµÄÆðÊ¼Éè¶¨£¬²ÎÔÄ
\nameurl{http://www.in.net/info/modems/index.html}{Modem Setup Information}
ÀïµÄ×ÊÑ¶¿ÉÄÜ¶ÔÄãÉè¶¨Êý¾Ý»úÓÐËù°ïÖú£®
        
\item Ê¹ÓÃ DIP  ´´Ôì PPP  Á¬Ïß\\ 
Ê¹ÓÃ chat È¡´ú...
\item Ê¹ÓÃ socks  »òÊÇ IP Masquerade\\ 
ÒÑ¾­ÓÐº­¸ÇÕâÁ½¸öÌ×¼þµÄ¾ø¼ÑÎÄ¼þ£®
\item Ê¹ÓÃ {\ttfamily diald} ÒÔ½¨Á¢×Ô¶¯Á¬Ïß\\ 
Çë²ÎÔÄ {\ttfamily diald} ÎÄ¼þÀïµÄ×ÊÑ¶£®
\item Ê¹ÓÃ EQL ½«Á½²¿Êý¾Ý»úºÏ³Éµ¥Ò» PPP Á¬½á£®
\item ÓëÌ×¼þÏà¹ØµÄ PPP Á¬Ïß·½·¨(ÀýÈç Red Hat 4.x ÍøÂ·Éè¶¨¹¤¾ß)\\ 
Çë²ÎÔÄ¸ÃÌ×¼þÖÐµÄÎÄ¼þ£®
\item ²»¶ÏÔö¼ÓµÄ×Ô¶¯½¨Á¢ PPP ¹¤¾ß\\ 
Çë²ÎÔÄÊÊµ±µÄÎÄ¼þ£®
\end{itemize}





\section{º­¸ÇµÄÈíÌå°æ±¾}

Õâ·ÝÊ¹ÓÃËµÃ÷¼ÙÉèÄãÊ¹ÓÃ Linux 1.2.x  ºËÐÄÅäºÏ PPP 2.1.2 ÈíÌå»ò Linux 1.3.X/2.0.x ÒÔ¼° PPP 2.2  °æ£®

ÔÚ±¾ÎÄ¼þ×«Ð´Ö®Ê±£¬Linux µÄ PPP ÈíÌå×îÐÂÕýÊ½°æ±¾ÊÇ ppp-2.2f£®
×îÐÂµÄ°æ±¾(ppp-2.3)»¹ÔÚ beta ½×¶Î£®

Ê¹ÓÃ PPP 2.2.0  ÅäºÏºËÐÄ 1.2.13 ÊÇÓÐ¿ÉÄÜµÄ£®È»¶ø£¬ÒªÕâÑù×öÐèÒªºËÐÄÐÞ²¹£®
½¨ÒéºËÐÄ 1.2.13 °æ±¾µÄÊ¹ÓÃÕßÉý¼¶µ½ ppp-2.2 ÒòÎªËü°üº¬ÁËÐí¶à´íÎóÐÞÕý¼°¹¦ÄÜ¼ÓÇ¿£®

{\bfseries »¹ÓÐ£¬ÄãÓ¦ÌØ±ð×¢Òâ²»ÄÜ½« PPP 2.1.2 Óë Linux ºËÐÄ 2.0.X ºÏÓÃ£®}



Çë×¢ÒâÕâ·ÝÎÄ¼þ{\bfseries ²»}°üÀ¨Ê¹ÓÃ Linux  ºËÐÄ 2.0.x  µÄ¿ÉÔØÈëÄ£×éËùÒýÆðµÄÎÊÌâ£®
Çë²ÎÔÄ kerneld mini-HOWTO ÒÔ¼°ºËÐÄ£¯Ä£×é 2.0.x  µÄÎÄ¼þ£¨ÔÚ Linux 2.0.x  µÄÔ­Ê¼³ÌÊ½Ä¿Â¼ {\ttfamily /usr/src/linux/Documentation/...} Àï£©£®

{\bfseries ÒòÎªÕâ·ÝÎÄ¼þÊÇÉè¼ÆÀ´Ð­ÖúÐÂÊÖµÄ£¬Ç¿ÁÒ½¨ÒéÄãÊ¹ÓÃÒÑÖªÄÜÎÈ¶¨µØ¹²Í¬ÔË×÷µÄ Linux °æ±¾¼°ÊÊµ±µÄ PPP °æ±¾£®}




\section{ÆäËüÓÐÓÃµÄ£¯ÖØÒªµÄÎÄ¼þ}

¹ÄÀøÊ¹ÓÃÕßÔÄ¶Á:-
\begin{itemize}
\item Ëæ¸½ì¶ PPP Ì×¼þµÄÎÄ¼þ;
\item pppd ÒÔ¼° chat µÄÏßÉÏÊ¹ÓÃÊÖ²á;\\ 
(Ê¹ÓÃ {\ttfamily man chat} ÒÔ¼° {\ttfamily man pppd} À´ÔÄ¶Á)
\item Linux ÍøÂ·¹ÜÀíÖ¸Òý (NAG);\\ 
²ÎÔÄ \nameurl{http://sunsite.unc.edu/mdw/LDP-books/nag-1.0/nag.html}{The Network Administrators' Guide}
\item Net-2/3 HOWTO;\\ 
²ÎÔÄ \nameurl{http://sunsite.unc.edu/mdw/HOWTO/NET-2-HOWTO.html}{Linux NET-2/3-HOWTO}
\item ÔÚ {\ttfamily /usr/src/linux/Documentation} ÀïµÄ Linux ºËÐÄÎÄ¼þ;
\item Êý¾Ý»úÉè¶¨×ÊÑ¶ - ²ÎÔÄ \nameurl{http://www.in.net/info/modems/index.html}{Modem Setup Information}
\item ÓÉ O'Reilly and Associates ³ö°æµÄ×î¼Ñ Unix/Linux Êé¼®£¨²ÎÔÄ \nameurl{ http://www.ora.com/}{O'Reilly and Associates On-Line Catalogue} ÀïµÄÄ¿Â¼£©£®
Èç¹ûÄãÊÇ Unix/Linux µÄÐÂÊÖ£¬Á¢¿Ì{\bfseries ÅÜ}£¨²»ÒªÓÃ×ßµÄ£©µ½ÀëÄã×î½üµÄµçÄÔÊéµêÈ¥Í¶×Ê¼¸ÑùÕâÐ©×ÊÁÏ£®
\item ÓÉ Al Longyear ËùÎ¬»¤µÄ PPP-FAQ£¬¿ÉÔÚ \nameurl{ftp://sunsite.unc.edu/pub/Linux/docs/faqs}{Linux PPP-FAQ} È¡µÃ£®\\ 
ÀïÃæ°üÀ¨ÁË´óÁ¿ÓÐÓÃµÄ×ÊÑ¶ÒÔÎÊ´ðµÄÐÎÊ½³öÏÖ£¬ÔÚÊÔÍ¼ÕÒ³öÎªºÎ PPP ²»ÄÜ(Õý³£)¹¤×÷Ê±Ïàµ±ÓÐÓÃ£®
\item ²»¶ÏÐÂÔöÓÉ²»Í¬³ö°æÉçÓë×÷Õß³öÆ·µÄÊé¼®;\\ 
¹ÄÀøÄãÈ¥²éÔÄÕâÐ©Á÷Í¨µÄÊé¼®£®Linux µÄ·¢Õ¹ÓëÌ×¼þµÄÑÝ½øÏàµ±¿ìËÙ£¬¶øÊé¼®µÄ¸Ä°æËÙ¶È(Ò»°ãÀ´Ëµ)Ïàµ±µÄÂý!
ÂòÒ»±¾ÒÑ¾­¹ýÆÚµÄºÃÊé(ÏÖÔÚÓÐÐí¶à)¿ÉÄÜÊ¹µÃÐÂÊ¹ÓÃÕß¸Ðµ½À§»óÓëÊ§Íû£®
\end{itemize}




Linux ÎÄ¼þµÄ×î¼ÑÆðµã¾ÍÊÇ \nameurl{http://sunsite.unc.edu/mdw/}{The Linux Documentation Project Home Page}. HOWTOs ÇãÏòì¶¶¨ÆÚµØ¸üÐÂ£®



ËäÈ»¼´Ê¹²»±ØÔÄ¶ÁÕâÐ©×ÊÁÏÖÐµÄÈÎºÎÒ»·ÝÄãÒ²¿ÉÒÔÊ¹ÓÃÕâ·ÝÎÄ¼þÀ´½¨Á¢ÄãµÄ PPP Á¬½á£¬
µ«ÊÇÈç¹ûÄãÈ¥ÔÄ¶ÁÕâÐ©ÎÄ¼þÄÇ÷áÄã¶Ôì¶ÄãËù×öµÄ¾¿¾¹·¢ÉúÁËÐ©Ê²÷á½«»áÁË½â¸ü¶à!
Äã½«ÄÜ¹»¾«È·µÄÌá³ö×Ô¼ºµÄÎÊÌâ(»òÖÁÉÙÔÚ comp.os.linux... ÐÂÎÅÌÖÂÛÈº»ò Linux mailing lists ÖÐÎÊ³ö½ÏÓÐÉî¶ÈµÄÎÊÌâ)£®



ÕâÐ©ÎÄ¼þ£¨Óë¸÷ÖÖÆäËüÎÄ¼þ£¬°üÀ¨Ïà¹ØµÄ RFCs µÈ£©Ìá¹©¶îÍâµÄÒÔ¼°±ÈÕâ·ÝÊ¹ÓÃËµÃ÷ËùÄÜ°üº¬µÄ¸ü¶àÏ¸½Ú½âÊÍ£®

Èç¹ûÄãÒªÊ¹ÓÃ PPP Á¬½ÓÇøÓòÍøÂ·µ½Íø¼ÊÍøÂ·ÉÏ£¬ÄÇ÷áÄã½«µÃÖªµÀÒ»Ð©¹Øì¶ TCP/IP ÍøÂ·ÔË×÷µÄÖªÊ¶£®
²¹³äÒ»µãÕâ·ÝÎÄ¼þÇ°ÃæÌáµ½µÄ×ÊÁÏ£¬Äã½«»á·¢ÏÖ O'Reilly ³ö°æµÄ "TCP/IP Network Administration"  ÒÔ¼° "Building Internet Firewalls" ºÜÓÐºÃ´¦!




\subsection{ÓÐÓÃµÄ Linux µç×ÓÓÊµÝÁÐ±í}

ÓÐÐí¶àÔÚ²»Í¬Ê¹ÓÃÕßµÈ¼¶Ö®¼äÁ÷Í¨µÄµç×ÓÓÊµÝÁÐ±í(mailing lists)£®
Ñ¡ÔñÄãÓÐÐËÈ¤ÒÔ¼°¶ÔÄã×¨ÒµÖªÊ¶¼°¹ÛµãÓÐËù°ïÖúµÄÁÐ±íÀ´¶©ÔÄ£®



{\bfseries Ò»Ð©ÖÒ¸æ}: ÓÐÐ©ÁÐ±íÊÇ¸øÄÇÐ©"×¨¼Ò¼¶"Ê¹ÓÃÕß»òÊÇÌØÊâÖ÷ÌâµÄ£®
ËäÈ»Ã»ÓÐÈË»á±§Ô¹Äã"Ç±·ü"(¶©ÔÄµ«²»·¢±íÎÄÕÂ)ÔÚÀïÃæ£¬
²»¹ýÈç¹ûÄãÔÚ²»ÊÊºÏµÄÁÐ±íÖÐÌá³ö"ÐÂÊÖ"µÄÎÊÌâÄã¿ÉÄÜ»áÊÕµ½Ò»Ð©·ßÅ­µÄÒâ¼û£®



Õâ²¢²»ÊÇÒòÎª×¨¼Ò¼¶µÄÊ¹ÓÃÕßÌÖÑáÐÂ½øµÄÊ¹ÓÃÕß£¬¶øÊÇÒòÎªÕâÐ©ÁÐ±íÊÇÓÃÀ´´¦Àí¾ßÓÐÒ»¶¨À§ÄÑ¶ÈµÄÌØÊâÖ÷ÌâµÄ£®



¼ÓÈëÄÇÐ©¿ÉÒÔ¹«¿ª¶©ÔÄµÄÁÐ±í£¬µ«Çë¾ÖÏÞÄãµÄÒâ¼ûì¶ÁÐ±íµÄÏà¹ØÖ÷ÌâÉÏÃæ£®



Linux µç×ÓÓÊµÝÁÐ±íÒ»¸öºÜºÃµÄÆðµãÊÇ
\nameurl{http://summer.snu.ac.kr/~djshin/linux/mail-list/index.shtml}{Linux Mailing List Directory}£®




\section{½« PPP Éè¶¨Îª¿Í»§¶ËµÄ¹¤×÷¸ÅÒª}

Õâ·ÝÎÄ¼þ°üº¬ÁËÐí¶à×ÊÑ¶ - ¶øÇÒÃ¿´Î¸Ä°æÓÖ²»¶ÏÔö¼Ó!



Òò´Ë£¬±¾½ÚµÄÄ¿µÄÔÚì¶Ìá¹©Ò»¼ò¶ÌµÄ¸ÅÒªËµÃ÷Òª½«ÄãµÄ Linux ÏµÍ³×÷Îª¿Í»§¶ËÁ¬½Óµ½ PPP ËÅ·þÆ÷ËùÐèµÄ¹¤×÷£®




\subsection{È¡µÃ/°²×°ÈíÌå}

Èç¹ûÄãµÄ Linux Ì×¼þ²¢Î´°üº¬ PPP ÈíÌå£¬Äã¿É´Ó´ËÈ¡µÃ: \nameurl{ftp://sunsite.unc.edu/pub/Linux/system/network/serial/ppp/ppp-2.2.0g.tar.gz}{the Linux PPP daemon}.



ÕâÊÇ±¾ÎÄ¼þ×«Ð´µÄÊ±ºò×îÐÂÕýÊ½°æ±¾£®È»¶ø£¬¾¡Á¿´Ó¸ÃÕ¾È¡µÄ×îÐÂµÄ°æ±¾(±¾ÎÄ¼þ×«Ð´Ê± ppp-2.3 ÉÐÔÚ beta ½×¶Î¶øÇÒÓ¦¸ÃºÜ¿ì»á·¢ÐÐ)£®



Õâ·Ý PPP Ì×¼þ°üº¬ÁËÈçºÎ±àÒë¼°°²×°ËùÐèµÄÖ¸Òý£¬{\bfseries Òò´Ë±¾ÎÄ²¢²»°üº¬´Ë²¿·Ý}!




\subsection{±àÒëºËÐÄ¼ÓÈë PPP Ö§Ô®}

Linux µÄ PPP ÔË×÷°üº¬Á½²¿·Ý
\begin{itemize}
\item ÉÏÃæÌáµ½µÄ PPP daemon
\item PPP µÄºËÐÄÖ§Ô®
\end{itemize}




Ðí¶àÌ×¼þËÆºõÔÚËüÃÇÔ¤ÉèµÄ°²×°ºËÐÄÖÐÌá¹© PPP µÄÖ§Ô®£¬µ«ÆäâÅÔò·ñ£®



Èç¹ûÔÚÆô¶¯Ê±ºËÐÄ±¨¸æÕâÑùµÄÑ¶Ï¢

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
PPP Dynamic channel allocation code copyright 1995 Caldera, Inc.
PPP line discipline registered.
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ÄãµÄºËÐÄÒÑ±àÒë PPP Ö§Ô®ÔÚÄÚ£®



ÄÇ¾ÍÊÇËµ£¬²»ÂÛÄãÊ¹ÓÃÊ²÷áÌ×¼þÄã¿ÉÄÜÏ£Íû×ÔÐÐ±àÒëºËÐÄÒÔÔÚÄãµÄÌØ¶¨Ó²ÌåÅäÖÃÖ®ÏÂµÃµ½×îÓÐÐ§µÄÏµÍ³×ÊÔ´ÀûÓÃ£®
Çë¼Ç×¡ºËÐÄ²»ÄÜ±»ÖÃ»»³ö¼ÇÒäÌåÒò´Ë¾¡Á¿ÈÃºËÐÄ±£³Ö×îÐ¡ÔÚ¼ÇÒäÌåÓÐÏÞµÄ»úÆ÷ÉÏÏàµ±ÓÐÓÃ£®



±¾ÎÄ¼þÔÚ \ref{Kernel configuration} {(ÅäÖÃÄãµÄ Linux  ºËÐÄ)} Ò»½ÚÌá¹©ÁËÖØÐÂ±àÒëºËÐÄµÄ×îÉÙËµÃ÷£®



Ï¸½Ú²¿·ÝÇë²ÎÔÄ \nameurl{Kernel-HOWTO.html}{The Linux Kernel HOWTO}£®




\subsection{´ÓÄãµÄ ISP È¡µÃ×ÊÑ¶}

¼¸ºõÓÐÎÞÊýÖÖÉè¶¨ PPP ËÅ·þÆ÷µÄ·½·¨£®
ÎªÁËÁ¬ÉÏÄãµÄ ISP, Äã±ØÐëÈ¡µÃ PPP ËÅ·þÆ÷ÈçºÎÔË×÷µÄ×ÊÑ¶£®



ÒòÎªÄãÓÃµÄÊÇ Linux, ÔÚÒ»Ð©½öÖªµÀ MS Windows ¿Í»§¶ËµÄ ISP ÚÑÑ¯²¿ÃÅ¿ÉÄÜ»áÔâÓöÀ§ÄÑ£®



È»¶ø£¬ÓúÀ´Óú¶àµÄ ISP Ê¹ÓÃ Linux Ìá¹©·þÎñ - ¶øÇÒ Linux Ò²ÉøÈë¹«Ë¾»·¾³£¬Èç¹ûÄãÕæµÄÓöµ½ÎÊÌâÄãÒ²¿ÉÄÜ»áºÜÐÒÔË£®



\ref{Server info} {(È¡µÃÄãËùÐèµÄ PPP ËÅ·þÆ÷×ÊÑ¶)} Ò»½Ú¸æËßÄãÐèÒªÖªµÀÄãÁ¬½ÓµÄ PPP ËÅ·þÆ÷µÄÊ²÷á×ÊÑ¶ - ÒÔ¼°ÈçºÎÕÒ³öÕâÐ©×ÊÑ¶£®




\subsection{Éè¶¨ÄãµÄÊý¾Ý»ú¼°´®ÁÐ²º}

ÎªÁËÁ¬ÉÏ PPP ËÅ·þÆ÷²¢È¡µÃ×î¼ÑµÄ×ÊÁÏ´«ÊäËÙÂÊ£¬ÄãµÄÊý¾Ý»ú±ØÐëÉè¶¨ÕýÈ·£®



Í¬ÑùµØ£¬Á¬½ÓÊý¾Ý»ú¼°µçÄÔµÄ´®ÁÐ²ºÒ²±ØÐëÕýÈ·µØÉè¶¨£®



\ref{Modem} {(Éè¶¨ÄãµÄÊý¾Ý»ú¼°´®ÁÐ²º)} Ò»½ÚÌá¹©Õâ·½ÃæµÄ×ÊÑ¶£®




\subsection{½¨Á¢Ãû³Æµ½Î»Ö·½âÎö(DNS)}

³ýÁËÖ´ÐÐ PPP ¼°×Ô¶¯Ç©Èë PPP ËÅ·þÆ÷µÄµµ°¸Ö®Íâ£¬»¹ÓÐÒ»Ð©ÎÄ×ÖÅäÖÃµµ°¸±ØÐëÉè¶¨£¬
ÒÔ±ãÈÃÄãµÄµçÄÔÄÜ½«ÏñÕâÑùµÄÃû³Æ {\ttfamily www.interweft.com.au} ½âÎöÎª IP Î»Ö·ÒÔ±ãÕæÕýÓëÄÇÌ¨µçÄÔÁ¬Ïß£®
ÕâÐ©µµ°¸ÊÇ:-

\begin{itemize}
\item {\ttfamily /etc/resolv.conf}
\item {\ttfamily /etc/host.conf}
\end{itemize}




\ref{DNS} {(½¨Á¢Ãû³Æµ½Î»Ö·½âÎö)} Ò»½ÚÌá¹©Õâ·½ÃæµÄÉè¶¨Ï¸½Ú£®



ÌØ±ðµØ£¬Äã²¢{\bfseries ²»ÐèÒª}ÔÚÄãµÄ Linux PC ÉÏÖ´ÐÐÃû³ÆËÅ·þÆ÷ÒÔÁ¬½Óµ½Íø¼ÊÍøÂ·ÉÏ(ËäÈ»»òÐíÄã»áÏëÕâ÷á×ö)£®
ÄãËùÐèµÄÖ»ÊÇÖªµÀÖÁÉÙÒ»²¿ÄãÄÜÊ¹ÓÃµÄÃû³ÆËÅ·þÆ÷ IP Î»Ö·(×îºÃÊÇÄãµÄ ISP ËùÌá¹©µÄ)£®




\subsection{PPP Óë root È¨ÏÞ}

ÒòÎªÔÚÄãµÄ Linux µçÄÔÓëÁíÒ»¸ö PPP ËÅ·þÆ÷½¨Á¢Á¬½áÐèÒª²Ù×÷ÍøÂ·½çÃæ(PPP ½çÃæÊÇÒ»¸öÍøÂ·½çÃæ)ÓëºËÐÄµÄÂ·ÓÉ±í£¬pppd ÐèÒªÊ¹ÓÃ root µÄÈ¨ÏÞ£®



Ï¸½Ú²¿·Ý£¬²ÎÔÄ \ref{root} {(Ê¹ÓÃ PPP Óë root È¨ÏÞ)} Ò»½Ú£®




\subsection{¼ì²éÄãµÄ PPP Ì×¼þµµ°¸¼°Éè¶¨ PPP Ñ¡Ïî}

ÓÐºÃ¼¸¸öÅäÖÃ¼°²¦ºÅµµ°¸ÐèÒª½¨Á¢ÒÔ±ãÈÃ PPP ÔË×÷£®ÔÚ PPP Ì×¼þÖÐÓÐÒ»Ð©¡õÀý£¬¶ø±¾½Ú¸æËßÄãÓ¦ÓÐµÄÕâÐ©µµ°¸ÊÇÊ²÷á:-
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
/etc/ppp/options
/etc/ppp/scripts/ppp-on
/etc/ppp/scripts/ppp-on-dialer
/etc/ppp/options.tpl
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




¿´ÄãÏëÓÃ PPP ´ïµ½µÄÄ¿±êÊÇÊ²÷áÄã¿ÉÄÜÐèÒªÒ»Ð©¶îÍâµÄµµ°¸:-
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
/etc/ppp/options.ttyXX
/etc/ppp/ip-up
/etc/ppp/pap-secrets
/etc/ppp/chap-secrets
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




³ý´ËÖ®Íâ£¬PPP daemon ÓÐ´óÁ¿µÄÏßÉÏÑ¡Ïî£¬ÕýÈ·µØÊ¹ÓÃÊÇºÜÖØÒªµÄ;
Òò´Ë±¾½Ú´øÄã¿´ÕâÐ©±ê×¼ PPP Ñ¡Ïî²¢°ïÖúÄãÑ¡ÔñÄãÓ¦Ê¹ÓÃµÄÑ¡Ïî£®



Ï¸½Ú²¿·Ý£¬Çë²ÎÔÄ \ref{options} {(Éè¶¨ PPP Á¬½Óµµ°¸)} Ò»½Ú£®




\subsection{Èç¹ûÄãµÄ PPP ËÅ·þÆ÷Ê¹ÓÃ PAP ÈÏÖ¤(Password Authentication Protocol)}

Ðí¶à ISP ÉèÁ¢ PPP ËÅ·þÆ÷Ê¹ÓÃ PAP ÈÏÖ¤£®Èç¹ûÄãµÄËÅ·þÆ÷{\bfseries ²¢²»}Ê¹ÓÃ PAP
(Èç¹ûÄã¿ÉÒÔÓÃÊÖ¶¯Ç©Èë²¢ÊÕµ½±ê×¼µÄÊ¹ÓÃÕßÃû³Æ/ÃÜÂëÌáÊ¾·ûºÅÄÇ÷áËü²¢Î´Ê¹ÓÃ PAP)£¬ÄÇ÷áÄã¿ÉÒÔÌø¹ý´Ë½Ú£®



È¡´úÔÚ½øÈëËÅ·þÆ÷Ê±³öÏÖÌáÊ¾·ûºÅÊäÈëÊ¹ÓÃÕßÃû³Æ¼°ÃÜÂëµÄÊÇ£¬Ê¹ÓÃ PAP µÄ PPP ËÅ·þÆ÷²¢²»ÐèÒªÎÄ×ÖÄ£Ê½µÄÇ©Èë·½Ê½£®



Ê¹ÓÃÕßÈÏÖ¤ÊÇÁ¬½Ó¿ØÖÆÐ­¶¨(link control protocol, LCP)µÄÒ»²¿·Ý£¬ÔÚ½¨Á¢ PPP Á¬ÏßÖ®³õÆÚ½»»»µÄ×ÊÑ¶£®



\ref{pap} {(Èç¹ûÄãµÄ PPP ËÅ·þÆ÷Ê¹ÓÃ PAP ÈÏÖ¤(Password Authentication Protocol))} 
Ò»½ÚÌá¹©ÄãÊ¹ÓÃ PAP ½¨Á¢ PPP Á¬½áËùÐèµµ°¸µÄ×ÊÑ¶£®




\subsection{ÒÔÊÖ¶¯·½Ê½Á¬½ÓÖÁ PPP ËÅ·þÆ÷}

ÒÑ¾­½¨Á¢Íê»ù±¾µÄµµ°¸Ö®áá£¬Í¸¹ýÊÖ¶¯(Ê¹ÓÃ minicom »ò seyon)µÄ·½Ê½Á¬½Ó¼°Æô¶¯Äã Linux PC µÄ pppd À´²âÊÔÊÇ¸ö²»´íµÄÖ÷Òâ£®



²Î¼û \ref{manual} {(ÒÔÊÖ¶¯·½Ê½½¨Á¢ PPP Á¬½á)} ËµÃ÷Éè¶¨µÄÏ¸½Ú²¿·Ý£®




\subsection{Ê¹ÄãµÄ PPP Á¬½á×Ô¶¯»¯}

Ò»µ©Äã³É¹¦µØÓÃÊÖ¶¯·½Ê½Ç©Èë£¬Äã¿ÉÒÔÊÔÖø½¨Á¢Ò»Ö¸Áî¸åÒÔ×Ô¶¯½¨Á¢´ËÁ¬½á£®



\ref{automate} {(Ê¹ÄãµÄÁ¬½á×Ô¶¯»¯ - ´´ÔìÁ¬½áÖ¸Áî¸å)}
Ò»½Ú°üº¬ÁË½¨Á¢ËùÐèµÄÖ¸Áî¸å£¬ÒÔ¼°Ïàµ±¶àµÄ×¢ÒâÁ¦¼¯ÖÐÔÚ {\ttfamily chat} ÃüÁîì¶ PPP ËÅ·þÆ÷µÄÇ©Èë¹ý³Ì£®  



Õâ½ÚÒ²ÌÖÂÛÁËÊ¹ÓÃÖ¸Áî¸åì¶ PAP/CHAP ÈÏÖ¤µÄËÅ·þÆ÷ÉÏ£®




\subsection{½áÊøÁ¬½á}

Ò»µ©ÄãµÄÁ¬½áÄÜ¹»½¨Á¢²¢Õý³£Õý×÷£¬Äã±ØÐèÄÜ¹»½áÊøÁ¬½á£®



ÕâÔÚ \ref{off} {(½áÊø PPP Á¬½á)} Ò»½ÚËµÃ÷£®




\subsection{Èç¹ûÄãÔâÓöÎÊÌâ}

Ðí¶àÈËÎÞ·¨ÈÃ PPP Õý³£µØ¹¤×÷£®PPP ËÅ·þÆ÷µÄÖÖÀàÒÔ¼°ºÍËüÃÇ½¨Á¢Á¬ÏßµÄ·½·¨ÓÐ·Ç³£¶àÖÖ£®
ÀàËÆµØ£¬PPP ÓÐÐí¶àµÄÑ¡Ïî - ¶øÓÐÐ©Ñ¡ÏîÊÇ²»ÄÜÒ»ÆðÓÃµÄ£®



³ýÁËÇ©Èë²¢ÆðÊ¼ PPP ·þÎñµÄÎÊÌâÖ®Íâ£¬Êý¾Ý»ú±¾Éí¼°µç»°ÏßÂ·Ò²¿ÉÄÜ»áÓÐÎÊÌâ£®



\ref{problems} {(½â¾öÎÊÌâ)} Ò»½ÚÌá¹©Ò»°ã´íÎóµÄ»ù±¾×ÊÑ¶£¬ÒÔ¼°ÈçºÎ·ÖÀë²¢½â¾öµÄ·½·¨£®



ÕâÀïÌá¹©µÄ{\bfseries ²»¹ý}ÊÇ»ù±¾µÄ×ÊÑ¶£®Al Longyear ËùÎ¬»¤µÄ PPP-FAQ °üº¬ÁË¸ü¶àÕâÒ»·½ÃæµÄ×ÊÑ¶!




\subsection{½¨Á¢Á¬½áÖ®áá}

Ò»µ© PPP Á¬½á¿ÉÒÔÔË×÷ÁË(ÌØ±ðµØ£¬Ò»µ© IP ²ã¿ÉÒÔÔË×÷)£¬Linux µÄ PPP ¿ÉÒÔ×Ô¶¯Ö´ÐÐ(ÒÔ root Éí·Ý)Ò»Ö¸Áî¸åÍê³É{\bfseries ÈÎºÎ}ÄãÏë´ï³ÉµÄ¹¦ÄÜ£®



\ref{ip-up} {(½¨Á¢Á¬½áÖ®áá)} Ò»½ÚÌá¹© {\ttfamily /etc/ppp/ip-up} Ö¸Áî¸åµÄ×ÊÑ¶£¬
ËüÈçºÎ½ÓÊÕ PPP ´«À´µÄ²ÎÊýÒÔ¼°ÈçºÎÀûÓÃËüÀ´×öÒ»Ð©Ïñ×Ô ISP È¡»ØÄãµÄµç×ÓÓÊ¼þ£¬
ËÍ³öÔÚÄã»úÆ÷ØùÁÐÖÐ´æ·ÅµÄÓÊ¼þµÈµÈ¹¤×÷£®




\subsection{¶¯Ì¬ IP Á¬½ÓÌá¹©±ê×¼ IP ·þÎñµÄÎÊÌâ}

¾ÍÏñÔÚ¼ò½éÒ»½ÚÀïÖ¸³öµÄ£¬¶¯Ì¬ IP ºÅÂëÓ°ÏìÄãµÄ Linux PC ×÷ÎªÍø¼ÊÍøÂ·ËÅ·þÆ÷µÄÄÜÁ¦£®



\ref{dynamic-server} {(¶¯Ì¬ IP Á¬½ÓÌá¹©±ê×¼ IP ·þÎñµÄÎÊÌâ)}
Ò»½ÚÌá¹©(Ö÷Òª)ÊÜÓ°ÏìµÄ·þÎñÒÔ¼°ÄãËùÄÜ×ö(Èç¹ûÓÐµÄ»°)µÄ¿Ë·þ°ì·¨£®




\section{ÅäÖÃÄãµÄ Linux ºËÐÄ\label{Kernel configuration}}

ÎªÁËÒªÄÜ¹»Ê¹ÓÃ PPP£¬Äã±àÒëµÄ Linux  ºËÐÄ±ØÐë°üº¬ PPP µÄÖ§Ô®£®
Èç¹ûÄã»¹Ã»ÓÐ Linux  µÄÔ­Ê¼³ÌÊ½ÂëÇëÏÈÈ¡µÃ £­ ÔÚ Linux  µÄµµ°¸ÏµÍ³±ê×¼ÖÐËüÊÇ·ÅÔÚ {\ttfamily /usr/src/linux} ÀïÃæ£®



¼ì²éÕâ¸öÄ¿Â¼ - Ðí¶àµÄ Linux Ì×¼þ»áÔÚ°²×°¹ý³ÌÖÐ°²×°´ËÔ­Ê¼³ÌÊ½Âë(µµ°¸¼°´ÎÄ¿Â¼)£®



ÔÚÆô¶¯Ê±£¬ÄãµÄ Linux ºËÐÄ»áÓ¡³ö´óÁ¿µÄÑ¶Ï¢£®Èç¹ûºËÐÄÖ§Ô® PPP µÄ»°»á°üº¬´ËÒ»Ñ¶Ï¢£®
Òª¹Û¿´ÕâÐ©Ñ¶Ï¢µÄ»°£¬¿´¿´ÄãµÄÏµÍ³¼ÇÂ¼µµ»òÓÃ {\ttfamily dmesg $|$ less} Ö¸Áî½«ÕâÐ©Ñ¶Ï¢ÏÔÊ¾ÔÚÓ©Ä»ÉÏ£®
Èç¹ûºËÐÄÖ§Ô® PPP µÄ»°Äã½«»á¿´µ½ÏñÕâÑùµÄ¼¸ÐÐ
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
PPP Dynamic channel allocation code copyright 1995 Caldera, Inc.
PPP line discipline registered.
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




(ÕâÊÇ Linux 2.0.x ÏµÁÐºËÐÄµÄÑ¶Ï¢)£®



Linux ºËÐÄµÄÔ­Ê¼³ÌÊ½¿ÉÒÔ´Ó {\ttfamily sunsite.unc.edu} »òÆäÓ³Éä½ÚµãÈ¡µÃ£®




\subsection{°²×° Linux ºËÐÄÔ­Ê¼³ÌÊ½Âë}

ÏÂÃæÊÇ¼ò¶ÌµÄÈ¡µÃ¼°°²×° Linux ºËÐÄÔ­Ê¼³ÌÊ½ÂëµÄÖ¸Ê¾£®ÏêÏ¸µÄ×ÊÑ¶¿ÉÒÔÔÚ \nameurl{Kernel-HOWTO.html}{The Linux Kernel HOWTO} ÖÐÕÒµ½£®





ÎªÁË°²×°¼°±àÒëºËÐÄ£¬Äã±ØÐëÒÔ root µÄÉí·ÝÇ©Èë£®

\begin{enumerate}
\item ÇÐ»»µ½ {\ttfamily /usr/src} Ä¿Â¼ÏÂ\\ 
{\ttfamily cd /usr/src}
\item ¼ì²é {\ttfamily /usr/src/linux} ¿´¿´ÄãÊÇ·ñÒÑ¾­°²×°ÁËÔ­Ê¼³ÌÊ½Âë£®
\item Èç¹ûÃ»ÓÐµÄ»°£¬ÓÉ \nameurl{ftp://sunsite.unc.edu/pub/Linux/kernel/v2.0}{Linux kernel source directory}
»òÀëÄã×î½üµÄÓ³Éä½ÚµãÈ¡»Ø£®\\ 
Èç¹ûÄãÏëÕÒ¸ü¾É°æ±¾µÄºËÐÄ(ÀýÈç 1.2.X)£¬¿Éµ½ \nameurl{ftp://sunsite.unc.edu/pub/Linux/kernel/old}{Old Linux kernel source directory} ÕÒÕÒ£®
\item Ñ¡ÔñÊÊµ±µÄºËÐÄ - Í¨³£ÊÇ×î½üµÄ°æ±¾£®È¡»Øáá½«´Ë 'tar' Ñ¹Ëõµµ·ÅÔÚ {\ttfamily /usr/src}£®\\ 
{\bfseries ×¢Òâ}: Ò»¸ö 'tar' µµ°¸ÊÇÒ»ÖÖÑ¹Ëõµµ - ¿ÉÄÜÑ¹ÁËÐí¶àµµ°¸ºÍÄ¿Â¼ÔÚÀïÍ·£®ËüÏàµ±ì¶ DOS ÏÂµÄ zip µµ°¸£®
\item Èç¹ûÄãÒÑ¾­°²×°ÁËÔ­Ê¼³ÌÊ½£¬µ«ÏëÒªÉý¼¶µ½ÐÂ°æµÄºËÐÄ£¬Äã±ØÐëÏÈÒÆ³ý¾ÉµÄ³ÌÊ½Âë£®ÓÃÕâ¸öÖ¸Áî\\ 
{\ttfamily rm -rf /usr/src/linux}
\item ÓÃÕâ¸öÖ¸Áî½âÑ¹Ëõ\\ 
{\ttfamily tar xzf linux-2.0.XX.tar.gz}
\item È»áá£¬{\ttfamily cd /usr/src/linux} ²¢¿´¿´ README µµ£®ÀïÍ·°üº¬ÁËÍêÕûµÄ½âÊÍÈçºÎÅäÖÃ¼°±àÒëÐÂºËÐÄ£®
×ÐÏ¸ÔÄ¶ÁÕâ¸öµµ°¸(½«ËüÓ¡³öÀ´·ÅÔÚÊÖ±ßÊÇ¸öºÃÖ÷Òâ£¬Ö±µ½ÄãÒÑ×öÁË×ã¹»¶à´ÎÖªµÀÔõ÷á°ì)£®
\end{enumerate}





\subsection{¡õ½âÄãµÄÓ²Ìå}

Èç¹ûÄãÒªÖØÐÂ±àÒëÄãµÄºËÐÄÄã{\bfseries ±ØÐë}ÖªµÀÔÚÄã PC ÀïÃæµÄ½çÃæ¿¨£¯Éè±¸!!
¶Ôì¶Ä³Ð©Éè±¸£¨ÏñÊÇÒôÐ§¿¨£©ÄãÒ²µÃÖªµÀ¸÷ÖÖÉè¶¨£¨ÏñÊÇÓ²ÌåÖÐ¶ÏºÅÂë£¬Êä³öÈëÎ»Ö·ÒÔ¼°ÖîÈç´ËÀàµÄ×ÊÑ¶£©£®




\subsection{±àÒëºËÐÄ £­ Linux 1.2.13 ºËÐÄ}

Òª¿ªÊ¼ÅäÖÃ³ÌÐò£¬Ê×ÏÈÒÀÕÕÔÚ½âËµµµÀïµÄËµÃ÷ÊÊµ±µØ°²×°Ô­Ê¼³ÌÊ½Âë£®È»ááÒÔÏÂÃæµÄÖ¸Áî¿ªÊ¼ºËÐÄµÄÅäÖÃ³ÌÐò
\begin{tscreen}
\begin{verbatim}
make config
\end{verbatim}
\end{tscreen}




ÎªÁËÒªÄÜ¹»Ê¹ÓÃ PPP  £¬Äã±ØÐëÅäÖÃºËÐÄ°üº¬ PPP  µÄÖ§Ô®£¨Ê¹ÓÃ PPP ÐèÒª pppd ÒÔ¼°ºËÐÄµÄ PPP Ö§Ô®Á½Õß£©£®
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
  PPP (point-to-point) support (CONFIG_PPP) [n] y
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




¸ù¾ÝÔÚÄã PC ÀïÃæµÄÓ²ÌåÒÔ¼°ÄãÏëÒªµÄ Linux  ×÷ÒµÏµÍ³ÌØÉ«»Ø´ðÆäËüµÄÅäÖÃÎÊÌâ£®È»áá¼ÌÐøÒÀÕÕ¸Ã½âËµµµÀ´±àÒë²¢°²×°ÄãµÄÐÂºËÐÄ£®



ºËÐÄ 1.2.13 Ö»ÒªÖÆÔìËÄ¸ö PPP ×°ÖÃ£®¶Ôì¶¶à²º¿¨(multi-port serial cards)À´Ëµ£¬Äã±ØÐëÐÞ¸ÄºËÐÄ PPP µÄÔ­Ê¼³ÌÊ½ÒÔ±ãµÃµ½¸ü¶à²ºµÄÖ§Ô®£®
(²Î¼ûËæ¸½ PPP-2.1.2 Ì×¼þ¶øÀ´µÄ README.linux µµ°¸ËµÃ÷ÄãÐèÒª×öµÄÏ¸½Ú²¿·Ý)£®



×¢Òâ: ºËÐÄ 1.2.13 µÄÅäÖÃ¶Ô»°²»ÔÊÐíÄã»ØÍ· - Òò´ËÈç¹ûÄãÔÚ {\ttfamily make config} ¶Ô»°ÖÐ´ð´íÎÊÌâ£¬ÓÃ {\ttfamily CTRL-C} Ìø³öÀ´ÖØÐÂ¿ªÊ¼£®




\subsection{±àÒëºËÐÄ  - Linux 1.3.x ¼° 2.0.x ºËÐÄ}

¶Ôì¶ Linux 2.0.x  µÄºËÐÄ£¬Äã¿ÉÒÔÊ¹ÓÃÀàËÆ Linux 1.2.13 µÄ³ÌÐò£®
ÔÙÒ»´Î£¬ÒÀÕÕÔÚ½âËµµµÀïµÄËµÃ÷ÊÊµ±µØ°²×°Ô­Ê¼³ÌÊ½Âë£®È»ááÒÔÏÂÃæµÄÖ¸Áî¿ªÊ¼ºËÐÄµÄÅäÖÃ³ÌÐò
\begin{tscreen}
\begin{verbatim}
make config
\end{verbatim}
\end{tscreen}




È»¶ø£¬ÄãÒ²ÓÐÁíÍâµÄÑ¡Ôñ
\begin{tscreen}
\begin{verbatim}
make menuconfig
\end{verbatim}
\end{tscreen}




ÕâÌá¹©Ò»¸öÒÔÑ¡µ¥Îª»ù´¡ÅäºÏÏßÉÏ¸¨ÖúµÄÅäÖÃÏµÍ³£¬ÔÊÐíÄãÔÚÅäÖÃ³ÌÐòÖÐËæÒâËùÖ®£®



Ò²ÓÐÒ»¸öÒÔ X windows  Îª»ù´¡µÄÅäÖÃ½çÃæ
\begin{tscreen}
\begin{verbatim}
make xconfig
\end{verbatim}
\end{tscreen}




Äã¿ÉÒÔÖ±½Ó±àÒë PPP  µÄÖ§Ô®µ½ºËÐÄÀïÈ¥»òÕßÊÇ×ö³É¿ÉÔØÈëÄ£×é£®

Èç¹ûÄãÖ»ÔÚÄã Linux  »úÆ÷ÔË×÷µÄÒ»²¿·ÝÊ±¼äÀïÊ¹ÓÃ PPP  µÄ»°£¬ÄÇ÷á½¨ÒéÄã°Ñ PPP  µÄÖ§Ô®±àÒëÎª¿ÉÔØÈëÄ£×é£®
Ê¹ÓÃ 'kerneld'£¬ÄãµÄºËÐÄ½«»áÔÚÄã¿ªÊ¼ÄãµÄ PPP  Á¬½á³ÌÐòÊ±×Ô¶¯ÔØÈëÌá¹© PPP  Ö§Ô®ËùÐèµÄÄ£×é£®
Õâ½ÚÊ¡ÁË±¦¹óµÄ¼ÇÒäÌå¿Õ¼ä£¨ÒòÎªºËÐÄÃ»ÓÐÈÎºÎÒ»¸ö²¿·Ý¿ÉÒÔ±»ÖÃ»»µ½¼ÇÒäÌåÍâ£¬µ«¿ÉÔØÈëÄ£×éÔÚÎ´Ê¹ÓÃÊ±»á×Ô¶¯±»ÒÆ³ý£©£®



ÒªÕâÑù×öµÄ»°£¬ÄãÐèÒª´ò¿ª¿ÉÔØÈëÄ£×éµÄÖ§Ô®:
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
        Enable loadable module support (CONFIG_MODULES) [Y/n/?] y
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


Òª¼ÓÈë PPP  µÄºËÐÄÖ§Ô®£¬»Ø´ðÏÂÁÐÕâ¸öÎÊÌâ:-
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
        PPP (point-to-point) support (CONFIG_PPP) [M/n/y/?]  
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




Òª×ö³É¿ÉÔØÈëÄ£×éµÄ»°£¬»Ø´ð {\bfseries M} ¼´¿É£¬·ñÔò¾Í±àÒë³ÉºËÐÄµÄÒ»²¿·Ý£¬»Ø´ð {\bfseries Y} ¾ÍÊÇ£®



Óë 1.2.13 µÄºËÐÄ²»Í¬µÄÊÇ£¬2.0.x µÄºËÐÄÊÓÐèÒª×Ô¶¯½¨Á¢ PPP  Éè±¸²¢ÇÒÒ»µã¶¼²»ÐèÒªÈ¥ÑÐ¾¿Ô­Ê¼³ÌÊ½ÂëÒÔÔö¼Ó¿ÉÓÃµÄ PPP  Éè±¸£®




\subsection{PPP-2.2 Óë {\ttfamily /proc/net/dev} µÄ×¢ÒâÊÂÏî}

Èç¹ûÄãÔÚÊ¹ÓÃ PPP-2.2£¬Äã»á·¢ÏÖ½¨Á¢ PPP ×°ÖÃµÄÒ»¸ö¸±×÷ÓÃ¾ÍÊÇÈç¹ûÄã¹Û²ì {\ttfamily /proc/net} µµ°¸ÏµÍ³¿´²»µ½ PPP µÄ×°ÖÃ£¬
Ö±µ½¿ªÊ¼Ê¹ÓÃ pppd ×°ÖÃ²Å»á±»½¨Á¢ÆðÀ´:-
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
[hartr@archenland hartr]$ cat /proc/net/dev
Inter-|   Receive                  |  Transmit
 face |packets errs drop fifo frame|packets errs drop fifo colls carrier
    lo:  92792    0    0    0    0    92792    0    0    0     0    0
  eth0: 621737   13   13    0   23   501621    0    0    0  1309    0
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




Ò»µ©ÄãÓÐÒ»¸ö(»ò¸ü¶à) PPP ·þÎñÆô¶¯áá£¬Äã»á¿´µ½ÏñÕâÑùµÄÏîÄ¿(´ÓÒ»²¿ PPP ËÅ·þÆ÷ÉÏÈ¡µÃ):-
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
[root@kepler /root]# cat /proc/net/dev
Inter-|   Receive                  |  Transmit
 face |packets errs drop fifo frame|packets errs drop fifo colls carrier
    lo: 428021    0    0    0    0   428021    0    0    0     0    0
  eth0:4788257  648  648  319  650  1423836    0    0    0  4623    5
  ppp0:   2103    3    3    0    0     2017    0    0    0     0    0
  ppp1:  10008    0    0    0    0     8782    0    0    0     0    0
  ppp2:    305    0    0    0    0      297    0    0    0     0    0
  ppp3:   6720    7    7    0    0     7498    0    0    0     0    0
  ppp4: 118231  725  725    0    0   117791    0    0    0     0    0
  ppp5:  38915    5    5    0    0    28309    0    0    0     0    0
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}





\subsection{ÅäÖÃºËÐÄµÄÒ»°ã¿¼Á¿}

Èç¹ûÄãÒª°ÑÄãµÄ Linux PC ÉèÎªÒ»Ì¨ PPP  ËÅ·þÆ÷µÄ»°£¬ÄÇ÷áÄã±ØÐë°Ñ IP forwarding µÄÖ§Ô®±àÒë½øÈ¥£®
Èç¹ûÄãÏëÊ¹ÓÃ Linux Á¬½ÓÁ½¸öÇøÓòÍøÂ·»ò½«ÇøÓòÍøÂ·Á¬½Óµ½Íø¼ÊÍøÂ·ÉÏµÄ»°Õâ¸öÑ¡ÏîÒ²ÊÇÐèÒªµÄ£®



Èç¹ûÄãÒªÁ¬½ÓÒ»¸öÇøÓòÍøÂ·µ½Íø¼ÊÍøÂ·ÉÏ£¨»òÕßÉõÖÁÖ»ÊÇÁ¬½ÓÁ½¸öÇøÓòÍøÂ·£©£¬ÄãÓ¦¸ÃÒª¹ØÐÄ°²È«ÉÏµÄÎÊÌâ£®ÔÚºËÐÄÖÐ¼ÓÈë IP firewalls µÄÖ§Ô®¿ÉÄÜÊÇ±ØÐëµÄ!



Èç¹ûÄãÏëÒªÓÃ IP Î±×°Á¬½ÓÊ¹ÓÃÇ°ÊöÈÎºÎÒ»¸ö¡®Î´Á¬Ïß¡¯IP  ÍøÂ·ºÅÂëµÄÇøÓòÍøÂ·ÄÇ÷áÄãÒ²ÐèÒªÕâ¸öÅäÖÃ£®



ÒªÊ¹ÓÃ IP Î±×°Óë IP firewalling£¬Äã{\bfseries ±ØÐë}ÔÚ {\ttfamily make config} ¹ý³ÌÖÐµÄµÚÒ»¸öÎÊÌâÉÏ»Ø´ð yes:-
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
Prompt for development and/or incomplete code/drivers (CONFIG_EXPERIMENTAL)?
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ËäÈ»ÕâÌýÆðÀ´¶ÔÐÂÊ¹ÓÃÕßÓÐÐ©À§ÄÑ£¬Ðí¶àÈËÈÔÓä¿ìµØÊ¹ÓÃ Linux 2.0.X ºËÐÄµÄ IP Î±×°Óë IP firewalling ¹¦ÄÜ¶øÃ»ÓÐÎÊÌâ£®



Ò»µ©ÄãÍê³ÉÐÂºËÐÄµÄ°²×°ÒÔ¼°ÖØÐÂÆô¶¯Ö®áá£¬Äã¾Í¿ÉÒÔ¿ªÊ¼ÅäÖÃ²¢²âÊÔÄãµÄ PPP Á¬½á£®




\section{È¡µÃÄãËùÐèµÄ PPP ËÅ·þÆ÷×ÊÑ¶\label{Server info}}

ÔÚÄã¿ÉÒÔ½¨Á¢µ½Ä³Ì¨ËÅ·þÆ÷µÄ PPP  Á¬ÏßÖ®Ç°£¬ÄãÐèÒªÈ¡µÃÏÂÁÐµÄ×ÊÑ¶£¨´Ó PPP  ËÅ·þÆ÷µÄÏµÍ³¹ÜÀí£¯Ê¹ÓÃÕßÖ§Ô®ÈËÔ±È¡µÃ£©:-
\begin{itemize}
\item ²¦½Ó·þÎñµÄµç»°ºÅÂë\\ 
Èç¹ûÄãÊÇÔÚË½ÓÃ½»»»»ú(PABX)ÏµÍ³ÏÂ£¬Äã»¹ÐèÒª²¦³öÍâÏßÐÅºÅµÄË½ÓÃ½»»»»úºÅÂë £­ Í¨³£ÊÇ 0 »ò 9£®
\item ËÅ·þÆ÷Ê¹ÓÃ¶¯Ì¬»ò¾²Ì¬µÄ IP ºÅÂë?\\ 
Èç¹ûËÅ·þÆ÷Ê¹ÓÃ¾²Ì¬µÄ IP ºÅÂë£¬ÄÇ÷áÄãÐèÒªÖªµÀÔÚ PPP  Á¬ÏßÖÐÄãÕâ¶ËÒªÊ¹ÓÃÄÄ¸ö IP ºÅÂë£®
Èç¹ûÄãµÄ ISP Ìá¹©ÄãÒ»ºÏ·¨ IP ºÅÂëµÄ´ÎÍøÂ·£¬ÄãÐèÒªÖªµÀÄãÄÜÊ¹ÓÃµÄ IP ºÅÂë¼°ÍøÂ·ÕÚÕÖ£®\\ 

´ó²¿·ÖµÄÍø¼ÊÍøÂ··þÎñÌá¹©Õß¶¼Ê¹ÓÃ¶¯Ì¬µÄ IP ºÅÂë£®ÈçÇ°Êö£¬Õâ¶Ôì¶Äã¿ÉÒÔÊ¹ÓÃµÄ·þÎñ»áÓÐÐ©ÏÞÖÆ£®\\ 

È»¶ø£¬¼´Ê¹ÄãÊ¹ÓÃ¾²Ì¬µÄ IP ºÅÂë£¬´ó²¿·ÝµÄ PPP ËÅ·þÆ÷Ò²²»ÔÊÐí(ÎªÁË°²È«ÀíÓÉ)¿Í»§¶Ë×ÔÐÐÖ¸¶¨ IP ºÅÂë£¬ÒòÎªÕâÓÐ°²È«·çÏÕ£®
ÄãÈÔÈ»{\bfseries ±ØÐë}ÖªµÀÕâÐ©×ÊÑ¶£®
\item ISP µÄÁìÓòÃû³ÆËÅ·þÆ÷ IP ºÅÂëÊÇÊ²÷á?\\ 
ËäÈ»Ö»ÐèÒªÒ»¸öµ«×îÉÙÓ¦¸ÃµÃÒªÓÐÁ½¸ö£®\\ 

ÕâÀï¿ÉÄÜ»áÓÐÒ»¸öÎÊÌâ£®Î¢ÈíµÄ Windows 95 PPP Éè¶¨ÔÊÐíÈÃ DNS µÄµØÖ·ÔÚÁ¬Ïß¹ý³ÌÖÐ´«µ½¿Í»§¶Ë£®
Òò´ËÄãµÄ ISP (»ò¹«Ë¾µÄÚÑÑ¯ÊÒ)¿ÉÄÜ»á¸æËßÄã²»ÐèÒªÖªµÀ DNS ËÅ·þÆ÷µÄ IP Î»Ö·£®\\ 

¶Ôì¶ Linux À´Ëµ£¬Äã{\bfseries ±ØÐë}ÖÁÉÙÖªµÀÒ»¸ö DNS µÄÎ»Ö·£®
Ä¿Ç° Linux µÄ PPP Êµ×÷ÖÐ²»ÔÊÐíÔÚÁ¬Á¢Á¬ÏßÖ®Ê±¶¯Ì¬µØÖ¸¶¨ DNS µÄ IP ºÅÂë - ºÜ¿ÉÄÜ½«À´Ò²²»»á£®\\ 

{\bfseries ×¢Òâ}: ËäÈ»£¬Linux (×÷Îª PPP µÄ¿Í»§¶Ë)²»ÄÜ´ÓËÅ·þÆ÷ÖÐ½ÓÊÜ DNS µÄÎ»Ö·£¬È»¶ø£¬×÷Îª PPP ËÅ·þÆ÷Ê±£¬
Ëü¿ÉÒÔÓÃ pppd µÄÑ¡Ïî {\ttfamily dns-addr} Îª¿Í»§¶ËÖ¸¶¨Õâ¸ö×ÊÑ¶£®
\item ¸ÃËÅ·þÆ÷ÊÇ·ñÐèÒªÊ¹ÓÃ PAP/CHAP?\\ 
Èç¹ûÊÇÕâÑùÄãÐèÒªÖªµÀÄãÓÃÀ´Á¬Ïß "id" ÒÔ¼° "secret" £®£¨Õâ´ó¸Å»áÊÇÄãµÄÔÚÕâ¸ö ISP µÄÊ¹ÓÃÕßÃû³ÆÒÔ¼°ÃÜÂë£©£®
\item ËÅ·þÆ÷»á×Ô¶¯Æð¶¯ PPP  »òÕßÔÚÒ»µ©ÄãÇ©ÈëÖ®ááÐèÒª·¢³öÈÎºÎÖ¸ÁîÀ´Æð¶¯ËÅ·þ¶ËµÄ PPP?\\ 
Èç¹ûÄã±ØÐëÏÂÄ³¸öÖ¸ÁîÀ´Æð¶¯ PPP  µÄ»°£¬ËüÊÇÊ²÷á?
\item Èç¹ûËÅ·þÆ÷ÊÇÎ¢ÈíµÄ Windows NT ÏµÍ³£¬ËüÊÇ·ñÊ¹ÓÃÎ¢ÈíµÄ PAP/CHAP ÏµÍ³?\\ 
Ðí¶à¹«Ë¾µÄÇøÓòÍøÂ·ËÆºõÊÇÊ¹ÓÃ Windows NT µÄÏµÍ³ÒÔÔö¼Ó°²È«ÐÔ£®
\end{itemize}




×ÐÏ¸µØ×¢ÒâÕâÐ©×ÊÑ¶ £­ ÄãÂíÉÏÒªÊ¹ÓÃËüÃÇ!




\section{Éè¶¨ÄãµÄÊý¾Ý»ú¼°´®ÁÐ²º\label{Modem}}

ÄãÓ¦¸ÃÈ·ÈÏÄãµÄÊý¾Ý»úÉè¶¨ÕýÈ·¶øÇÒÄãÖªµÀËüÁ¬½Óµ½ÄÄ¸ö´®ÁÐ²º£®



{\bfseries ½÷¼Ç}:-
\begin{itemize}
\item DOS com1: = Linux /dev/cua0 (and /dev/ttyS0)
\item DOS com2: = Linux /dev/cua1 (and /dev/ttyS1)\\ 
µÈµÈ
\end{itemize}




»¹ÒªÌáÐÑÄã¾ÍÊÇÈç¹ûÄãÓÐËÄ¸ö´®ÁÐ²º£¬±ê×¼ PC ÉÏÈÃ com1 Óë com3 ¹²ÓÃ IRQ4 ÇÒÈÃ com2 Óë com4 ¹²ÓÃ IRQ3£®



Èç¹ûÄãÓÐÆäËü»ú×°ÖÃºÍ´®ÁÐ²º¹²ÓÃÒ»¸ö IRQ µÄ»°¿ÉÄÜ»áÓÐÎÊÌâ£®
Äã±ØÐëÈ·¶¨ÄãµÄÊý¾Ý»ú´®ÁÐ²ºÓµÓÐËü×Ô¼º£¬Î¨Ò»µÄÒ»¸ö IRQ£®Ðí¶àÏÖÔÚµÄ´®ÁÐ²º¿¨(ÓëÆ·ÖÊ½Ï¼ÑµÄÖ÷»ú°åÉÏµÄ´®ÁÐ²º)ÔÊÐíÄã½«´®ÁÐ²ºÉÏµÄ IRQ ÒÆ¿ª£®



Èç¹ûÄãÔÚÓÃ Linux 2.0.X ºËÐÄ£¬Äã¿ÉÒÔÓÃ {\ttfamily cat /proc/interrupts} ¼ì²éÊ¹ÓÃÖÐµÄ IRQ£¬Äã»á¿´µ½ÏñÕâÑùµÄÊä³ö½á¹û
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
 0:    6766283   timer
 1:      91545   keyboard
 2:          0   cascade
 4:     156944 + serial
 7:     101764   WD8013
10:     134365 + BusLogic BT-958
13:          1   math error
15:    3671702 + serial
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ÕâÀïÏÔÊ¾ÁËÒ»¸ö´®ÁÐ²ºÔÚ IRQ4 (Ò»¸ö»¬Êó)ÓëÒ»¸ö´®ÁÐ²ºÔÚ IRQ15£®
(Ò²ÓÐÒ»´®ÁÐ²ºÔÚ com2, IRQ3 Óë com4 ÊÇÔÚ IRQ14£¬µ«²¢Î´Ê¹ÓÃ£¬Ã»ÓÐÏÔÊ¾³öÀ´)£®



ÇëÐ¡ÐÄ - Èç¹ûÄãÒªµ÷ÄãµÄ IRQ µÄ»°ÄãÒªÈ·ÊµÖªµÀÄãÔÚ×öÐ©Ê²÷á! Äã²»Ö»ÐèÒª´ò¿ªÄãµÄµçÄÔÍâ¿Ç£¬½«½çÃæ¿¨°ÎÏÂ²¢µ÷Õû jumper£¬Äã»¹ÐèÒªÖªµÀÄÇ¸öÕ¼ÓÃÊ²÷á IRQ£®
ÒÔÎÒµÄÀý×ÓÀ´Ëµ£¬ÕâÍêÈ«ÊÇÒÔ SCSI ÎªÖ÷µÄ PC£¬Òò´ËÎÒ½«Ö÷»ú°åÉÏµÄÍ¨³£»áÕ¼ÓÃ IRQ14 Óë 15 µÄ IDE ½çÃæ¹Øµô£®



Äã»¹ÐèÒª×¢ÒâÈç¹ûÄãµÄ PC »¹ÅÜÁËÆäËüµÄ×÷ÒµÏµÍ³£¬¸ü¶¯ IRQ µÄÎ»Ö·¿ÉÄÜÊ¹ÄÇ¸ö×÷ÒµÏµÍ³Æô¶¯²»Õý³££¬»ò¸ù±¾¿ª²»ÁË»ú!



Èç¹ûÕæµÄ½«´®ÁÐ²ºÒÆµ½ÁË·Ç±ê×¼µÄ IRQ£¬ÄÇ÷áÄãÐèÒª¸æËß Linux Ã¿Ò»¸ö²ºËùÓÃµÄ IRQ Î»Ö·£®
Õâ¿ÉÒÔÓÃ {\ttfamily setserial} Ö¸Áî´ï³É£¬¶øÇÒ×îºÃ½«Ëü·Åµ½ {\ttfamily rc.local}£¬»òÔÚ SysV ÏµÍ³ÖÐÓÉ {\ttfamily rc.local} Ëùºô½ÐµÄ {\ttfamily rc.serial} ÀïÃæ³ÉÎª¿ª»ú¹ý³ÌµÄÒ»²¿·Ý£®
ÒÔÎÒÉÏÃæËùÁÐµÄ»úÆ÷À´Ëµ£¬ÓÃÕâÑùµÄÖ¸Áî
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
/bin/setserial -b /dev/ttyS2 IRQ 11
/bin/setserial -b /dev/ttyS3 IRQ 15
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




È»¶ø£¬Èç¹ûÄãÊ¹ÓÃÓÉ {\ttfamily kerneld} ÐÐ³ÌËù¸ºÔðµÄ¶¯Ì¬ÔØÈë´®ÁÐÄ£×é£¬Äã²»ÄÜÏñÕâÑùÃ¿´Î¿ª»úÊ±Éè¶¨Ò»´Î IRQ áá¾Í°ÑËüÍüÁË£®
ÕâÊÇÒòÎªÈç¹û´®ÁÐÄ£×é±»ÒÆ³ý£¬Linux ¾Í»áÍüÁËÕâÐ©ÌØÊâµÄÉè¶¨£®



Òò´Ë£¬Èç¹ûÄãÒÔ¶¯Ì¬·½Ê½ÔØÈë´®ÁÐÄ£×é£¬Äã±ØÐëÒªÔÚÃ¿ÈëÔØÈëÄ£×éÊ±ÖØÐÂÉè¶¨ IRQ ²ÅÐÐ£®




\subsection{´®ÁÐ²ºÓëËÙ¶ÈÏàÈÝÐÔµÄ×¢ÒâÊÂÏî}

Èç¹ûÄãÊ¹ÓÃ¸ßËÙ(Íâ½ÓÊ½)Êý¾Ý»ú(14,400 baud »ò¸ü¸ß)£¬ÄãµÄ´®ÁÐ²ºËÙ¶È±ØÐëÄÜ¹»´¦ÀíÕâÖÖÊý¾Ý»úËù²úÉúµÄ×ÊÁÏÁ¿£¬ÌØÔÚÊÇµ±Êý¾Ý»úÔÚÑ¹Ëõ×ÊÁÏÊ±£®



ÄãµÄ´®ÁÐ²ºÐèÒªÒ»ÖÖÐÂÐÍµÄ UART (Universal Asynchronous Receiver Transmitter)£¬ÏñÊÇ 16550(A)£®
Èç¹ûÄãÔÚÊ¹ÓÃÒ»²¿¾ÉµÄ»úÆ÷(»ò¾ÉµÄ´®ÁÐ¿¨)£¬ºÜ¿ÉÄÜ´®ÁÐ²ºÉÏÖ»ÓÐ¾ÉµÄ 8250 UART£¬ÕâÔÚÄãÊ¹ÓÃ¸ßËÙÊý¾Ý»úÊ±¿ÉÄÜ»á·¢ÉúÎÊÌâ£®



Ê¹ÓÃÕâ¸öÖ¸Áî
\begin{tscreen}
\begin{verbatim}
setserial -a /dev/ttySx
\end{verbatim}
\end{tscreen}




ÈÃ Linux »Ø±¨ÄãÊ¹ÓÃµÄ UART ÀàÐÍ£®Èç¹ûÄãÃ»ÓÐ 16550A ÐÍµÄ UART£¬È¥ÂòÒ»¿éÐÂµÄ´®ÁÐ¿¨(²»µ½ \$50)£®
µ±ÄãÂòÒ»¿éÐÂ¿¨Ê±£¬È·¶¨ÄãÄÜµ÷ÕûÉÏÃæµÄ IRQ!



×¢Òâ: ×îÔç°æ±¾µÄ 16550 UART ¾§Æ¬ÉÏÓÐè¦´Ã£®ÕâµãºÜ¿ì¾Í±»·¢ÏÖÁË¶øÇÒÒ²·¢ÐÐÁËÐÂ°æµÄ¾§Æ¬ - 16550A UART£®
µ«ÈÔÓÐÉÙ²¿·ÝÓÐè¦´ÃµÄ¾§Æ¬Á÷ÈëÁËÊÐÃæ£®ËäÈ»²»Ì«¿ÉÄÜ¸ÕºÃ¾ÍÈÃÄãÂòµ½£¬µ«Äã»¹ÊÇÓ¦¸Ã¿´Ò»ÏÂ¾§Æ¬ÀàÐÍÊÇ²»ÊÇ 16550A£¬ÌØ±ðÊÇÔÚÒ»Ð©½ÏÔçÆÚµÄ´®ÁÐ¿¨ÉÏ£®




\subsection{´®ÁÐ²ºÃû³Æ}

ÒÔÇ°£¬Linux ÓÃ {\ttfamily cuaX} ±íÊ¾²¦³öµÄ´®ÁÐ²ºÃû¶ø {\ttfamily ttySx} ±íÊ¾²¦ÈëµÄÃû³Æ£®



×ÔºËÐÄ 2.0.X Ö®ááÕâÑùµÄÒªÇóÒÑ¾­¸Ä±äÁË£¬ËùÒÔÄãÓ¦¸Ã¿ÉÒÔÓÃ {\ttfamily ttySx} Í¬Ê±±íÊ¾²¦Èë¼°²¦³öµÄÃû³Æ£®
¾ÝÎÒÁË½â {\ttfamily cuaX} µÄ×°ÖÃÃû³ÆÔÚÎ´À´°æ±¾µÄºËÐÄÖÐ¿ÉÄÜ»áÈ¡Ïû£®




\subsection{ÅäÖÃÄãµÄÊý¾Ý»ú}

ÎªÊ¹ÓÃ PPP Äã½«µÃÕýÈ·µØÅäÖÃÄãµÄÊý¾Ý»ú £­ ÒªÍê³ÉÕâ¼þ¹¤×÷ÇëÔÄ¶ÁÄãµÄÊý¾Ý»úÊ¹ÓÃÊÖ²á! 
´ó²¿·ÖµÄÊý¾Ý»ú¶¼ÓÐ PPP  ËùÐèÇóµÄµÄ{\bfseries ³ö³§Ô¤ÉèÑ¡Ïî}£®
×î»ù±¾µÄÅäÖÃÊÇ:-
\begin{itemize}
\item Ó²ÌåÁ÷Á¿¿ØÖÆ (RTS/CTS) (\&K3 ÔÚÐí¶à²ÉÓÃ Hayes Ö¸Áî¼¯µÄÊý¾Ý»ú)
\end{itemize}


ÄãÓ¦¸ÃÒªÑÐ¾¿µÄÆäËüÉè¶¨£¨Ê¹ÓÃ±ê×¼ Hayes Ö¸Áî£©ÊÇ:
\begin{itemize}
\item E1 ¿ªÆôÖ¸ÁîµÄ±¾µØ»ØÓ¦ (chat ÔË×÷ËùÐè)
\item Q0 »Ø±¨Ö´ÐÐ½á¹û´úÂë (chat ÔË×÷ËùÐè)
\item S0=0 ¹Ø±Õ×Ô¶¯»ØÓ¦ (³ý·ÇÄãÏëÈÃÄãµÄÊý¾Ý»ú½ÓÌýµç»°)
\item \&C1 Ö»ÔÚÁ¬ÏßÖ®ááÕì²âÔØ²¨
\item \&S0 Data Set Ready (DSR)ÓÀÔ¶ÉèÎª¿ªÆô
\item (¿´Çé¿ö)   Data Terminal Ready
\end{itemize}




ÓÐÒ»¸öÕ¾Ì¨Ìá¹©Äã²»¶ÏÔö¼ÓµÄÊý¾Ý»ú¿îÊ½µÄÉè¶¨£¬¿ÉÄÜ»á¶ÔÄãÓÐËù°ïÖú£¬ÔÚ
\nameurl{http://www.in.net/info/modems/index.html}{Modem setup information}£®



ÔÚÄãµÄµçÄÔÓëÊý¾Ý»úÖ®¼äµÄÊý¾Ý»ú´®ÁÐÃæ½çÃæÈçºÎÔË×÷Ò²ÖµµÃÑÐ¾¿ÁË½â£®
´ó²¿·ÖÏÖ´úµÄÊý¾Ý»ú¶¼ÔÊÐíÄãÒÔ¹Ì¶¨µÄËÙ¶ÈÊ¹ÓÃ´®ÁÐ½çÃæ£¬¼´Ê¹µç»°ÏßÂ·½çÃæÇÐ»»µ½×î¸ßµÄËÙ¶ÈËü¸úÔ¶¶ËÊý¾Ý»ú¶¼ÄÜ¹»´¦Àí£®



Õâ³ÆÎª split speed operation£®Èç¹ûÄãµÄÊý¾Ý»úÄÜÖ§Ô®ÕâÏî¹¦ÄÜ£¬°ÑÊý¾Ý»úµÄ´®ÁÐ½çÃæËø¶¨ÔÚËüµÄ×î¸ßËÙ¶È£¨Í¨³£ÊÇ 115,200 baud £¬µ«¶Ô 14,400 Êý¾Ý»úÀ´Ëµ¿ÉÄÜÊÇ 38,400 baud£©£®



Ê¹ÓÃÄãµÄÍ¨Ñ¶ÈíÌå£¨ÀýÈç minicom£©ÕÒ³ö¹Øì¶ÄãÊý¾Ý»úµÄÅäÖÃ×ÊÑ¶²¢ÇÒÉèÎª PPP  ËùÐèµÄÉè¶¨£®
Ðí¶àÊý¾Ý»ú»áÔÚ AT\&V Ö¸ÁîµÄ»ØÓ¦ÖÐ»Ø±¨ËüÃÇÄ¿Ç°µÄÉè¶¨×´¿ö£¬µ«ÊÇÄãÓ¦¸Ã²é¿´Ò»ÏÂÄãµÄÊý¾Ý»úÊ¹ÓÃÊÖ²á£®

Èç¹ûÄã°ÑÉè¶¨È«¶¼ÅªÂÒÁË£¬ÄÇ÷áÄã¿ÉÒÔ½åÓÉ·¢³ö AT\&F Ö¸Áî»Øµ½ÎÈ¶¨×´Ì¬£¨Í¨³£¿ÉÒÔ£© £­ »Øµ½³ö³§Éè¶¨£®
£¨ÔÚÎÒÓö¹ýµÄ´ó²¿·ÖÏÖ´úÊý¾Ý»úÖÐ£¬³ö³§µÄÉè¶¨°üº¬ËùÓÐÊ¹ÓÃ PPP ËùÐèµÄÉè¶¨ £­ µ«ÊÇÄãÓ¦¸Ã×ö¸ö¼ì²é£©£®



Ò»µ©ÄãÕÒ³öÁË±ØÒªµÄÉè¶¨×Ö´®¾Í°ÑËüÐ´ÏÂÀ´£®È»ááÄã±ØÐë×ö¸ö¾ö¶¨: Äã¿ÉÒÔ½«ÕâÐ©Éè¶¨Öµ´æÔÚÊý¾Ý»úÉÏµÄ·Ç»Ó·¢ÐÔ¼ÇÒäÌåÖÐÕâÑù¿ÉÒÔÓÃÊÊµ±µÄ AT Ö¸Áî¾Í¿É½Ð³ö£®
ÁíÒ»¸ö×ö·¨ÊÇ½«ÕâÐ©ÕýÈ·µÄÉè¶¨ÔÚ PPP µÄ²¦ºÅ¹ý³ÌÖÐ´«Èë£®

Èç¹ûÄãÖ»´Ó Linux ÏÂÊ¹ÓÃÊý¾Ý»úÁ¬½Óµ½ ISP ËÅ·þÆ÷£¬×î¼òµ¥µÄ×ö·¨¾ÍÊÇ½«ÕâÐ©Éè¶¨Öµ´æÈëÊý¾Ý»úÉÏµÄ·Ç»Ó·¢ÐÔ¼ÇÒäÌå(non-volatile RAM)£®

ÁíÒ»·½Ãæ£¬Èç¹ûÄãÒª»¹ÔÚÆäËüµÄÓ¦ÓÃ³ÌÊ½»ò×÷ÒµÏµÍ³ÉÏÊ¹ÓÃÊý¾Ý»ú£¬×î±£ÏÕµÄ×ö·¨ÊÇÔÚÃ¿´Î²¦ºÅÊ±²Å½«ÕâÐ©×ÊÑ¶´«Èë£¬
Èç´Ë¿ÉÒÔÈ·±£ÔÚÃ¿´Î²¦ºÅÊ±Êý¾Ý»ú×ÜÊÇÔÚÕýÈ·µÄ×´Ì¬£®(¼ÇÏÂÕâÐ©Éè¶¨×Ö´®»¹ÓÐ¸öºÃ´¦¾ÍÊÇÔÚÊý¾Ý»úÒÅÊ§ÁË¼ÇÒäÌåµÄÄÚÈÝÊ±£¬ÕâÈ·Êµ¿ÉÄÜ·¢Éú)£®




\subsection{´®ÁÐÁ÷Á¿¿ØÖÆ×¢ÒâÊÂÏî}

µ±×ÊÁÏÔÚ´®ÁÐÍ¨Ñ¶ÏßÂ·ÉÏÁ÷¶¯µÄÊ±ºò£¬¿ÉÄÜ»á·¢Éú×ÊÁÏµ½´ïµÄ±ÈµçÄÔÄÜ´¦ÀíµÄ»¹Òª¿ìÕâÖÖÇé¿ö£¨µçÄÔ¿ÉÄÜÃ¦Öø×öÆäËüµÄÊÂ £­ ¼ÇµÃ£¬Linux ÊÇÒ»¸ö¶àÊ¹ÓÃÕß£¬¶à¹¤µÄ×÷ÒµÏµÍ³£©£®
ÎªÁËÈ·±£×ÊÁÏ²»»áÂ©Ê§£¨ÔÚ»º³åÇøÖÐµÄ×ÊÁÏ²»»á³¬ÔØ¶øÒò´ËÂ©Ê§µô£©£¬ÐèÒªÄ³Ð©¿ØÖÆ×ÊÁÏÁ÷Á¿µÄ·½·¨£®



ÓÐÁ½ÖÖ·½·¨¿ÉÒÔÔÚ´®ÁÐÏßÂ·ÉÏ´ï³ÉÕâ¸öÄ¿µÄ:-
\begin{itemize}
\item Ê¹ÓÃÓ²ÌåÐÅºÅ(Clear To Send/Request to Send - CTS/RTS)
\item Ê¹ÓÃÈíÌåÐÅºÅ(control S and control Q, also known as XON/XOFF).
\end{itemize}




ËäÈ»ááÕßÓÃÔÚÖÕ¶Ë»ú£¨ÎÄ×Ö£©Á¬½áÉÏ¿ÉÄÜºÜºÃ£¬µ«ÊÇÔÚ PPP  ÉÏµÄ×ÊÁÏÊ¹ÓÃÕû¸ö 8 bits ±àÂë¿Õ¼ä £­ ¶øÇÒÔÚ×ÊÁÏÖÐµÄÄ³¸öµØ·½Ïàµ±¿ÉÄÜ´æÔÚ»á±»×ª³É control S  ÒÔ¼° control Q  µÄÎ»Ôª×é£®
ËùÒÔ£¬Èç¹ûÊý¾Ý»úÉè³ÉÊ¹ÓÃÈíÌåÁ÷Á¿¿ØÖÆµÄ»°£¬ÄÇ÷á´«ÊäºÜÈÝÒ×±»ÈÅÂÒ!

¶Ôì¶Ê¹ÓÃ PPP µÄ¸ßËÙÁ¬½á£¨Ê¹ÓÃ 8 bits ×ÊÁÏ±àÂë£©À´ËµÓ²ÌåÁ÷Á¿¿ØÖÆÊÇºÜÖØÒªµÄ£¬Òò´ËÄã±ØÐëÊ¹ÓÃÓ²ÌåÁ÷Á¿¿ØÖÆ£®




\subsection{²âÊÔÄãµÄÊý¾Ý»úµÄ²¦³ö¹¦ÄÜ}

ÔÚÄãÍê³ÉÁË´®ÁÐ²ºÓëÊý¾Ý»úµÄÉè¶¨Ö®Ê±ÊÔÖø²¦µ½ÄãµÄ ISP ÉÏ¿´¿´ÄÜ·ñÁ¬ÉÏÒÔÈ·¶¨Éè¶¨ÊÇ·ñÓÐÎó£®



Ê¹ÓÃÄãµÄÖÕ¶Ë»úÍ¨Ñ¶ÈíÌå£¨ÏñÊÇ minicom£©£¬²¦µ½ÄãÏëÊ¹ÓÃ PPP  Á¬ÏßµÄÄÇÌ¨ PPP  ËÅ·þÆ÷£®



£¨×¢Òâ: ÔÚÕâ¸ö½×¶ÎÎÒÃÇ²¢²»³¢ÊÔ½¨Á¢ PPP  Á¬Ïß £­ Ö»ÊÇÒªÖ¤ÊµÎÒÃÇÓµÓÐÕýÈ·µÄµç»°ºÅÂëÒÔ¼°ÎªÁËÇ©Èë²¢ÇÒÆð¶¯ PPP  ¶ø{\bfseries È·ÊµµØ}ÕÒ³öËÅ·þÆ÷¾¿¾¹´«ËÍ¸øÎÒÃÇÊ²÷áÑ¶Ï¢£©£®



ÔÚÕâ¸ö¹ý³ÌÖÐ£¬¿ÉÒÔ½ØÈ¡£¨¼ÇÂ¼µ½Ò»¸öµµ°¸Àï£©Õû¸öÇ©ÈëµÄ¹ý³Ì»òÕßÊÇÐ¡ÐÄµØ£¨·Ç³£Ð¡ÐÄµØ£©È·ÊµÐ´ÏÂÔ¶¶ËËÅ·þÆ÷Ëù¸øÄãÌáÊ¾ÊäÈëÄãµÄÊ¹ÓÃÕßÃû³ÆÒÔ¼°ÃÜÂëµÄÑ¶Ï¢£¨ÒÔ¼°ÈÎºÎ½¨Á¢ PPP  Á¬ÏßÐèÒªÏÂ´ïµÄÖ¸Áî£©£®



Èç¹ûÄãµÄËÅ·þÆ÷Ê¹ÓÃ PAP£¬Äã¿ÉÄÜ²»»á¿´¼ûÇ©ÈëµÄÌáÊ¾·ûºÅ£¬¶øÊÇ(ÒÔÎÄ×Ö±íÊ¾µÄ)Á¬½áÍ¨Ñ¶Ð­¶¨(¿´ÆðÀ´ÏñÊÇÀ¬»ø)³öÏÖÔÚÄãµÄÓ©Ä»ÉÏ£®



Ò»Ð©¾¯¸æ:-

\begin{itemize}
\item Ä³Ð©ËÅ·þÆ÷Ïàµ±´ÏÃ÷: Äã¿ÉÒÔÓÃÎÄ×ÖÄ£Ê½µÄÊ¹ÓÃÕßÃû³Æ/ÃÜÂë·½Ê½»òÊ¹ÓÃ PAP Ç©Èë£®
Òò´ËÈç¹ûÄãµÄ ISP »ò¹«Ë¾Õ¾Ì¨Ê¹ÓÃ PAP µ«ÄãÃ»ÓÐÁ¢¿ÌÔÚÓ©Ä»ÉÏ¿´µ½À¬»ø£¬Ò²²¢²»±íÊ¾Äã×ö´íÁË£®
\item Ä³Ð©Õ¾Ì¨ÒªÇóÄãÏÈÊäÈëÒ»Ð©ÆðÊ¼µÄÎÄ×Ö{\itshape È»áá\/}²ÅÆô¶¯±ê×¼µÄ PAP ³ÌÐò£®
\item Ä³Ð© PPP ËÅ·þÆ÷ÊÇ±»¶¯µÄ - ËüÃÇ¾Í×øÔÚÄÇÀïµÈ´ý¶ø²»ËÍ³öÈÎºÎ×ÊÁÏ£¬Ö±µ½¿Í»§¶Ë²¦Èë²¢ËÍ³öºÏ·¨µÄÁ¬½á¿ØÖÆÐ­¶¨£®
Èç¹ûÄãÒªÁ¬½ÓµÄ PPP ËÅ·þÆ÷ÊÇ±»¶¯Ä£Ê½µÄ£¬Äã½«²»»á¿´µ½ÈÎºÎÀ¬»ø!
\item Ä³Ð©ËÅ·þÆ÷ÔÚÄã°´ÏÂ {\ttfamily ENTER} Ç°²»»áÆô¶¯ PPP - Òò´ËÈç¹ûÄãÕýÈ·Ç©Èëµ«Î´¿´µ½À¬»øµÄ»°¿ÉÒÔÊÔÊÔ!
\end{itemize}




Õâ×îÉÙÖµµÃ²¦½ÓÁ½´Î £­ Ä³Ð©ËÅ·þÆ÷»áÔÚÃ¿´ÎÄãÇ©ÈëÊ±¸Ä±äÌáÊ¾£¨ÀýÈçÒÀÊ±¼ä¸Ä±ä!£©£®
ÄãµÄ Linux »úÆ÷ÔÚÃ¿´ÎÄã²¦ÈëµÄÊ±ºòÒªÄÜ¹»±æÈÏµÄÁ½¸öÖ÷ÒªµÄÌáÊ¾ÊÇ:-
\begin{itemize}
\item ÒªÇóÄãÊäÈëÊ¹ÓÃÕßÃû³ÆµÄÌáÊ¾;
\item ÒªÇóÄãÊäÈëÃÜÂëµÄÌáÊ¾;
\end{itemize}




Èç¹ûÄã±ØÐë·¢³öÄ³¸öÖ¸ÁîÀ´Æð¶¯ËÅ·þ¶ËµÄ PPP£¬ÄÇ÷áÄãÒ²ÐèÒªÕÒ³öÒ»µ©ÄãÇ©ÈëÖ®ááËÅ·þÆ÷Ëù¸øÄãÊäÈëÖ¸ÁîÒÔÆô¶¯ PPP µÄÌáÊ¾£®



Èç¹ûÄãµÄËÅ·þÆ÷×Ô¶¯Æð¶¯ PPP  µÄ»°£¬Ò»µ©ÄãÇ©ÈëÍê³É£¬Äã½«¿ªÊ¼¼ûµ½Ó©Ä»ÉÏ³öÏÖÀ¬»ø £­ ÕâÊÇ PPP  ËÅ·þ¶Ë´«ËÍ¸øÄãµÄ»úÆ÷ÒÔÆð¶¯²¢ÇÒÅäÖÃ PPP Á¬ÏßµÄ×ÊÑ¶£®



Õâ¿´ÆðÀ´Ó¦¸Ã»áÊÇÏñÕâÑùµÄ¶«Î÷:-
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
~y}#.!}!}!} }8}!}$}%U}"}&} } } } }%}& ...}'}"}(}"} .~~y}
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




(¶øÇÒËü»¹»áÒ»Ö±½øÀ´! )



ÔÚÄ³Ð©ÏµÍ³ÖÐ PPP  ±ØÐëÔÚËÅ·þ¶ËÉÏÃ÷È·µØ¼ÓÒÔÆð¶¯£®ÕâÍ¨³£ÊÇÒòÎª¸ÃËÅ·þÆ÷±»Éè¶¨³ÉÔÊÐíÊ¹ÓÃÏàÍ¬Ê¹ÓÃÕßÃû³Æ£¯ÃÜÂëÅä¶ÔÀ´×ö PPP  Ç©Èë¼°Ò»°ãÊ¹ÓÃ½çÃæ(shell) µÄÇ©Èë£®
Èç¹ûÊÇÕâÑù£¬Ò»µ©ÄãÇ©Èë¾Í·¢³ö¸ÃÖ¸Áî£®ÔÙÒ»´Î£¬Äã½«»á¼ûµ½ PPP  Á¬ÏßËÅ·þ¶ËÆð¶¯µÄÀ¬»ø×ÊÑ¶ £­ ËùÒÔÏÖÔÚÄã¿ÉÒÔ¹Ò¶ÏÁË£®



Èç¹ûÄãÃ»ÓÐÔÚÁ¬ÉÏÊ±Á¢¼´ÔÚÓ©Ä»ÉÏ¿´µ½ÕâÐ©À¬»ø(Èç¹û±ØÒªµÄ»°ÏÈÇ©Èë²¢Æô¶¯ PPP ËÅ·þÆ÷)£¬
°´ÏÂ {\bfseries Enter} ÊÔÊÔÄÜ·ñÆô¶¯ PPP ËÅ·þÆ÷...



Õâ¸öÊ±ºò£¬Äã¾Í¿ÉÒÔ¹Ò¶ÏÄãµÄÊý¾Ý»ú£¨Í¨³£ÊÇ£¬¿ìËÙµØ¼üÈë {\ttfamily +++} Ò»µ©ÄãµÄÊý¾Ý»ú»ØÓ¦ OK È»áá½ÓÖøÏÂ ATHO Ö¸Áî£©£®



Èç¹ûÄã²»ÄÜÊ¹ÄãµÄÊý¾Ý»úÔË×÷µÄ»°£¬ÔÄ¶ÁÄãµÄÊý¾Ý»úÊ¹ÓÃÊÖ²á£¬ÄãÍ¨Ñ¶ÈíÌåµÄÏßÉÏÊ¹ÓÃÊÖ²áÒÔ¼° Serial HOWTO!  
Ò»µ©Äã½â¾ö¸ÃÎÊÌâ£¬¼ÌÐø½øÐÐÇ°ÃæËùËµµÄ£®




\section{½¨Á¢Ãû³Æµ½Î»Ö·½âÎö(DNS)\label{DNS}}

ËäÈ»ÎÒÃÇÈËÀàÏ²»¶¸øÊÂÎïÈ¡¸öÃû³Æ£¬µçÄÔÏ²»¶Êý×Ö£®
ÔÚ TCP/IP ÍøÂ·ÉÏ£¨ÕâÒ²¾ÍÊÇÍø¼ÊÍøÂ·£©£¬ÎÒÃÇ½åÓÉÌØ¶¨µÄÃû³Æºô½ÐÄ³Ì¨»úÆ÷£¬¶øÇÒÃ¿Ì¨»úÆ÷¶¼´æÔÚì¶Ò»¸öÌØ¶¨µÄÁìÓò±ê¼ÇÀïÃæ£®
¾ÙÀý¶øÑÔ£¬ÎÒµÄ Linux ¹¤×÷Õ¾³ÆÎª {\bfseries archenland} ¶øËüÊÇ´æÔÚì¶ {\bfseries interweft.com.au} Õâ¸öÁìÓòÀï£®
ËùÒÔËüÔÚÈËÃÇÐÄÄ¿ÖÐµÄÎ»Ö·¾ÍÊÇ {\bfseries archenland.hedland.edu.au}£®
(³ÆÎª FQDN - fully qualified domain name£®)

È»¶ø£¬ÎªÁËÊ¹Íø¼ÊÍøÂ·ÉÏµÄÆäËüµçÄÔÕÒµÄµ½ÕâÌ¨»úÆ÷£¬ÊÂÊµÉÏµçÄÔÔÚÍø¼ÊÍøÂ·ÉÏ¹µÍ¨Ê±ËüÊÇ½åÓÉÆä IP ºÅÂëÀ´ÈÏÖªµÄ£®

°Ñ»úÆ÷£¨ÒÔ¼°ÁìÓò£©µÄÃû³Æ×ªÒë£¨½âÎö£©³ÉÎªÔÚÍø¼ÊÍøÂ·ÉÏËùÊµ¼ÊÊ¹ÓÃµÄ IP ºÅÂëÊÇÌá¹©ÁìÓòÃû³Æ·þÎñÖ®»úÆ÷µÄ¹¤×÷£®

ËüÊÇÕâÑù×ÓÔË×÷µÄ:-
\begin{itemize}
\item ÄãµÄ»úÆ÷ÐèÒªÖªµÀÄ³²¿ÌØ¶¨µçÄÔµÄ IP Î»Ö·£®ÐèÒªÕâÏî×ÊÑ¶µÄÓ¦ÓÃ³ÌÊ½ÏòÄãµÄ Linux PC ÉÏµÄ'Ãû³Æ½âÎöÆ÷'Ñ¯ÎÊ´Ë×ÊÑ¶;
\item Ãû³Æ½âÎöÆ÷²éÑ¯»úÆ÷ÄÚ²¿µÄÖ÷»úÃû³Æµµ°¸(¿ÉÄÜÊÇ {\ttfamily /etc/hosts} ÒÔ¼°/»òÊÇÖªµÀÕâÏî×ÊÑ¶µÄÁìÓòÃû³ÆËÅ·þÆ÷£¬¶øÃû³Æ½âÎöÆ÷Êµ¼ÊµÄÐÐÎªÓÉ {\ttfamily /etc/host.conf} µµ°¸¾ö¶¨);
\item Èç¹û´ð°¸ÔÚÖ÷»úÃû³Æµµ°¸ÖÐ£¬¾ÍÒÔ´Ë´ð°¸»Ø´ð;
\item Èç¹ûÊÇÔÚÖ¸¶¨µÄÁìÓòÃû³ÆËÅ·þÆ÷ÖÐ£¬ÄãµÄ PC ¾ÍÏò¸Ã»úÆ÷Ñ¯ÎÊ;
\item Èç¹ûÕâ²¿ÁìÓòÃû³ÆËÅ·þÆ÷ÒÑ¾­ÖªµÀ±»Ñ¯ÎÊÃû³ÆµÄ IP ºÅÂë£¬¾ÍÒÔ´Ë»Ø´ð£®·ñÔò£¬Ëü»áÍ¸¹ýÍø¼ÊÍøÂ·ÏòÆäËüµÄÃû³ÆËÅ·þÆ÷ÕÒÑ°×ÊÑ¶£®
×îááÕâ²¿Ãû³ÆËÅ·þÆ÷»á½«×ÊÑ¶´«»Ø¸øÔ­À´Ñ¯ÎÊµÄÃû³Æ½âÎöÆ÷£¬È»áá´«¸øÒªÇó´Ë×ÊÑ¶µÄÓ¦ÓÃ³ÌÊ½£®
\end{itemize}




µ±Äã´´Ôì³ö PPP  Á¬ÏßÊ±£¬ÄãÐèÒª¸æËßÄãµÄ Linux  »úÆ÷Ëü¿ÉÒÔÔÚÄÄÀïÕÒµ½Ö÷»úÃû³Æ¶ÔÕÕµ½ IP ºÅÂë£¨Î»Ö·½âÎö£©µÄ×ÊÑ¶£¬Èç´Ë{\bfseries Äã}¾Í¿ÉÒÔÊ¹ÓÃ»úÆ÷µÄÃû³Æ¶ø{\bfseries ÄãµÄµçÄÔ}¿ÉÒÔ°ÑÕâÐ©Ãû³Æ×ªÒë³ÉËüÔË×÷ËùÐèµÄ IP ºÅÂë£®



Ò»¸ö·½·¨ÊÇÊäÈëËùÓÐÄãÏëÁªÂçµÄÖ÷»úµ½ {\ttfamily /etc/hosts} µµ°¸Àï£¨Èç¹ûÄãÊÇÁ¬ÉÏÍø¼ÊÍøÂ·µÄ»°ÕâÕæµÄÊÇÍêÈ«²»¿ÉÄÜµÄÊÂ£©£»
ÁíÒ»¸ö·½·¨ÊÇÊ¹ÓÃÏà¶Ôì¶»úÆ÷Ãû³ÆµÄ IP ºÅÂë£¨Òª¼ÇµÃÈ«²¿µÄ IP Î»Ö·ÊÇ²»¿ÉÄÜµÄ³ý·ÇÔÚ×îÐ¡µÄÇøÓòÍøÂ·ÉÏ£©£®



×îºÃµÄ·½·¨ÊÇÉè¶¨ÄãµÄ Linux  Ê¹ËüÖªµÀ¸Ãµ½ÄÄÈ¡µÃÕâÏîÃû³Æµ½ºÅÂëµÄ×ÊÑ¶ £­ ×Ô¶¯µØ£®
ÕâÏî·þÎñÊÇÓÉÁìÓòÃû³ÆËÅ·þÆ÷ÏµÍ³ËùÌá¹©£®ÐèÒª×öµÄÈ«²¿¹¤×÷ÊÇ°Ñ IP ºÅÂëÊäÈëµ½ÄãµÄ {\ttfamily /etc/resov.conf} µµ°¸Àï£®




\subsection{{\ttfamily /etc/resolv.conf} µµ°¸}

ÄãµÄ PPP  ËÅ·þÆ÷ÏµÍ³¹ÜÀí£¯Ê¹ÓÃÕßÖ§Ô®ÈËÔ±Ó¦¸ÃÒªÌá¹©¸øÄãÁ½¸ö DNS µÄ IP ºÅÂë£¨Ö»ÐèÒªÒ»¸ö £­ µ«ÊÇÁ½¸öÔÚ³öÎÊÌâÊ±¿ÉÒÔ¶àÐ©°ïÖú£©£®

ÈçÇ°ËùÊö£¬Linux ²»ÄÜÒÔÏñ MS Windows 95 Ò»ÑùµÄ·½Ê½À´Éè¶¨ËüµÄÃû³ÆËÅ·þÆ÷µÄ IP ºÅÂë£®
ËùÒÔÄã±ØÐë(ÓÐÀñÃ²µØ){\bfseries ¼á³Ö}ÄãµÄ ISP Ìá¹©ÄãÕâÏî×ÊÑ¶!

ÄãµÄ {\ttfamily /etc/resolv.conf} ¿´ÆðÀ´Ó¦¸Ã»áÏñÕâÑù:
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
domain your.isp.domain.name
nameserver 10.25.0.1
nameserver 10.25.1.2
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




±à¼­Õâ¸öµµ°¸£¨Èç¹ûÃ»ÓÐµÄ»°¾Í½¨Ò»¸öÐÂµÄ£©ÒÔ³ÊÏÖÄãµÄ ISP  Ìá¹©µÄ×ÊÑ¶£®ËüµÄÓµÓÐÕßÒÔ¼°È¨ÏÞÓ¦¸ÃÏñÏÂÃæÕâÑù:-
\begin{tscreen}
\begin{verbatim}
-rw-r--r--   1 root     root           73 Feb 19 01:46 /etc/resolv.conf
\end{verbatim}
\end{tscreen}




Èç¹ûÄãÒòÎª±¾À´¾ÍÔÚÇøÓòÍøÂ·ÉÏËùÒÔÒÑ¾­ÉèÁ¢ {\ttfamily /etc/resolv.conf} µµ°¸µÄ»°£¬Ö»Òª¼òµ¥µÄ°Ñ PPP Á¬ÏßµÄ DNS ËÅ·þÆ÷ IP ºÅÂë¼Óµ½ÄãÒÑÓÐµÄµµ°¸Àï¼´¿É£®




\subsection{{\ttfamily /etc/host.conf} µµ°¸}

ÄãÒ²Ó¦¸Ã¼ì²éÄãµÄ {\ttfamily /etc/host.conf} µµ°¸ÊÇ·ñÉè¶¨ÕýÈ·£®Ëü¿´ÆðÀ´Ó¦¸ÃÏñÕâÑù
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
order hosts,bind
multi on
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




Ëü¸æËßÄãµÄÃû³Æ½âÎöÆ÷ÔÚÏòÃû³ÆËÅ·þÆ÷Ñ¯ÎÊÖ®Ç°ÏÈÊ¹ÓÃÖ÷»úÃû³Æµµ°¸ÖÐµÄ×ÊÑ¶£®




\section{Ê¹ÓÃ PPP Óë root È¨ÏÞ\label{root}}

ÒòÎª PPP ÐèÒªÉè¶¨ÍøÂ·Éè±¸£¬±ä¸üºËÐÄµÝËÍ±í¸ñÒÔ¼°ÖîÈç´ËÀàµÄ¶¯×÷£¬ËùÒÔËüÐèÒªÒÔ root µÄÈ¨ÏÞÀ´×öÕâÐ©ÊÂ£®



Èç¹û root ÒÔÍâµÄÊ¹ÓÃÕßÒªÄÜ½¨Á¢ PPP  Á¬Ïß£¬ÄÇ÷á pppd ³ÌÊ½Ó¦¸ÃÉèÎªÒÔ root µÄÉí·ÖÖ´ÐÐ(setuid):-
\begin{tscreen}
\begin{verbatim}
-rwsr-xr-x   1 root     root        95225 Jul 11 00:27 /usr/sbin/pppd
\end{verbatim}
\end{tscreen}




Èç¹û {\ttfamily /usr/sbin/ppd} ²»ÊÇÉè¶¨ÎªÕâÑù£¬ÄÇ÷áÒÔ {\bfseries root} µÄÉí·ÖÏÂÕâ¸öÖ¸Áî:

\begin{tscreen}
\begin{verbatim}
chmod u+s /usr/sbin/pppd
\end{verbatim}
\end{tscreen}




ÕâÑùÊÇÈÃ pppd ÒÔ root µÄÈ¨ÏÞÖ´ÐÐ£¬¼´Ê¹ÊÇÓÉÒ»°ãÊ¹ÓÃÕßËùÖ´ÐÐµÄ£®
ÕâÄÜÈÃÒ»°ãÊ¹ÓÃÕßÖ´ÐÐµÄ pppd ¾ßÓÐ±ØÒªµÄÈ¨ÏÞ½¨Á¢ÍøÂ·½çÃæ¼°ºËÐÄµÝËÍ±í¸ñ£®



ÒÔ root µÄÉí·ÖÖ´ÐÐµÄ³ÌÊ½ÔÚ°²È«ÉÏÊÇÇ±ÔÚµÄÂ©¶´£¬ËùÒÔÄã¶Ôì¶Éè¶¨Îª 'setuid' µÄ³ÌÊ½±ØÐë·Ç³£µØÐ¡ÐÄ£®
Ðí¶àµØ³ÌÊ½(°üÀ¨ pppd)ÒÑ¾­±»Ð¡ÐÄµØ×«Ð´ÒÔ½«ÓÃ root µÄÉí·ÖÖ´ÐÐµÄÎ£ÏÕ½µµ½×îµÍ£¬ËùÒÔÕâÑù×öÓ¦¸ÃÊÇ°²È«µØ(²»¹ý²»±£Ö¤)£®



¸ù¾ÝÄãÏ£ÍûÄãµÄÏµÍ³ÈçºÎÔË×÷¶ø¶¨£¬ÌØ±ðÊÇÈç¹ûÄãÏ£ÍûÄãÏµÍ³ÀïµÄÈÎºÎÊ¹ÓÃÕß¶¼ÄÜÆôÊ¼ PPP Á¬½á£¬ÄãÓ¦¸Ã°ÑÄãµÄ ppp-on/off Ö¸Áî¸åÉè¶¨ÎªÈ«²¿µÄÈË¶¼¿ÉÒÔ¶ÁÈ¡£¯Ö´ÐÐ£®£¨Èç¹ûÄãµÄ PC Ö»ÓÉÄãÊ¹ÓÃÄÇ÷áÕâÑù´ó¸Å²»´í£©£®



È»¶ø£¬Èç¹ûÄã²»Ï£ÍûÈÎºÎÈË¶¼ÄÜÆðÊ¼ PPP  Á¬Ïß£¨ÀýÈç£¬ÄãµÄº¢×ÓÔÚÄãµÄ Linux PC ÉÏÓÐÕÊºÅ¶øÄã²»Ï£ÍûËûÃÇÔÚÃ»ÓÐÄãµÄ¼à¶½ÏÂÁ¬ÉÏÍø¼ÊÍøÂ·£©£¬Äã½«µÃ½¨Á¢Ò»¸ö PPP Èº×é£¨±à¼­ {\ttfamily /etc/group} µµ°¸£©²¢ÇÒ:
\begin{itemize}
\item ½« pppd Éè¶¨ÎªÒÔ root µÄÈ¨ÏÞÖ´ÐÐ£¬ÓµÓÐÕßÊÇ root ¶øÈº×éÊÇ PPP£¬¶øÆäËüµÄÈ¨ÏÞ¶¼¹Ø±Õ£®Ëü¿´ÆðÀ´Ó¦¸ÃÏñÕâÑù
\begin{tscreen}
\begin{verbatim}
-rwsr-x---   1 root     PPP        95225 Jul 11 00:27 /usr/sbin/pppd
\end{verbatim}
\end{tscreen}

 
\item Ê¹ ppp-on/off Ö¸Áî¸åÓÉÊ¹ÓÃÕß root ÒÔ¼°Èº×é PPP  ËùÓµÓÐ
\item Ê¹ ppp-of/off Ö¸Áî¸åÄÜÓÉÈº×é PPP ¶ÁÈ¡£¯Ö´ÐÐ
\begin{tscreen}
\begin{verbatim}
  -rwxr-x---   1 root     PPP           587 Mar 14  1995 /usr/sbin/ppp-on
  -rwxr-x---   1 root     PPP           631 Mar 14  1995 /usr/sbin/ppp-off
\end{verbatim}
\end{tscreen}

\item ¹Ø±ÕÆäËüµÄ´æÈ¡È¨ÏÞ
\item °ÑÄÜ¹»Æð¶¯ PPP  µÄÊ¹ÓÃÕß¼ÓÈë /etc/group µµ°¸µÄ PPP Èº×éÀï
\end{itemize}




¼´Ê¹Èç´Ë£¬Ò»°ãÊ¹ÓÃÕßÈÔÈ»ÎÞ·¨ÒÔÈíÌåµÄ·½Ê½ÖÐÖ¹Á¬½á£®
Ö´ÐÐ {\ttfamily ppp-off} Ö¸Áî¸åÐèÒª root µÄÈ¨ÏÞ£®È»ºÎ£¬ÈÎºÎÊ¹ÓÃÕß¶¼¿ÉÒÔ¹ØµôÊý¾Ý»ú(»ò½«µç»°ÏßÓÉÄÚ½ÓÊ½Êý¾Ý»ú°ÎÏÂ)£®



ÁíÍâÒ»ÖÖ(¸üºÃµÄ)°ì·¨£¬ÔÊÐíÊ¹ÓÃÕßÊ¹ÓÃ {\ttfamily sudo} À´Æð¶¯ ppp Á¬½á£®
ÕâÑù¿ÉÒÔÌá¹©¸ü¼ÑµÄ°²È«ÐÔ²¢ÇÒ¿ÉÒÔÈÃÄãÉè¶¨ÈÃÈÎºÎ(¿ÉÐÅÈÎµÄ)Ê¹ÓÃÕßÊ¹ÓÃÖ¸Áî¸åÀ´Æô¶¯/½áÊøÁ¬½á£®
Ê¹ÓÃ {\ttfamily sudo} ¿ÉÒÔÈÃÒ»Î»¿ÉÐÅÈÎµÄÊ¹ÓÃÕßÇ¬¾»¶ø°²È«µØÆô¶¯/½áÊø PPP Á¬½á£®




\section{Éè¶¨ PPP Á¬½Óµµ°¸\label{options}}

Äã±ØÐëÒÔ {\bfseries root} Éí·ÝÇ©ÈëÀ´½¨Á¢ÕâÐ©Ä¿Â¼²¢ÇÒ±à¼­ÕâÐ©ÉèÁ¢ PPP Á¬ÏßËùÐèµÄµµ°¸£¬¼´Ê¹ÄãÏëÈÃËùÓÐµÄÊ¹ÓÃÕß¶¼ÄÜÊ¹ÓÃ PPP£®



PPP Ê¹ÓÃ¼¸¸öµµ°¸À´½¨Á¢²¢Éè¶¨ PPP Á¬½á£®ÕâÐ©µµ°¸ÔÚ PPP 2.1.2 Óë 2.2 ÖÐµÄÃû³ÆÓëÎ»ÖÃ¶¼²»Í¬£®



ÔÚ PPP 2.1.2 ÖÐÕâÐ©µµ°¸ÊÇ:-
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
/usr/sbin/pppd               # PPP Ö´ÐÐµµ
/usr/sbin/ppp-on             # ²¦ºÅ/Á¬ÏßÖ¸Áî¸å
/usr/sbin/ppp-off            # ¶ÏÏßÖ¸Áî¸å
/etc/ppp/options             # ËùÓÐÁ¬ÏßËùÊ¹ÓÃµÄÑ¡Ïî
/etc/ppp/options.ttyXX   # ¸øÄ³Ò»ÌØ¶¨Í¨Ñ¶²ºÊ¹ÓÃµÄÑ¡Ïî
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ÔÚ PPP 2.2 ÖÐÕâÐ©µµ°¸ÊÇ:-
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
/usr/sbin/pppd                  # PPP Ö´ÐÐµµ
/etc/ppp/scripts/ppp-on         # ²¦ºÅ/Á¬ÏßÖ¸Áî¸å
/etc/ppp/scripts/ppp-on-dialer  # ²¦ºÅµÄ chat Ö¸Áî¸å²¿·Ý
/etc/ppp/scripts/ppp-off        # ¶ÏÏßÖ¸Áî¸å
/etc/ppp/options                # ËùÓÐÁ¬ÏßËùÊ¹ÓÃµÄÑ¡Ïî
/etc/ppp/options.ttyXX          # ¸øÄ³Ò»ÌØ¶¨Í¨Ñ¶²ºÊ¹ÓÃµÄÑ¡Ïî
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}






Red Hat Linux µÄÊ¹ÓÃÕßÓ¦×¢Òâ±ê×¼µÄ Red Hat 4.X °²×°½«ÕâÐ©Ö¸Áî¸å·ÅÔÚ {\ttfamily /usr/doc/ppp-2.2.0f-2/scripts}£®



ÔÚÄãµÄ {\ttfamily /etc} Ä¿Â¼ÀïÓ¦¸ÃÒªÓÐ¸öÄ¿Â¼:
\begin{tscreen}
\begin{verbatim}
drwxrwxr-x   2 root     root         1024 Oct  9 11:01 ppp
\end{verbatim}
\end{tscreen}




Èç¹ûËü²»´æÔÚµÄ»° £­ ÒÔÕâÑùµÄÈ¨ÏÞ½¨Á¢Ëü£®



Èç¹ûÕâ¸öÄ¿Â¼ÒÑ¾­´æÔÚ£¬ËüÓ¦¸Ã»á°üº¬Ò»¸ö³ÆÎª {\bfseries options.tpl} µÄÑ¡Ïîµµ°¸Ñù°å£®Õâ¸öµµ°¸°üÀ¨ÔÚÏÂÃæ£®



ÒòÎªËü°üº¬ËùÓÐ PPP Ñ¡ÏîµÄ½âÊÍËùÒÔÇëÄã°ÑËüÓ¡³öÀ´£¨ÅäºÏ pppd µÄÏßÉÏÊ¹ÓÃÊÖ²áÀ´ÔÄ¶Á½«»áÊÇºÜÓÐÓÃµÄ£©£®
ËäÈ»Äã¿ÉÒÔÊ¹ÓÃÕâ¸öµµ°¸×÷Îª {\ttfamily /etc/ppp/options} µµ°¸µÄ»ù´¡£¬µ«ÊÇ½¨Á¢Äã×Ô¼ºµÄ£¬Ã»ÓÐ°üº¬ËùÓÐÔÚÕâ¸öÑù°åÀïµÄÖ¸ÁîµÄÑ¡Ïîµµ°¸¿ÉÄÜ»á¸üºÃ £­ Ëü»á¶ÌµÃ¶à¶øÇÒ±È½ÏÈÝÒ×ÔÄ¶Á£¯Î¬»¤£®



Èç¹ûÄãÓÐ¶à¸ö´®ÁÐÏßÂ·£¯Êý¾Ý»ú£¨µäÐÍµÄÀý×ÓÊÇ PPP ËÅ·þÆ÷£©£¬ÄÇ÷á½¨Á¢Ò»¸öÒ»°ã»¯µÄ {\ttfamily /etc/ppp/options} µµ°¸£¬ÆäÖÐ°üº¬Ã¿¸öÄãÌá¹©Ö§Ô®²¦ÈëµÄ´®ÁÐ²ºËùÊ¹ÓÃµÄ¹²Í¬Ñ¡Ïî²¢ÇÒÎªÃ¿Ò»¸öÐèÒª¸ö±ðÉè¶¨ÒÔ½¨Á¢ PPP Á¬ÏßµÄ´®ÁÐÏßÂ·ÉèÁ¢¸ö±ðµÄÑ¡Ïîµµ°¸£®



ÕâÐ©µµ°¸ÃûÎª {\ttfamily options.ttyx1}, {\ttfamily options.ttyx2} ÒÀ´ËÀàÍÆ£¨ÆäÖÐ {\ttfamily x} ÊÇÄã´®ÁÐ²ºµÄÊÊµ±´úÂë£©£®



È»¶ø£¬¶Ôì¶µ¥Ò» PPP  Á¬Ïß£¬Äã¿ÉÒÔÖ±½ÓÊ¹ÓÃ {\ttfamily /etc/ppp/options} Õâ¸öµµ°¸£®ÁíÍâÒ»ÖÖ°ì·¨£¬Äã¿ÉÒÔ°ÑËùÓÐµÄÑ¡Ïî·Å½ø pppd Ö¸Áî×÷Îª²ÎÊý£®



Ê¹ÓÃ {\ttfamily /etc/ppp/options.ttySx} µµ°¸µÄÉè¶¨·½Ê½»á±È½ÏÈÝÒ×¼ÓÒÔÎ¬»¤£®
Èç¹ûÄãÊ¹ÓÃ PPP  À´Á¬Ïßµ½ºÃ¼¸¸ö²»Í¬µÄ½ÚµãÈ¥µÄ»°£¬ÄÇ÷áÄã¾Í¿ÉÒÔÔÚ {\ttfamily /etc/ppp/options.site} ÀïÃæÎªÃ¿¸ö½Úµã½¨Á¢Ñ¡Ïîµµ°¸È»ááÔÚÄãÁ¬ÏßÊ±Ö¸¶¨Ñ¡Ïîµµ°¸×÷Îª PPP Ö¸ÁîµÄ²ÎÊý£®
(Ê¹ÓÃ {\ttfamily file option-file} ²ÎÊýì¶ pppd µÄÖ¸ÁîÁÐ)£®




\subsection{Ìæ´úµÄ options.tpl µµ°¸}

Ä³Ð©¸ö PPP  µÄ·¢ÐÐÌ×¼þËÆºõÂ©Ê§ÁË options.tpl Õâ¸öµµ°¸£¬ËùÒÔÔÚÕâÀïÓÐ¸öÍêÕûµÄµµ°¸£®
ÎÒ½¨ÒéÄã²»ÒªÖ±½Ó±à¼­Õâ¸öµµ°¸À´½¨Á¢Äã×Ô¼ºµÄ {\ttfamily /etc/ppp/options}£®
°ÑËü¿½±´µ½Ò»¸öÐÂµÄµµ°¸È»áá±à¼­¸Ãµµ°¸±È½ÏºÃ£®Èç¹ûÄãÅªÂÒÁËÄã±à¼­µÄµµ°¸£¬Äã¿ÉÒÔ»ØÍ·´ÓÔ­Ê¼µµ°¸ÔÙ¶È¿ªÊ¼£®

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
# /etc/ppp/options -*- sh -*- general options for pppd
# created 13-Jul-1995 jmk
# autodate: 01-Aug-1995
# autotime: 19:45

# Use the executable or shell command specified to set up the serial
# line.  This script would typically use the "chat" program to dial the
# modem and start the remote ppp session.
#connect "echo You need to install a connect command."

# Run the executable or shell command specified after pppd has
# terminated the link.  This script could, for example, issue commands
# to the modem to cause it to hang up if hardware modem control signals
# were not available.
#disconnect "chat -- \d+++\d\c OK ath0 OK"

# async character map -- 32-bit hex; each bit is a character
# that needs to be escaped for pppd to receive it.  0x00000001
# represents '\x01', and 0x80000000 represents '\x1f'.
#asyncmap 0

# Require the peer to authenticate itself before allowing network
# packets to be sent or received.
#auth

# Use hardware flow control (i.e. RTS/CTS) to control the flow of data
# on the serial port.
#crtscts

# Use software flow control (i.e. XON/XOFF) to control the flow of data
# on the serial port.
#xonxoff

# Add a default route to the system routing tables, using the peer as
# the gateway, when IPCP negotiation is successfully completed.  This
# entry is removed when the PPP connection is broken.
#defaultroute

# Specifies that certain characters should be escaped on transmission
# (regardless of whether the peer requests them to be escaped with its
# async control character map).  The characters to be escaped are
# specified as a list of hex numbers separated by commas.  Note that
# almost any character can be specified for the escape option, unlike
# the asyncmap option which only allows control characters to be
# specified.  The characters which may not be escaped are those with hex
# values 0x20 - 0x3f or 0x5e.
#escape 11,13,ff

# Don't use the modem control lines.
#local

# Specifies that pppd should use a UUCP-style lock on the serial device
# to ensure exclusive access to the device.
#lock

# Use the modem control lines.  On Ultrix, this option implies hardware
# flow control, as for the crtscts option.  (This option is not fully
# implemented.)
#modem

# Set the MRU [Maximum Receive Unit] value to <n> for negotiation.  pppd
# will ask the peer to send packets of no more than <n> bytes. The
# minimum MRU value is 128.  The default MRU value is 1500.  A value of
# 296 is recommended for slow links (40 bytes for TCP/IP header + 256
# bytes of data).
#mru 542

# Set the interface netmask to <n>, a 32 bit netmask in "decimal dot"
# notation (e.g. 255.255.255.0).
#netmask 255.255.255.0

# Disables the default behaviour when no local IP address is specified,
# which is to determine (if possible) the local IP address from the
# hostname. With this option, the peer will have to supply the local IP
# address during IPCP negotiation (unless it specified explicitly on the
# command line or in an options file).
#noipdefault

# Enables the "passive" option in the LCP.  With this option, pppd will
# attempt to initiate a connection; if no reply is received from the
# peer, pppd will then just wait passively for a valid LCP packet from
# the peer (instead of exiting, as it does without this option).
#passive

# With this option, pppd will not transmit LCP packets to initiate a
# connection until a valid LCP packet is received from the peer (as for
# the "passive" option with old versions of pppd).
#silent

# Don't request or allow negotiation of any options for LCP and IPCP
# (use default values).
#-all

# Disable Address/Control compression negotiation (use default, i.e.
# address/control field disabled).
#-ac

# Disable asyncmap negotiation (use the default asyncmap, i.e. escape
# all control characters).
#-am

# Don't fork to become a background process (otherwise pppd will do so
# if a serial device is specified).
#-detach

# Disable IP address negotiation (with this option, the remote IP
# address must be specified with an option on the command line or in an
# options file).
#-ip

# Disable magic number negotiation.  With this option, pppd cannot
# detect a looped-back line.
#-mn

# Disable MRU [Maximum Receive Unit] negotiation (use default, i.e.
# 1500).
#-mru

# Disable protocol field compression negotiation (use default, i.e.
# protocol field compression disabled).
#-pc

# Require the peer to authenticate itself using PAP.
# This requires TWO WAY authentication - do NOT use this for a standard
# PAP authenticated link to an ISP as this will require the ISP machine
# to authenticate itself to your machine (and it will not be able to).
#+pap

# Don't agree to authenticate using PAP.
#-pap

# Require the peer to authenticate itself using CHAP [Cryptographic
# Handshake Authentication Protocol] authentication.
# This requires TWO WAY authentication - do NOT use this for a standard
# CHAP authenticated link to an ISP as this will require the ISP machine
# to authenticate itself to your machine (and it will not be able to).
#+chap

# Don't agree to authenticate using CHAP.
#-chap

# Disable negotiation of Van Jacobson style IP header compression (use
# default, i.e. no compression).
#-vj

# Increase debugging level (same as -d).  If this option is given, pppd
# will log the contents of all control packets sent or received in a
# readable form.  The packets are logged through syslog with facility
# daemon and level debug. This information can be directed to a file by
# setting up /etc/syslog.conf appropriately (see syslog.conf(5)).  (If
# pppd is compiled with extra debugging enabled, it will log messages
# using facility local2 instead of daemon).
#debug

# Append the domain name <d> to the local host name for authentication
# purposes.  For example, if gethostname() returns the name porsche,
# but the fully qualified domain name is porsche.Quotron.COM, you would
# use the domain option to set the domain name to Quotron.COM.
#domain <d>

# Enable debugging code in the kernel-level PPP driver.  The argument n
# is a number which is the sum of the following values: 1 to enable
# general debug messages, 2 to request that the contents of received
# packets be printed, and 4 to request that the contents of transmitted
# packets be printed.
#kdebug n

# Set the MTU [Maximum Transmit Unit] value to <n>. Unless the peer
# requests a smaller value via MRU negotiation, pppd will request that
# the kernel networking code send data packets of no more than n bytes
# through the PPP network interface.
#mtu <n>

# Set the name of the local system for authentication purposes to <n>.
# This will probably have to be set to your ISP user name if you are
# using PAP/CHAP.
#name <n>

# Set the user name to use for authenticating this machine with the peer
# using PAP to <u>.
# Do NOT use this if you are using 'name' above!
#user <u>

# Enforce the use of the host name as the name of the local system for
# authentication purposes (overrides the name option).
#usehostname

# Set the assumed name of the remote system for authentication purposes
# to <n>.
#remotename <n>

# Add an entry to this system's ARP [Address Resolution Protocol]
# table with the IP address of the peer and the Ethernet address of this
# system.
#proxyarp

# Use the system password database for authenticating the peer using
# PAP.
#login

# If this option is given, pppd will send an LCP echo-request frame to
# the peer every n seconds. Under Linux, the echo-request is sent when
# no packets have been received from the peer for n seconds. Normally
# the peer should respond to the echo-request by sending an echo-reply.
# This option can be used with the lcp-echo-failure option to detect
# that the peer is no longer connected.
#lcp-echo-interval <n>

# If this option is given, pppd will presume the peer to be dead if n
# LCP echo-requests are sent without receiving a valid LCP echo-reply.
# If this happens, pppd will terminate the connection.  Use of this
# option requires a non-zero value for the lcp-echo-interval parameter.
# This option can be used to enable pppd to terminate after the physical
# connection has been broken (e.g., the modem has hung up) in
# situations where no hardware modem control lines are available.
#lcp-echo-failure <n>

# Set the LCP restart interval (retransmission timeout) to <n> seconds
# (default 3).
#lcp-restart <n>

# Set the maximum number of LCP terminate-request transmissions to <n>
# (default 3).
#lcp-max-terminate <n>

# Set the maximum number of LCP configure-request transmissions to <n>
# (default 10).
# Some PPP servers are slow to start up. You may need to increase this
# if you keep getting 'serial line looped back' errors and your are SURE
# that you have logged in correctly and PPP should be starting on the server.
#lcp-max-configure <n>

# Set the maximum number of LCP configure-NAKs returned before starting
# to send configure-Rejects instead to <n> (default 10).
#lcp-max-failure <n>

# Set the IPCP restart interval (retransmission timeout) to <n>
# seconds (default 3).
#ipcp-restart <n>

# Set the maximum number of IPCP terminate-request transmissions to <n>
# (default 3).
#ipcp-max-terminate <n>

# Set the maximum number of IPCP configure-request transmissions to <n>
# (default 10).
#ipcp-max-configure <n>

# Set the maximum number of IPCP configure-NAKs returned before starting
# to send configure-Rejects instead to <n> (default 10).
#ipcp-max-failure <n>

# Set the PAP restart interval (retransmission timeout) to <n> seconds
# (default 3).
#pap-restart <n>

# Set the maximum number of PAP authenticate-request transmissions to
# <n> (default 10).
#pap-max-authreq <n>

# Set the CHAP restart interval (retransmission timeout for
# challenges) to <n> seconds (default 3).
#chap-restart <n>

# Set the maximum number of CHAP challenge transmissions to <n>
# (default 10).
#chap-max-challenge

# If this option is given, pppd will re-challenge the peer every <n>
# seconds.
#chap-interval <n>

# With this option, pppd will accept the peer's idea of our local IP
# address, even if the local IP address was specified in an option.
#ipcp-accept-local

# With this option, pppd will accept the peer's idea of its (remote) IP
# address, even if the remote IP address was specified in an option.
#ipcp-accept-remote
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}







\subsection{ÎÒÓ¦¸ÃÊ¹ÓÃÊ²÷áÑ¡Ïî? (ÎÞ PAP/CHAP)}

àÅ£¬ÍêÈ«ÊÓÇé¿ö¶ø¶¨£¨°¦£©£®ÕâÀïËùÌá¹©µÄÓ¦¸ÃÊÊÓÃì¶´ó²¿·ÝµÄËÅ·þÆ÷£®



È»¶ø£¬Èç¹ûËüÎÞ·¨ÔË×÷µÄ»°£¬ÔÄ¶ÁÑù°åµµ({\ttfamily /etc/ppp/options.tpl}) {\bfseries ÒÔ¼°} pppd µÄÏßÉÏÊ¹ÓÃÊÖ²á{\bfseries ²¢ÇÒ}¸æËßÄãËùÁ¬ÏßÖ®ËÅ·þÆ÷µÄÏµÍ³¹ÜÀí£¯Ê¹ÓÃÕßÖ§Ô®ÈËÔ±£®



Äã»¹Ó¦¸Ã×¢ÒâÕâÀïËùÕ¹Ê¾µÄÁ¬½áÖ¸Áî¸åÒ²Ê¹ÓÃÁËÒ»Ð©¸ø pppd µÄÃüÁîÁÐÑ¡ÏîÒÔ±ãÈÃÊÂÇéÈÝÒ×µ÷ÕûÐ©£®

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
# /etc/ppp/options (NO PAP/CHAP)
#
# ±ÜÃâ pppd ½øÈë±³¾°Ö´ÐÐ
-detach
#
# Ê¹ÓÃÊý¾Ý»ú¿ØÖÆÏß
modem
# Ê¹ÓÃ uucp ÐÎÌ¬µÄËø¶¨µµÒÔ±ÜÃâËüÈËÈ¡ÓÃ´®ÁÐ×°ÖÃ
lock
# Ê¹ÓÃÓ²ÌåÁ÷Á¿¿ØÖÆ
crtscts
# ÔÚµÝËÍ±í¸ñÖÐ½«´ËÁ¬½á½¨Á¢ÎªÔ¤ÉèµÝËÍ×°ÖÃ
defaultroute
# ²»Ê¹ÓÃÈÎºÎ"ÒÝ³ö"¿ØÖÆÐòÁÐ
asyncmap 0
# ×î´ó´«ËÍ·â°ü´óÐ¡Îª 552 bytes
mtu 552
# ×î´ó½ÓÊÕ·â°ü´óÐ¡Îª 552 bytes
mru 552
#
#-------END OF SAMPLE /etc/ppp/options (no PAP/CHAP)
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}





\section{Èç¹ûÄãµÄ PPP ËÅ·þÆ÷Ê¹ÓÃ PAP ÈÏÖ¤(Password Authentication Protocol)\label{pap}}

Èç¹ûÄãÁ¬½ÓµÄËÅ·þÆ÷ÐèÒª PAP »ò CHAP ÈÏÖ¤£¬ÄãÐèÒª¶àÒ»µãµÄ¹¤×÷£®



ÔÚÉÏÃæµÄÑ¡Ïîµµ°¸ÖÐ£¬¼ÓÉÏÏÂÃæ¼¸ÐÐ
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
#
# ¸æËß pppd Ê¹ÓÃÄãµÄ ISP Ãû³Æ×öÎªÈÏÖ¤¹ý³ÌÖÐµÄ"Ö÷»úÃû³Æ"
name <your ISP user name>       # ÄãÐèÒª¸Ä±äÕâÒ»ÐÐ
#
# Èç¹ûÄãÖ´ÐÐ PPP *ËÅ·þÆ÷* ²¢ÇÒÐèÒªÊ¹ÓÃ PAP »ò CHAP ÈÏÖ¤£¬ÊÊµ±³ýÈ¥ÏÂÃæµÄ
# ×¢½â£®²»ÒªÔÚÄã×öÎª¿Í»§¶ËÁ¬ÉÏËÅ·þÆ÷Ê±Ê¹ÓÃ´ËÑ¡Ïî(¼´Ê¹ËüÊ¹ÓÃ PAP »ò CHAP)
# ÒòÎªÕâÊÇ¸æËßËÅ·þÆ÷±ØÐëÎªËü×Ô¼ºÔÚÄãµÄ»úÆ÷ÉÏÌá¹©ÈÏÖ¤(Õâ¼¸ºõÊÇ²»¿ÉÄÜµÄ£¬
# ËùÒÔÁ¬½á»áÊ§°Ü)£®
#+chap
#+pap
#
# Èç¹ûÄãÊ¹ÓÃÔÚ /etc/ppp/pap-secrets µµ°¸ÖÐ¾­±àÂëµÄÃÜÂë£¬³ýÈ¥ÏÂÃæÒ»ÐÐµÄ×¢½â£®
# ×¢Òâ: ÕâºÍ Windows NT ÉÏµÄÔ¶¶Ë´æÈ¡·þÎñÀïµÄÎ¢Èí±àÂëÃÜÂëÊÇ²»Í¬µÄ£®
#+papcrypt
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}





\subsection{Ê¹ÓÃ MSCHAP}

Î¢ÈíµÄ Windows NT Ô¶¶Ë´æÈ¡·þÎñ(RAS)¿ÉÒÔ±»Éè¶¨ÎªÊ¹ÓÃÒ»ÖÖ CHAP(Challenge/Handshake Authentication Protocol) µÄ±äÖÖ£®
ÔÚÄãµÄ PPP Ô­Ê¼³ÌÊ½ÂëÖÐ£¬Äã¿ÉÒÔÕÒµ½Ò»¸ö½Ð {\ttfamily README.MSCHAP80} µÄµµ°¸ÌÖÂÛÕâ¼þÊÂ£®



Äã¿ÉÒÔ¿ªÆô pppd µÄÕì´í¹¦ÄÜÅÐ¶ÏËÅ·þÆ÷ÊÇ·ñÒªÇóÊ¹ÓÃ´ËÈÏÖ¤Ð­¶¨£®
Èç¹ûËÅ·þÆ÷Ê¹ÓÃ MS CHAP ÈÏÖ¤£¬Äã»á¿´µ½ÕâÑùµÄÒ»ÐÐ
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
rcvd [LCP ConfReq id=0x2 <asyncmap 0x0> <auth chap 80> <magic 0x46a3>]
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




¹Ø¼üµÄÑ¶Ï¢ÊÇ {\bfseries auth chap 80}£®



ÎªÁËÊ¹ÓÃ MS CHAP£¬Äã±ØÐëÖØÐÂ±àÒë pppd ÒÔÖ§Ô®´ËÐ­¶¨£®
Çë²Î¼û PPP Ô­Ê¼³ÌÊ½ÂëÖÐµÄ {\ttfamily README.MSCHAP80} ËµÃ÷ÈçºÎ±àÒëÒÔÊ¹ÓÃ´Ë±äÖÖÐ­¶¨£®



Äã»¹Òª×¢ÒâÕâÀïµÄ³ÌÊ½ÂëÖ»ÊÇÈÃ Linux PPP ×öÎª¿Í»§¶ËÁ¬½ÓÉÏ MS Windows NT ËÅ·þÆ÷ÓÃµÄ£®
Ëü{\bfseries ²¢²»}Ö§Ô®½« Linux ÉèÁ¢ÎªÈÃ¿Í»§¶ËÊ¹ÓÃ MSCHAP80 ÈÏÖ¤ PPP ËÅ·þÆ÷£®




\subsection{PAP/CHAP ÃÜÂëµµ°¸}

Èç¹ûÄãÊ¹ÓÃ PAP »ò CHAP ÈÏÖ¤£¬Äã±ØÐë½¨Á¢ÕâÐ©ÃÜÂëµµ°¸£®ËüÃÇÊÇ:
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
/etc/ppp/pap-secrets
/etc/ppp/chap-secrets
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ÕâÐ©µµ°¸ÓµÓÐÕß±ØÐëÎª root£¬Èº×éÎª root£¬Í¬Ê±ÎªÁË°²È«µµ°¸È¨ÏÞÓ¦Îª 740£®



¹Øì¶ PAP Óë CHAP µÚÒ»µãÒªÖ¸³öµÄÊÇËüÃÇÊÇÉè¼ÆÓÃÀ´ÈÏÖ¤{\bfseries µçÄÔÏµÍ³}¶ø²»ÊÇ{\bfseries Ê¹ÓÃÕß}µÄ£®



"àÅ? ÓÐÊ²÷á²»Í¬ÄØ?" ÎÒÌýµ½ÄãÔÚÎÊ£®



Å¶£¬Ò»µ©ÄãµÄµçÄÔ½¨Á¢ÓëËÅ·þÆ÷½¨Á¢ PPP Á¬Ïß£¬ÄãÏµÍ³ÉÏµÄ{\bfseries ÈÎºÎ}Ê¹ÓÃÕß¶¼¿ÉÒÔÊ¹ÓÃ´ËÁ¬Ïß - ²»Ö»ÊÇÄã¶øÒÑ£®
ÕâÒ²ÊÇÎªºÎÄã¿ÉÒÔÊ¹ÓÃ PPP ½«Á½¸öÇøÓòÍøÂ·(LAN)Á¬½ÓÆðÀ´½¨Á¢Ò»¹ãÓòÍøÂ·(WAN)µÄÔ­Òò£®



PAP (»¹ÓÐ CHAP {\bfseries Ò²ÊÇ})ÐèÒª{\bfseries Ë«Ïò}ÈÏÖ¤ - Ò²¾ÍÊÇÃ¿Ò»µçÄÔÐèÒªÒ»¸öºÏ·¨µÄÃû³ÆÓëÃÜÂëÔÚÁíÒ»µçÄÔÉÏ£®
È»¶ø£¬Õâ{\bfseries ²¢²»ÊÇ}´ó²¿·ÝÌá¹©²¦½ÓÊ½ PAP ÈÏÖ¤Á¬½ÓµÄ PPP ËÅ·þÆ÷ÔË×÷µÄ·½Ê½£®



Ò²¾ÍÊÇËµ£¬ÄãµÄ ISP ¿ÉÄÜ»á¸øÄãÒ»¸öÊ¹ÓÃÕßÃû³ÆÓëÃÜÂëÒÔÔÊÐíÄãÁ¬½Óµ½ËûÃÇµÄÏµÍ³½ø¶øÁ¬½Óµ½Íø¼ÊÍøÂ·ÉÏ£®
ÄãµÄ ISP ¶Ôì¶ÄãµçÄÔµÄÃû³ÆÒ»µãÒ²²»¸ÐÐËÈ¤£¬Òò´ËÄã¿ÉÄÜ±ØÐëÊ¹ÓÃÄãÔÚ ISP ÉÏµÄÊ¹ÓÃÕßÃû³Æ×öÎªÄãµçÄÔµÄÃû³Æ£®



ÕâµãÒªÊ¹ÓÃ pppd Ñ¡ÏîµÄ {\ttfamily name user name} À´´ï³É£®
Òò´Ë£¬Èç¹ûÄãÊ¹ÓÃÄã ISP ¸øÄãµÄÊ¹ÓÃÕßÃû³Æ£¬¼ÓÉÏÕâÒ»ÐÐ
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
name your_user name_at_your_ISP
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


µ½ÄãµÄ {\ttfamily /etc/ppp/options} µµ°¸ÖÐ£®



´Ó¼¼ÊõÉÏÀ´Ëµ£¬PAP ÆäÊµÓ¦¸ÃÒªÊ¹ÓÃ {\ttfamily user our\_user name\_at\_your\_ISP} Õâ¸öÑ¡Ïî£¬µ«ÊÇÈç¹ûÊ¹ÓÃµ½ PAP µÄ»°ÄÇ÷á pppd ´ÏÃ÷µÄ×ãÒÔ°Ñ {\ttfamily name} ½âÒëÎª {\ttfamily user}£®
Ê¹ÓÃ {\ttfamily name} Õâ¸öÑ¡ÏîµÄºÃ´¦ÊÇÕâ¶Ôì¶ CHAP Ò²ÊÇÓÐÐ§µÄ£®



ÒòÎª PAP/CHAP ÊÇÓÃÀ´ÑéÈÏ{\bfseries µçÄÔ}µÄ£¬ÔÚ¼¼ÊõÉÏÄãÒ²ÐèÒªÖ¸¶¨Ô¶¶ËµçÄÔµÄÃû³Æ£®
È»¶ø£¬´ó²¿·ÖµÄÈËÖ»½ÓÒ»¼Ò ISP  ËùÒÔÄã¿ÉÒÔÔÚÃÜÂëµµÀïµÄÔ¶¶ËÖ÷»úÃû³ÆÊ¹ÓÃÍ¨ÓÃ×ÖÔª(*) £®



Ðí¶à ISP ÓÐ¶à¸öÊý¾Ý»ú²¦½ÓÖÐÐÄÁ¬½Óµ½²»Í¬µÄÖÕ¶Ë»úËÅ·þÆ÷ £­ Ã¿¸öÖÕ¶Ë»úËÅ·þÆ÷¶¼ÓÐ²»Í¬µÄÃû³Æ£¬µ«¶¼´Óµ¥Ò»µÄ£¨×Ô¶¯×ªÏß£©ºÅÂë²¦½Ó£®
ÔÚÄ³Ð©ÇéÐÎÏÂ¿ÉÄÜÒò´Ë¶øºÜ²»ÈÝÒ×Ô¤ÏÈÖªµÀÔ¶¶ËµçÄÔµÄÃû³Æ!




\subsection{PAP ÃÜÂëµµ}

{\ttfamily /etc/ppp/pap-secrets} Õâ¸öµµ°¸¿´ÆðÀ´Ïñ
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
# Secrets for authentication using PAP
# client        server       secret     acceptable_local_IP_addresses
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ÕâËÄ¸öÀ¸Î»ÊÇÒÔ¿Õ°×·Ö½ç¶øÇÒ×îááÒ»Ïî¿ÉÒÔÊÇ¿Õ°×(Èç¹ûÄãÊ¹ÓÃ¶¯Ì¬ IP »òÓÉÄãµÄ ISP ËùÌá¹©µÄ¾²Ì¬ IP)£®



¼Ù¶¨ÄãµÄ ISP ¸øÄãµÄÊ¹ÓÃÕßÃû³ÆÊÇ {\ttfamily fred} ¶øÃÜÂëÊÇ {\ttfamily flintstone} µÄ»°ÄÇ÷áÄãÓ¦¸ÃÔÚ {\ttfamily /etc/ppp/options[.ttySx]} ÀïÉè¶¨ {\ttfamily name fred} Õâ¸öÑ¡Ïî²¢ÇÒ°ÑÄãµÄ {\ttfamily /etc/ppp/pap-secrets} µµ°¸Éè³ÉÏÂÃæÕâÑù

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
# Secrets for authentication using PAP
# client        server  secret          acceptable local IP addresses
fred            *       flintstone
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ÕâÊÇËµ¶Ôì¶ {\ttfamily fred} Õâ¸ö±¾µØ»úÆ÷Ãû³Æ£¨ÎÒÃÇÒÑ¾­¸æËß¹ý pppd Ê¹ÓÃÕâ¸öÃû³Æ£¬¼´Ê¹Õâ²»ÊÇÎÒÃÇ±¾µØ»úÆ÷µÄÃû³ÆÒ²Ò»Ñù£©ÒÔ¼°{\bfseries ÈÎºÎ}µÄËÅ·þÆ÷£¬¶¼Ê¹ÓÃ {\ttfamily flintstone} Õâ¸öÃÜÂë£¨°µÂë£©£®



×¢Òâµ½ÎÒÃÇ²¢²»ÐèÒªÖ¸¶¨±¾µØµÄ IP Î»Ö·£¬³ý·ÇÓÐÒªÇóÒªÎÒÃÇÊ¹ÓÃÒ»¸öÌØ¶¨µÄ£¬¹Ì¶¨µÄ IP Î»Ö·£®
¼´Ê¹ÄãÊÔÖøÓÃÒ»¹Ì¶¨µÄ IP£¬ÕâÒ²²»´ó¿ÉÄÜÐÐµÃÍ¨ÒòÎª¶Ôì¶´ó²¿·ÝµÄ PPP ËÅ·þÆ÷(ÎªÁË°²È«µÄÀíÓÉ)²»ÔÊÐíÔ¶¶ËÏµÍ³×ÔÐÐÖ¸¶¨ IP ºÅÂë£®




\subsection{CHAP ÃÜÂëµµ}

Ä¿Ç°µÄ pppd °æ±¾ÒªÇóÄãÒªÓÐ»¥ÏàÑéÈÏµÄ·½·¨ £­ ÕâÊÇËµÄã±ØÐëÄÜ¹»ÈÃ´ÓÄãµÄ»úÆ÷µ½Ô¶¶ËËÅ·þÆ÷{\bfseries ÒÔ¼°}´ÓÔ¶¶ËËÅ·þÆ÷µ½ÄãµÄ»úÆ÷ÕâÁ½ÖÖÑéÈÏ¶¼ÄÜ½øÐÐ£®



ËùÒÔ£¬Èç¹ûÄãµÄ»úÆ÷ÊÇ {\ttfamily fred} ¶øÔ¶¶ËÊÇ {\ttfamily barney} µÄ»°£¬ÔòÔÚËüÃÇ¸ö±ðµÄ {\ttfamily /etc/ppp/options.ttySx} ÀïÄãµÄÉèÎª {\ttfamily name fred remotename barney} ¶øÔ¶¶Ë»úÆ÷Ó¦ÉèÎª {\ttfamily name barney remotename fred}£®



fred ÕâÌ¨»úÆ÷µÄ {\ttfamily /etc/ppp/chap-secrets} µµ°¸¿´ÆðÀ´»áÏñ
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
# Secrets for authentication using CHAP
# client        server  secret            acceptable local IP addresses
fred            barney  flintstone
barney          fred    wilma
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




¶ø barney µÄÊÇ

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
# Secrets for authentication using CHAP
# client        server  secret            acceptable local IP addresses
barney          fred    flintstone
fred            barney  wilma
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ÌØ±ðÒª×¢ÒâµÄÊÇË«·½»úÆ÷¶¼±ØÐë¾ßÓÐË«ÏòÈÏÖ¤µÄÏîÄ¿£®ÕâÔÊÐí±¾µØµÄ»úÆ÷ÏòÔ¶¶Ë»úÆ÷ÈÏÖ¤Ëü×Ô¼º{\bfseries ²¢ÇÒ}ÈÃÔ¶µØ»úÆ÷Ïò±¾µØ»úÆ÷ÈÏÖ¤Ëü×Ô¼º£®




\subsection{´¦Àí¶àÖØ PAP ÈÏÖ¤Á¬½Ó}

Ò»Ð©Ê¹ÓÃÕßÓµÓÐ¶àì¶Ò»²¿Ê¹ÓÃ PAP µÄËÅ·þÆ÷¿ÉÁ¬Ïß£®
Èç¹ûÄãµÄÊ¹ÓÃÕßÃû³ÆÔÚÃ¿²¿ÄãÏëÁ¬½ÓµÄ»úÆ÷ÉÏ¶¼²»Í¬£¬Õâ²¢²»ÊÇÎÊÌâ£®



È»¶ø£¬Ðí¶àÊ¹ÓÃÕßÔÚÁ½¸öÏµÍ³(»òÕßÉõÖÁÊÇÈ«²¿)ÉÏ¾ßÓÐÏàÍ¬µÄÊ¹ÓÃÕßÃû³Æ£®
ÕâÔÚ´Ó {\ttfamily /etc/ppp/pap-secrets} ÖÐÕýÈ·µØÑ¡ÔñÊÊµ±Ò»ÐÐÊ±»áÓÐÎÊÌâ£®



ÈçÄãËùÁÏµØ£¬PPP Ìá¹©Ò»ÖÖ»úÖÆÒÔ¿Ë·þ´ËÒòÄÑ£®
PPP ÔÊÐíÄãÊ¹ÓÃ {\bfseries remotename} Ñ¡ÏîÎªÔ¶¶ËËÅ·þÆ÷Éè¶¨Ò»¸ö"¼ÙÏëÃû³Æ"£®



¼ÙÉèÄãÁ¬½Óµ½Á½²¿ PPP ËÅ·þÆ÷¶¼Ê¹ÓÃÃû³Æ fred£®ÄãÒÔ´Ë·½Ê½½¨Á¢ {\ttfamily /etc/ppp/pap-secrets} µµ°¸
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
fred    pppserver1      barney
fred    pppserver2      wilma
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




Èç´Ë£¬ÔÚÓë pppserver1 Á¬ÏßÊ±ÄãÔÚ pppd Ñ¡ÏîÖÐÊ¹ÓÃ {\ttfamily name fred remotename pppserver1} ²¢ÔÚÁ¬Ïß pppserver2 Ê±Ê¹ÓÃ {\ttfamily name fred remotename pppserver2}£®



ÒòÎªÄã¿ÉÒÔÊ¹ÓÃÔÚ pppd Ê¹ÓÃ {\ttfamily file filename} ÒÔÖ¸¶¨ ppp Ñ¡Ïî£¬Äã¿ÉÒÔ½¨Á¢Ò»Ö¸Áî¸åÒÔÁ¬½Óµ½Ã¿²¿ PPP ËÅ·þÆ÷£¬ÕýÈ·µØÈ¡ÓÃÑ¡Ïîµµ°¸²¢ÇÒÑ¡ÔñÕýÈ·µÄ {\ttfamily remotename} Ñ¡Ïî£®




\section{ÒÔÊÖ¶¯·½Ê½½¨Á¢ PPP Á¬½á\label{manual}}

ÏÖÔÚÄãÒÑ¾­½¨Á¢ÄãµÄ {\ttfamily /etc/ppp/options} ÒÔ¼° {\ttfamily /etc/resolv.conf} µµ°¸£¨ÒÔ¼°£¬Èç¹ûÓÐÐèÒª£¬»¹ÓÐ {\ttfamily /etc/ppp/pap$|$chap-secrets} µµ°¸£©£¬Äã¿ÉÒÔ½åÓÉÊÖ¶¯ÉèÁ¢ PPP Á¬ÏßÀ´²âÊÔÕâÐ©Éè¶¨£¨Ò»µ©ÎÒÃÇÊ¹ÊÖ¶¯Á¬ÏßÄÜÔË×÷£¬ÎÒÃÇ½«»á×Ô¶¯»¯¸Ã¹ý³Ì£©£®



Òª×öÕâ¼þÊÂ£¬ÄãµÄÍ¨Ñ¶ÈíÌå±ØÐëÄÜÔÚ²»ÖØÖÃÄãµÄÊý¾Ý»úµÄÇé¿öÏÂ½áÊø£®
Minicom ¿ÉÒÔ×öµ½ £­ {\ttfamily ALT Q} £¨»òÕßÔÚ±È½Ï¾ÉµÄ minicom  °æ±¾ÊÇÊ¹ÓÃ {\ttfamily CTRL A Q}£©£®



È·¶¨ÄãÒÔ root Ç©Èë£®



Æô¶¯ÄãµÄÍ¨Ñ¶ÈíÌå£¨ÏñÊÇ minicom£©£¬²¦½Óµ½ PPP ËÅ·þÆ÷²¢ÇÒÏñÆ½³£Ò»ÑùµÄÇ©Èë£®
Èç¹ûÄãÐèÒª·¢³öÄ³¸öÖ¸ÁîÀ´Æð¶¯ËÅ·þ¶ËÉÏµÄ PPP£¬ÄÇ÷á¾Í×ö°É£®Äã½«»á¿´¼ûÄãÒÔÇ°¿´¹ýµÄÀ¬»ø£®



Èç¹ûÄãÊ¹ÓÃ PAP »ò CHAP µÄ»°£¬ÄÇ÷áÖ»ÊÇÁ¬Ïßµ½Ô¶¶ËÏµÍ³Ó¦¸Ã¾Í»áÆð¶¯ÔÚÔ¶¶ËÉÏµÄ PPP ¶øÇÒÄã½«ÔÚÃ»ÓÐÇ©ÈëµÄÇé¿öÏÂ¾Í¼ûµ½ÕâÐ©À¬»ø£¨ËäÈ»ÕâÔÚÄ³Ð©ËÅ·þÆ÷ÉÏ²»»á·¢Éú - ÊÔÖø°´ÏÂ {\bfseries Enter} ¿´¿´ÄÜ·ñ¿´µ½ÕâÐ©À¬»ø£©£®



ÏÖÔÚ£¬ÔÚ²»ÒªÖØÖÃÊý¾Ý»úµÄÇé¿öÏÂ½áÊøÍ¨Ñ¶ÈíÌå(ÔÚ minicom Ê¹ÓÃ {\ttfamily ALT Q} »ò {\ttfamily CTL A Q})²¢ÇÒÔÚ Linux µÄÌáÊ¾·ûºÅÏÂ£¨ÒÔ root µÄÉí·Ö£©¼üÈë

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
pppd -d -detach /dev/ttySx 38400 &
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




{\ttfamily -d} Õâ¸öÑ¡Ïî¿ªÆôÕì´í¹¦ÄÜ £­ ppp Á¬ÏßÆð¶¯Ê±µÄ¡±½»Ì¸¡±½«»á¼ÇÂ¼µ½ÄãµÄÏµÍ³¼ÇÂ¼ÀïÈ¥ £­ Èç¹ûÄãÓöÉÏÂé·³Õâ»áºÜÓÐÓÃµÄ£®



ÄãÊý¾Ý»úµÄµÆÏÖÔÚÓ¦¸ÃÒªÉÁË¸£¬ÒòÎªÒª½¨Á¢ PPP Á¬Ïß£®PPP Á¬ÏßµÄ½¨Á¢½«»á»¨µãÊ±¼ä£®



´ËÊ±Äã¿ÉÒÔ¹Û²ì PPP ½çÃæ£¬½åÓÉ·¢³öÕâ¸öÖ¸Áî

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
ifconfig
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ÔÚÄãËùÓµÓÐµÄÈÎºÎÒÒÌ«ÍøÂ·ÒÔ¼°»ØÊÚÉè±¸Ö®Íâ£¬ÄãÓ¦¸Ã»á¿´¼ûÏñÕâÑùµÄ×ÊÑ¶:
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
ppp0     Link encap:Point-Point Protocol
         inet addr:10.144.153.104  P-t-P:10.144.153.51 Mask:255.255.255.0
         UP POINTOPOINT RUNNING  MTU:552  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0
         TX packets:0 errors:0 dropped:0 overruns:0
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ÆäÖÐ
\begin{itemize}
\item inet addr:10.144.153.10 ÊÇ¸ÃÁ¬½áÖÐÄãÕâ¶ËµÄ IP ºÅÂë£®
\item P-t-P:10.144.153.5 ÊÇËÅ·þ¶ËµÄ IP ºÅÂë£®
\end{itemize}


(×ÔÈ»£¬ ifconfig ²»»á±¨¸æÕâÐ© IP ºÅÂë£¬¶øÊÇÄãµÄ PPP ËÅ·þÆ÷ÉÏÊ¹ÓÃµÄ£®)



×¢Òâ:  ifconfig Ò²¸æËßÄã¸ÃÁ¬½áÒÑ¾­Æð¶¯²¢ÇÒÕýÔÚÖ´ÐÐ!



Èç¹ûÃ»ÓÐ ppp ×°ÖÃÁÐ³ö»òµÃµ½µÄÊÇÏñÕâÑùµÄ×ÊÑ¶:

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
ppp0     Link encap:Point-Point Protocol
         inet addr:0.0.0.0  P-t-P:0.0.0.0  Mask:0.0.0.0
         POINTOPOINT  MTU:1500  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0
         TX packets:0 errors:0 dropped:0 overruns:0
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ÄãµÄ PPP Á¬Ïß²¢Ã»ÓÐ½¨Á¢... ²ÎÔÄÉÔááÓÐ¹Ø´íÎóÅÅ³ýµÄÕÂ½Ú!



Äã»¹¿ÉÒÔ¿´µ½Õâ²¿Ô¶¶Ë»úÆ÷(¼°ÆäááµÄ)µÄµÝËÍÂ·¾¶£®Òª×öµ½Õâµã£¬ÏÂÕâ¸öÖ¸Áî

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
route -n
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ÄãÓ¦¸Ã¿´µ½ÏñÕâÑùµÄ:-

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
Kernel routing table
Destination     Gateway         Genmask         Flags MSS    Window Use Iface
10.144.153.3    *               255.255.255.255 UH    1500   0        1 ppp0
127.0.0.0       *               255.0.0.0       U     3584   0       11 lo
10.0.0.0        *               255.0.0.0       U     1500   0       35 eth0
default         10.144.153.3    *               UG    1500   0        5 ppp0
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ÌØ±ð×¢ÒâÕâÀï£¬ÎÒÃÇÓÐÁ½¸öÏîÄ¿Ö¸µ½ÎÒÃÇµÄ ppp ×°ÖÃ£®



µÚÒ»ÏîÊÇÖ÷»úµÝËÍ(ÒÔ H ÆìºÅ±íÊ¾)²¢ÇÒÔÊÐíÎÒÃÇ¿´µ½Õâ²¿ÎÒÃÇÕýÔÚÁ¬½ÓµÄÖ÷»ú - µ«ÔÙÀ´¾ÍÃ»ÓÐÁË£®



µÚ¶þÏîÊÇÔ¤ÉèµÝËÍÂ·¾¶(ÓÉ pppd µÄ {\ttfamily defaultroute} Ñ¡ÏîËù½¨Á¢µÄ)£®
Õâ·ÝµÝËÍÂ·¾¶¸æËßÎÒÃÇµÄ Linux PC ½«ÈÎºÎ²»ÔÚÄÚ²¿ÒÒÌ«ÍøÂ·µÄ·â°üËÍµ½ÄÇÀï - µ½ÎÒÃÇÖ¸¶¨µÄÍøÂ· - Ò²¾ÍÊÇµ½ PPP ËÅ·þÆ÷±¾Éí£®
¶ø PPP ËÅ·þÆ÷ÓÐÔðÈÎÎªÎÒÃÇ½«·â°üµÝËÍµ½Íø¼ÊÍøÂ·²¢½«»ØÓ¦µÄ·â°üËÍ»Ø¸øÎÒÃÇ£®



Èç¹ûÄãÔÚµÝËÍ±í¸ñÖÐÃ»¿´µ½Á½¸öÏîÄ¿£¬ÓÐÐ©ÊÂ²»¶Ô¾¢£®
ÌØ±ðÊÇÈç¹ûÄãµÄÏµÍ³¼ÇÂ¼(syslog)ÏÔÊ¾Ò»Ñ¶Ï¢¸æËßÄã pppd ÎÞ·¨È¡´úÒÑ´æÔÚµÄÔ¤ÉèµÝËÍÂ·¾¶£¬ÄÇ÷áÄãÒÑÓÐÒ»Ô¤ÉèµÝËÍÂ·¾¶Ö¸ÏòÄãµÄÒÒÌ«ÍøÂ·½çÃæ - 
¶øÕâ{\bfseries ±ØÐë}ÓÉÖ¸¶¨µÄÍøÂ·µÝËÍÀ´È¡´ú: {\bfseries ÄãÖ»ÄÜÓÐÒ»¸öÔ¤ÉèµÝËÍÂ·¾¶!!!}



Äã±ØÐë¼ì²éÒ»ÏÂÄãÏµÍ³µÄÆðÊ¼µµ°¸ÒÔÕÒ³öÔ¤ÉèµÝËÍÊÇÔÚÄÇÀï½¨Á¢µÄ(ÕâÊÇÓÉ {\ttfamily route add default...} Ö¸ÁîÖ¸¶¨µÄ)£®
½«Ëü¸Ä³ÉÏñÕâÑùµÄ {\ttfamily route add net...}£®



ÏÖÔÚ½åÓÉ ifconfig Ö®Êä³öËù»Ø±¨µÄ IP ºÅÂëÀ´ 'ping' Ò»ÏÂ¸ÃËÅ·þÆ÷ÒÔ²âÊÔÕâ¸öÁ¬½á£¬ÏñÕâÑù

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
ping 10.144.153.51
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ÄãÓ¦¸Ã»á½ÓÊÕµ½ÏñÕâÑùµÄÊä³ö

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
PING 10.144.153.51 (10.144.153.51): 56 data bytes
64 bytes from 10.144.153.51: icmp_seq=0 ttl=255 time=328.3 ms
64 bytes from 10.144.153.51: icmp_seq=1 ttl=255 time=190.5 ms
64 bytes from 10.144.153.51: icmp_seq=2 ttl=255 time=187.5 ms
64 bytes from 10.144.153.51: icmp_seq=3 ttl=255 time=170.7 ms
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




Õâ½«»áÒ»Ö±ÁÐÓ¡ÏÂÈ¥ £­ °´ÏÂ {\ttfamily CTRL C} ÖÕÖ¹Ëü£¬ÄÇÊ±Äã½«»á½ÓÊÕµ½¸ü¶àÑ¶Ï¢:

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
--- 10.144.153.51 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 170.7/219.2/328.3 ms
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




µ½Ä¿Ç°¶¼ºÜºÃ£®



ÏÖÔÚÊÔÖø½åÓÉÃû³Æ ping Ä³Ì¨Ö÷»ú£¨²»ÊÇ PPP  ËÅ·þÆ÷Ëü×Ô¼ºµÄÃû³Æ£¬¶øÊÇÔÚÁíÒ»¸öµØ·½µÄÒ»Ì¨ÄãÖªµÀ¿ÉÄÜÒÑ¾­Æð¶¯¶øÇÒÕýÔÚÔË×÷µÄÖ÷»ú£©£®ÀýÈç

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
ping sunsite.unc.edu
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ÕâÊ±»áÓÐÒ»µãÍ£¶Ù£¬ÒòÎª Linux  ´ÓÄãÔÚ {\ttfamily /etc/resolv.conf} ÀïÖ¸¶¨µÄ DNS È¡µÃÄãÒª 'ping' µÄÍêÕûÖ÷»úÃû³ÆËù¶ÔÓ¦µÄ IP Î»Ö· £­ ËùÒÔ²»Òªµ£ÐÄ£¨µ«ÊÇÄã½«»á¿´¼ûÄãµÄÊý¾Ý»úµÆºÅÉÁË¸£©£®
ÔÚ¶ÌÔÝµÄÊ±¼äááÄã½«»á½ÓÊÕµ½ÏñÕâÑùµÄÊä³ö

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
 PING sunsite.unc.edu (152.2.254.81): 56 data bytes
64 bytes from 152.2.254.81: icmp_seq=0 ttl=254 time=190.1 ms
64 bytes from 152.2.254.81: icmp_seq=1 ttl=254 time=180.6 ms
64 bytes from 152.2.254.81: icmp_seq=2 ttl=254 time=169.8 ms
64 bytes from 152.2.254.81: icmp_seq=3 ttl=254 time=170.6 ms
64 bytes from 152.2.254.81: icmp_seq=4 ttl=254 time=170.6 ms
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ÔÙÒ»´Î£¬½åÓÉ°´ÏÂ {\ttfamily CTRL C} ÖÕÖ¹Êä³ö²¢È¡µÃÍ³¼Æ×ÊÁÏ...

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
--- sunsite.unc.edu ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 169.8/176.3/190.1 ms
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




Èç¹ûÄãÃ»ÓÐÊÕµ½ÈÎºÎ»ØÓ¦£¬ÊÔÖø ping Ò»ÏÂÄãµÄ ISP Ìá¹©µÄ DNS µÄ IP Î»Ö·£®
Èç¹ûÄã´ÓÕâÀïµÃµ½¿Ï¶¨µÄ½á¹û£¬ÄÇ÷á¿´ÆðÀ´ÎÊÌâÔÚÄãµÄ {\ttfamily /etc/resolv.conf} µµ°¸Àï£®



Èç¹ûÕâÑù»áÃ»ÓÐ½á¹û£¬ÎÊÌâ³öÔÚÍøÂ·µÝËÍÉÏ£¬»òÕßÊÇÄãµÄ ISP ÔÚ½«·â°üµÝËÍ»Ø¸øÄãÊ±³öÁËÎÊÌâ£®
¼ì²éÉÏÃæµÄµÝËÍ±í¸ñ£¬Èç¹ûÃ»ÎÊÌâ£¬ºÍÄãµÄ ISP ÁªÂç£®Ò»¸ö²âÊÔ ISP µÄºÃ·½·¨ÊÇÓÃÁíÒ»ÖÖ×÷ÒµÏµÍ³À´Á¬½Ó£®
Èç¹ûÕâÑù¾Í¿ÉÒÔ¶¯£¬ÄÇ÷áÎÊÌâ¾ÍÔÚÄãÕâ±ß£®



Èç¹ûÒ»ÇÐÕý³££¬½åÓÉ¼üÈëÕâ¸öÖ¸ÁîÖÕÖ¹¸ÃÁ¬Ïß

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
ppp-off
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




Ò»¶Î¶ÌÔÝµÄÍ£¶ÙÖ®áá£¬Êý¾Ý»úÓ¦¸Ã»á×Ô¼º¹Ò¶Ïµç»°



Èç¹ûÕâ¸öÖ¸ÁîÎÞ·¨¶¯×÷µÄ»°£¬ÄÇ÷á²»ÊÇ¹ØµôÄãµÄÊý¾Ý»ú¾ÍÊÇÆð¶¯ÄãµÄÍ¨Ñ¶ÈíÌå²¢ÇÒÒÔ {\ttfamily +++} ÖÐ¶ÏÊý¾Ý»úÈ»ááµ±Äã½ÓÊÕµ½Êý¾Ý»úµÄ OK ÌáÊ¾Ê±ÒÔ {\ttfamily ATH0} ¹Ò¶Ïµç»°£®



Äã¿ÉÄÜÒ²µÃÇå³ý pppd Ëù½¨Á¢µÄËø¶¨µµ
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
rm -f /var/lock/LCK..ttySx
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}





\section{Ê¹ÄãµÄÁ¬½á×Ô¶¯»¯ - ´´ÔìÁ¬½áÖ¸Áî¸å\label{automate}}

Ò»µ©Äã¿ÉÒÔÓÃÉÏÊöµÄ·½·¨ÓÃÊÖ¶¯·½Ê½Ç©Èë£¬¸üºÃµÄ×ö·¨ÊÇ½¨Á¢Ò»Ð©Ö¸Áî¸åÀ´×Ô¶¯ÎªÄã½øÐÐÕâÐ©¹¤×÷£®

Ò»·Ý chat Ö¸Áî¸å¿ÉÒÔ×Ô¶¯»¯Ç©ÈëÒÔ¼°Æð¶¯ PPP  µÄ³ÌÐò£¬Òò´ËËùÓÐÄãµÃ×öµÄ£¨ÒÔ root »òÊÇ ppp Èº×é×éÔ±µÄÉí·Ö£©Ö»ÊÇ·¢³öµ¥Ò»¸öÖ¸ÁîÀ´Æð¶¯ÄãµÄÁ¬Ïß£®






\subsection{ÒÔÊ¹ÓÃÕßÃû³Æ£¯ÃÜÂëÈÏÖ¤µÄÖ¸Áî¸å}

Èç¹ûÄãµÄ ISP  ²¢²»ÒªÇóÊ¹ÓÃ PAP/CHAP µÄ»°£¬ÕâÐ©¾ÍÊÇÎªÄã×¼±¸µÄ!



Èç¹û ppp Ì×¼þ°²×°ÕýÈ·£¬ÄãÓ¦¸Ã»áÓÐÁ½¸ö¡õÀýµµ°¸£®
ÔÚ PPP 2.1.2 ÖÐÊÇÔÚ {\ttfamily /usr/sbin} ¶øÔÚ PPP 2.2 ÀïÊÇÔÚ {\ttfamily /etc/ppp/scripts}£®ÕâÐ©ÊÇ



ÔÚ PPP-2.1.2

\begin{tscreen}
\begin{verbatim}
ppp-on
ppp-off
\end{verbatim}
\end{tscreen}




¶øÔÚ PPP-2.2

\begin{tscreen}
\begin{verbatim}
ppp-off
ppp-on
ppp-on-dialer
\end{verbatim}
\end{tscreen}




ÏÖÔÚ£¬Èç¹ûÄãÕýÔÚÊ¹ÓÃ PPP 2.1.2£¬ÎÒÇ¿ÁÒ½¨ÒéÄãÉ¾³ýÕâÐ©¡õÀýµµ°¸£®
ËüÃÇÓÐÇ±ÔÚµÄÎÊÌâ - ²»Òª¸æËßÎÒËüÃÇ¹¤×÷µÃºÜºÃ - ÎÒÒ²ÓÃÁËºÜ³¤Ò»¶ÎÊ±¼ä(¶øÇÒ»¹ÔÚÕâ·Ý HOWTO µÄµÚÒ»°æÖÐÍÆ¼öËüÃÇ)!



ÎªÁË ppp 2.1.2  Ê¹ÓÃÕßµÄÈ¨Òæ£¬ÕâÀïÓÐ±È½ÏºÃµÄÑù°åµµ°¸£¬ÕâÐ©ÊÇ´Ó ppp 2.2 ·¢ÐÐÌ×¼þÀïÄÃÀ´µÄ£®
ÎÒ½¨ÒéÄã¿½±´²¢Ê¹ÓÃÕâÐ©Ö¸Áî¸å{\bfseries ¶ø²»Òª}ÔÙÓÃ¾ÉµÄ PPP-2.1.2 Ö¸Áî¸å£®




\subsection{{\ttfamily ppp-on} Ö¸Áî¸å}

ÕâÊÇÊµ¼ÊÆô¶¯Á¬ÏßµÄÒ»¶ÔÖ¸Áî¸åÖÐµÄµÚÒ»¸ö£®

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
#!/bin/sh
#
# Script to initiate a PPP connection. This is the first part of the
# pair of scripts. This is not a secure pair of scripts as the codes
# are visible with the 'ps' command.  However, it is simple.
#
# These are the parameters. Change as needed.
TELEPHONE=555-1212      # The telephone number for the connection
ACCOUNT=george          # The account name for logon (as in 'George Burns')
PASSWORD=gracie         # The password for this account (and 'Gracie Allen')
LOCAL_IP=0.0.0.0        # Local IP address if known. Dynamic = 0.0.0.0
REMOTE_IP=0.0.0.0       # Remote IP address if desired. Normally 0.0.0.0
NETMASK=255.255.255.0   # The proper netmask if needed
#
# Export them so that they will be available to 'ppp-on-dialer'
export TELEPHONE ACCOUNT PASSWORD
#
# This is the location of the script which dials the phone and logs
# in.  Please use the absolute file name as the $PATH variable is not
# used on the connect option.  (To do so on a 'root' account would be
# a security hole so don't ask.)
#
DIALER_SCRIPT=/etc/ppp/ppp-on-dialer
#
# Initiate the connection
#
#
exec /usr/sbin/pppd debug /dev/ttySx 38400 \
        $LOCAL_IP:$REMOTE_IP \
        connect $DIALER_SCRIPT
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




¶øÕâÊÇ {\ttfamily ppp-on-dialer} Ö¸Áî¸å:-

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
#!/bin/sh
#
# This is part 2 of the ppp-on script. It will perform the connection
# protocol for the desired connection.
#
/usr/sbin/chat -v                                       \
        TIMEOUT         3                               \
        ABORT           '\nBUSY\r'                      \
        ABORT           '\nNO ANSWER\r'                 \
        ABORT           '\nRINGING\r\n\r\nRINGING\r'    \
        ''              \rAT                            \
        'OK-+++\c-OK'   ATH0                            \
        TIMEOUT         30                              \
        OK              ATDT$TELEPHONE                  \
        CONNECT         ''                              \
        ogin:--ogin:    $ACCOUNT                        \
        assword:        $PASSWORD
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ÔÚ PPP-2.2 ÖÐ£¬{\ttfamily ppp-off} Ö¸Áî¸å¿´ÆðÀ´Ïñ:-

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
#!/bin/sh
######################################################################
#
# Determine the device to be terminated.
#
if [ "$1" = "" ]; then
        DEVICE=ppp0
else
        DEVICE=$1
fi

######################################################################
#
# If the ppp0 pid file is present then the program is running. Stop it.
if [ -r /var/run/$DEVICE.pid ]; then
        kill -INT `cat /var/run/$DEVICE.pid`
#
# If the kill did not work then there is no process running for this
# pid. It may also mean that the lock file will be left. You may wish
# to delete the lock file at the same time.
        if [ ! "$?" = "0" ]; then
                rm -f /var/run/$DEVICE.pid
                echo "ERROR: Removed stale pid file"
                exit 1
        fi
#
# Success. Let pppd clean up its own junk.
        echo "PPP link to $DEVICE terminated."
        exit 0
fi
#
# The ppp process is not running for ppp0
echo "ERROR: PPP link is not active on $DEVICE"
exit 1
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}





\subsection{±à¼­ÕâÀïËùÌá¹©µÄÆðÊ¼Ö¸Áî¸å}

ÒòÎªÕâ·ÝÐÂµÄÖ¸Áî¸å·Ö³ÉÁ½²¿·Ý£¬ÎÒÃÇ·Ö±ð±à¼­ËüÃÇ£®




\subsubsection{{\ttfamily ppp-on} Ö¸Áî¸å}

Äã½«µÃ±à¼­Õâ¸öÖ¸Áî¸åÒÔ·´Ó³ÄãÔÚ ISP µÄÊ¹ÓÃÕßÃû³Æ£¬ÄãÔÚ ISP µÄÃÜÂë£¬Äã ISP µÄµç»°ºÅÂë£®



Ã¿Ò»ÐÐÏñÊÇ {\ttfamily TELEPHONE=} Êµ¼ÊÉÏÉè¶¨ÁËÕâ¸ö±äÊý°üº¬ÔÚµÈºÅÓÒ±ßµÄ×ÊÑ¶ (µ±È»²»°üÀ¨×¢½â²¿·Ý)£®
Òò´Ë±à¼­Ã¿Ò»ÐÐÊ¹Ëü¶ÔÄãµÄ ISP ÓëÁ¬ÏßÊÇÕýÈ·µÄ£®



¶øÇÒ£¬Èç¹ûÄã(ÐèÒª)ÔÚ {\ttfamily /etc/ppp/options} µµ°¸ÀïÉè¶¨ÁË IP ºÅÂë£¬É¾³ýÕâÐÐ

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$LOCAL_IP:$REMOTE_IP \
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




»¹ÓÐ£¬È·¶¨±äÊý {\ttfamily DIALER\_SCRIPT} Ö¸ÏòÄã½«ÒªÊ¹ÓÃµÄ²¦ºÅÖ¸Áî¸åµÄÈ«²¿Â·¾¶Ãû³Æ£®
Òò´Ë£¬Èç¹ûÄãÒÆ¶¯»ò¸Ä±äÕâ¸öÖ¸Áî¸åµÄÃû³Æ£¬È·¶¨ÄãÕýÈ·µØ¸Ä±ä {\ttfamily ppp-on} Ö¸Áî¸åÀïµÄÕâÒ»ÐÐ£®




\subsubsection{{\ttfamily ppp-on-dialer} Ö¸Áî¸å}

ÕâÊÇµÚ¶þ¸öÖ¸Áî¸åÊµ¼Ê½¨Á¢ÆðÎÒÃÇµÄ PPP Á¬½á£®



×¢Òâ: Ò»·Ý chat Ö¸Áî¸åÒ»°ãÈ«¶¼·ÅÔÚÍ¬Ò»ÐÐÀï£®µ¹Ð±ÏßÊÇÓÃÀ´ÈÃÒ»ÐÐ¿ÉÒÔ¿ç¹ýÊýÐÐµÄÊµÌåÐÐ£¨±ãì¶ÈËÃÇÔÄ¶Á£©¶ø²¢²»ÊÇÖ¸Áî¸å±¾Éí×é³ÉµÄÒ»²¿·Ý£®



È»¶ø£¬×ÐÏ¸µØ¿´¿´ËüµÄÏ¸½Ú²¿·ÝÒÔ±ãÈÃÎÒÃÇÁË½âËüÊµ¼Ê(¼ÙÉèµÄ)Òª×öÊ²÷áÊÇ·Ç³£ÓÐÓÃµÄ!




\subsection{Ò»·Ý chat Ö¸Áî¸åÆäÖÐµÄº¬Òâ...}

Ò»·Ý chat Ö¸Áî¸åÊÇÒ»ÏµÁÐ{\ttfamily {``}}ÆÚ´ý×Ö´®{\ttfamily {''}} {\ttfamily {``}}ËÍ³ö×Ö´®{\ttfamily {''}}µÄÅä¶Ô£®
ÌØ±ðÊÇ£¬×¢Òâµ½ÎÒÃÇ{\bfseries ×ÜÊÇ}ÔÚËÍ³öÄ³Ð©Ñ¶Ï¢Ö®Ç°ÏÈÆÚ´ý{\bfseries Ä³Ð©Ñ¶Ï¢}³öÏÖ£®



Èç¹ûÎÒÃÇÔÚ{\bfseries Ã»ÓÐ}ÏÈ½ÓÊÕµ½ÈÎºÎÑ¶Ï¢µÄÇé¿öÏÂÒªËÍ³öÄ³Ð©Ñ¶Ï¢µÄ»°£¬ÎÒÃÇ±ØÐëÊ¹ÓÃ¿ÕµÄÆÚ´ý×Ö´®£¨½åÓÉ {\ttfamily {``}}{\ttfamily {''}} Ö¸Ã÷£©¶øÔÚÃ»ÓÐËÍ³öÈÎºÎÑ¶Ï¢µÄÇé¿öÏÂÒªÆÚ´ýÄ³Ð©Ñ¶Ï¢×÷·¨Ò²ÀàËÆ! 
¶øÇÒ£¬Èç¹û×Ö´®°üº¬ºÃ¼¸¸ö×Ö£¨ÀýÈç NO CARRIER£©£¬Äã±ØÐë°Ñ×Ö´®ÓÃÒýºÅÀ¨×¡£¬ÕâÑù chat »á°Ñ×Ö´®µ±×÷ÊÇµ¥Ò»¸öÏîÄ¿£®



ÔÚÎÒÃÇÑù°åÀïµÄ chat Ö¸ÁîÐÐÊÇ:

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
exec /usr/sbin/chat -v
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


Æð¶¯ chat £¬{\ttfamily -v} ¸æËß chat ½«ÆäËùÓÐµÄÊä³ö£¯Èë¿½±´µ½ÏµÍ³¼ÇÂ¼Àï£¨Í¨³£ÊÇ /var/log/messages£©£®
Ò»µ©Äã¾õµÃ chat Ö¸Áî¸åµÄÔË×÷ÎÈ¶¨¶ø¿É¿¿£¬±à¼­ÕâÒ»ÐÐ°Ñ {\ttfamily -v} ÒÆ³ýÒÔ±ã¼õÉÙÄãÏµÍ³¼ÇÂ¼µÄ»ìÔÓ£®

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
TIMEOUT         3
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

ÕâÉè¶¨½ÓÊÕËùÆÚ´ýµÄÊäÈëÓâÊ±Ê±ÏÞÎªÈýÃë£®Èç¹ûÄãÊ¹ÓÃÕæµÄÊÇºÜÂýµÄÊý¾Ý»úÄÇ÷áÄã¿ÉÄÜµÃÒªÔö¼ÓÕâ¸öÉè¶¨µ½ÎåÃë»òÊÇÊ®Ãë!

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
ABORT           '\nBUSY\r'
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


Èç¹û½ÓÊÕµ½ BUSY ×Ö´®£¬ÖÐÖ¹Ö´ÐÐ£®

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
ABORT           '\nNO ANSWER\r'
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


Èç¹û½ÓÊÕµ½ NO ANSWER  ×Ö´®£¬ÖÐÖ¹Ö´ÐÐ£®

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
ABORT           '\nRINGING\r\n\r\nRINGING\r'
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


Èç¹û½ÓÊÕµ½£¨ÖØ¸´µÄ£©RINGRING ×Ö´®£¬ÖÐÖ¹Ö´ÐÐ£®ÕâÊÇÒòÎªÄ³ÈËÕý´òµç»°¸øÄã!

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
"              \rAT
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


²»ÆÚ´ýÊý¾Ý»ú´«ËÍÈÎºÎÑ¶Ï¢²¢ÇÒËÍ³ö AT ×Ö´®£®

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
OK-+++\c-OK   ATH0
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


ÕâÒ»¸ö±È½Ï¸´ÔÓÒ»µã£¬ÒòÎªËüÊ¹ÓÃÁËÄ³Ð© chat µÄ´íÎó»Ø¸´¹¦ÄÜ£®

ËüËù´ú±íµÄÊÇ...ÆÚ´ý OK £¬Èç¹ûÃ»ÓÐÊÕµ½£¨ÒòÎªÊý¾Ý»ú²¢²»ÔÚÖ¸ÁîÄ£Ê½ÏÂ£©ÄÇ÷áËÍ³ö +++ £¨Ê¹Êý¾Ý»ú·µ»ØÖ¸ÁîÄ£Ê½µÄ±ê×¼ Hayes ÏàÈÝÊý¾Ý»ú×Ö´®£©²¢ÇÒÆÚ´ý OK£»½ÓÖøËÍ³ö ATH0 £¨Êý¾Ý»ú¹Ò¶Ï×Ö´®£©£®
ÕâÈÃÄãµÄÖ¸Áî¸å¿ÉÒÔÓ¦¸¶ÄãµÄÊý¾Ý»úð¤ÔÚÏßÉÏÎÞ·¨¶ÏÏßµÄÇé¿ö£®

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
TIMEOUT         30
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


Éè¶¨Ö¸Áî¸åÆäâÅ²¿·ÝÖ´ÐÐµÄÓâÊ±Ê±ÏÞÎª 30 Ãë£®Èç¹ûÄãÔø¾­ÒòÎªÓâÊ±¶ø¾­Ñé¹ý chat Ö¸Áî¸å±»ÖÕÖ¹µÄÎÊÌâ£¬°ÑËüÔö¼ÓÎª 45 Ãë»ò¸ü¾Ã£®

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
OK              ATDT$TELEPHONE
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


ÆÚ´ý OK £¨Êý¾Ý»ú¶Ô ATH0 Ö¸ÁîµÄ»ØÓ¦£©²¢ÇÒ²¦½Óµ½ÎÒÃÇÏëÒªºô½ÐµÄºÅÂë£®

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
CONNECT         "
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


ÆÚ´ý CONNECT ×Ö´®£¨µ±Ô¶¶ËÊý¾Ý»úÓÐ»ØÓ¦Ê±ÎÒÃÇµÄÊý¾Ý»úËÍ³öµÄ£©²¢ÇÒ²»ËÍ³öÈÎ»Ø¸²Ñ¶Ï¢£®

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
ogin:--ogin:    $ACCOUNT
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


ÔÙÒ»´Î£¬ÕâÀïÃæÎÒÃÇÓÐÒ»Ð©´íÎó»Ø¸´Éè¶¨£®ÆÚ´ýÇ©ÈëÌáÊ¾(...ogin:)£¬µ«ÊÇÈç¹ûÎÒÃÇÔÚÓâÊ±Ç°Ã»ÓÐ½ÓÊÕµ½£¬ËÍ³öÒ»¸ö·µ»Ø×ÖÔª(return)È»ááÔÙ´ÎÕÒÑ°Ç©ÈëÌáÊ¾£®
µ±½ÓÊÕµ½ÌáÊ¾Ê±£¬ËÍ³öÊ¹ÓÃÕßÃû³Æ£¨´æ·ÅÔÚÊ¹ÓÃÕß½çÃæµÄ \$ACCOUNT »·¾³±äÊýÀï£©£®

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
assword:        $PASSWORD
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


ÆÚ´ýÃÜÂëÌáÊ¾²¢ÇÒËÍ³öÃÜÂë£¨ÔÙÒ»´Î£¬´æ·ÅÔÚÊ¹ÓÃÕß½çÃæµÄÒ»¸ö»·¾³±äÊýÀï£©£®



Õâ¸ö chat Ö¸Áî¸åÓÐºÏÀíµÄ´íÎó»Ø¸´¹¦ÄÜ£® Chat »¹ÓÐÐí¶àÖØÒªµÄÌØÉ«£¬±ÈÕâÀïËùÕ¹Ê¾»¹Òª¸ü¶à£®
¸üÏêÏ¸µÄ×ÊÑ¶Çë²ÎÔÄ chat µÄÏßÉÏÊ¹ÓÃÊÖ²á({\ttfamily man 8 chat})£®




\subsubsection{ÔÚËÅ·þÆ÷¶ËÆô¶¯ PPP}

ËäÈ»Õâ·Ý {\ttfamily ppp-on-dialer} Ö¸Áî¸å¶Ôì¶ÔÚÄãÇ©Èëáá»á×Ô¶¯Æô¶¯ pppd µÄËÅ·þÆ÷À´Ëµ·Ç³£µÄºÃÓÃ£¬È»¶øÄ³Ð©ËÅ·þÆ÷ÐèÒªÄãÃ÷°×µØÔÚËÅ·þÆ÷ÉÏÆô¶¯ PPP£®



Èç¹ûÄãÐèÒªÔÚËÅ·þÆ÷ÉÏÏÂÖ¸ÁîÒÔÆô¶¯ PPP£¬Äã±ØÐëÒª±à¼­ {\ttfamily ppp-on-dialer} Ö¸Áî¸å£® 



 
ÔÚÕâÖ¸Áî¸åµÄÎ²¶Ë(ÔÚ password ÕâÐÐááÃæ)¼ÓÉÏ {\bfseries ÆÚ´ý ËÍ³ö} ×Ö´®¶Ô - ÕâÊÇÑ°ÕÒÄãµÄ shell ÌáÊ¾·ûºÅ
(ÌØ±ðÐ¡ÐÄ¶Ô Bourne shell ÓÐÌØÊâÒâÒåµÄ×ÖÔª - ÏñÊÇ \$ Óë {[} »ò ] ×óÓÒ·½À¨ºÅµÈ)£®



Ò»µ© chat ÕÒµ½ÁË shell ÌáÊ¾·ûºÅ£¬chat ±ØÐëÏÂÖ¸ÁîÒÔÆô¶¯Äã ISP µÄ PPP ËÅ·þÆ÷£®



ÒÔÎÒµÄÀý×Ó¶øÑÔ£¬ÎÒµÄ PPP ËÅ·þÆ÷Ê¹ÓÃ±ê×¼µÄ Linux Bash ÌáÊ¾·ûºÅ
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
[hartr@kepler hartr]$
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




¶øÇÒÐèÒªÎÒ´ò

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
ppp
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ÒÔÆô¶¯ËÅ·þÆ÷ÉÏµÄ PPP£®



ÔÚ´ËÔÊÐíÒ»µã´íÎó»Ø¸´ÊÇ¸öºÃÖ÷Òâ£¬ËùÒÔÔÚÎÒµÄÀý×ÓÖÐÎÒÓÃ
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
        hartr--hartr    ppp
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




Õâ¾ÍÊÇËµ£¬Èç¹ûÎÒÔÚÓâÊ±Ç°Ã»ÊÕµ½ÌáÊ¾·ûºÅ£¬ËÍ³ö return ²¢ÇÒÔÙ´ÎµÈ´ýÌáÊ¾·ûºÅ£®



Ò»µ©ÊÕµ½ÌáÊ¾·ûºÅ£¬¾ÍËÍ³ö {\ttfamily ppp} ×Ö´®£®



×¢Òâ: ±ðÍüÁËÔÚÇ°Ò»ÐÐ½áÊøÇ°¼ÓÉÏ $\backslash$ ÒÔ±ãÈÃ chat ÈÏÎªÕâÕû¸öÖ¸Áî¸åÊÇÔÚÒ»ÐÐÀï!



²»ÐÒµÄÊÇ£¬Ä³Ð©ËÅ·þÆ÷»á²úÉú·Ç³£¶à±äµÄÌáÊ¾·ûºÅ!
Äã¿ÉÄÜ±ØÐëÊ¹ÓÃ minicom ¶àÇ©Èë¼¸´ÎÒÔ±ãÁË½âÊ²÷á¿ÉÒÔÓÃÀ´×öÎªÈ·¶¨µÄ{``}ÆÚ´ý{''}×Ö´®£®




\subsection{Ê¹ÓÃì¶ PAP/CHAP ÑéÈÏÁ¬ÏßµÄ chat Ö¸Áî¸å}

Èç¹ûÄãµÄ ISP  Ê¹ÓÃ PAP/CHAP ÑéÈÏ£¬ÄÇ÷áÄãµÄ chat Ö¸Áî¸å»á¼òµ¥µÃ¶à£®
ÄãµÄ chat Ö¸Áî¸åËùÒª×öµÄÈ«²¿Ö»ÊÇ²¦½Óµç»°£¬µÈ´ý½ÓÉÏÏß£¬È»áá¾ÍÈÃ pppd È¥´¦ÀíÇ©ÈëÊÂÒË!

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
#!/bin/sh
#
# This is part 2 of the ppp-on script. It will perform the connection
# protocol for the desired connection.
#
exec /usr/sbin/chat -v                                  \
        TIMEOUT         3                               \
        ABORT           '\nBUSY\r'                      \
        ABORT           '\nNO ANSWER\r'                 \
        ABORT           '\nRINGING\r\n\r\nRINGING\r'    \
        ''              \rAT                            \
        'OK-+++\c-OK'   ATH0                            \
        TIMEOUT         30                              \
        OK              ATDT$TELEPHONE                  \
        CONNECT         ''                              \
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}





\subsection{pppd µÄ {\ttfamily debug} Óë {\ttfamily file option\_file} Ñ¡Ïî}

¾ÍÏñÎÒÃÇÒÑ¾­¿´¹ýµÄ£¬Äã¿ÉÒÔ¶Ô pppd Ê¹ÓÃ {\ttfamily -d} Ñ¡Ïî´ò¿ªÕì´íÑ¶Ï¢¼ÇÂ¼£®
'{\ttfamily debug}' Ñ¡ÏîºÍÕâ¸öÊÇÒ»ÑùµÄ£®



ÒòÎªÎÒÃÇÕýÔÚÊ¹ÓÃÐÂµÄÖ¸Áî¸å½¨Á¢ÐÂµÄÁ¬Ïß£¬ÏÈ·ÅÖø´ËÑ¡Ïî²»¹Ü£®
(¾¯¸æ: Èç¹ûÄãµÄ´Åµú¿Õ¼ä²»´ó¹»£¬¼ÇÂ¼ pppd µÄÑ¶Ï¢¿ÉÄÜ»á´óÁ¿Ôö¼ÓÄãµÄÏµÍ³¼ÇÂ¼µµ´óÐ¡²¢Ê¹ÄãÓöµ½Âé·³ - ²»¹ýÔÚ´ËÄã±Ø¶¨»áÁ¬ÏßÊ§°Ü²¢³¢ÊÔÐí¾Ã)£®



Ò»µ©Äã¸ßÐËµØÈÏÎªÒ»ÇÐ¹¤×÷Õý³££¬Äã¿ÉÒÔ³ýÈ¥´ËÑ¡Ïî£®



Èç¹ûÄã²»ÊÇ´Ó {\ttfamily /etc/ppp/options} »ò {\ttfamily /etc/ppp/options.ttySx} µµ°¸ÖÐ½Ð³ö ppp Ñ¡Ïî£¬
¿ÉÒÔÔÚ pppd ÉÏÓÃ {\ttfamily file} Ñ¡ÏîÖ¸¶¨µµ°¸Ãû³Æ - ÀýÈç

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
exec /usr/sbin/pppd debug file options.myserver /dev/ttyS0 38400 \
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}





\section{²âÊÔÄãµÄÁ¬ÏßÖ¸Áî¸å}

¿ªÆôÒ»¸öÐÂµÄ Xterm£¨Èç¹ûÄãÔÚ X  µ×ÏÂ£©»ò¿ªÆôÒ»¸öÐÂµÄÐéÄâÖ÷¿ØÌ¨²¢ÇÒÒÔ root Ç©Èë£®



ÔÚÕâ¸öÐÂµÄ½×¶Î×÷ÒµÖÐ£¬·¢³öÕâ¸öÖ¸Áî

\begin{tscreen}
\begin{verbatim}
tail -f /var/log/messages
\end{verbatim}
\end{tscreen}




£¨»òÊÇÄãÏµÍ³¼ÇÂ¼µµ°¸µÄÈÎºÎÃû³Æ£©£®



ÔÚµÚÒ»¸öÊÓ´°£¨»òÊÇÐéÄâÖ÷¿ØÌ¨ÖÐ£©·¢³öÕâ¸öÃüÁî

\begin{tscreen}
\begin{verbatim}
ppp-on &
\end{verbatim}
\end{tscreen}




£¨»òÊÇÈÎºÎÄãËù±à¼­µÄ {\ttfamily /usr/sbin/ppp-on} °æ±¾Ö®Ãû³Æ£©£®
Èç¹ûÄãÃ»ÓÐ½åÓÉÔÚÕâ¸öÖ¸ÁîµÄÎ²¶ËÖ¸¶¨ \& Ê¹µÃÖ¸Áî¸å½øÈë±³¾°Ö´ÐÐµÄ»°£¬ÄÇ÷áÔÚ ppp ½áÊø£¨µ±Á¬Ïß½áÊøÊ±£©Ö®Ç°Äã¶¼²»ÄÜ»Øµ½ÖÕ¶Ë»úÌáÊ¾ÏÂ



ÏÖÔÚÇÐ»»µ½×·×ÙÏµÍ³¼ÇÂ¼µµµÄÊÓ´°£®



Äã½«»á¼ûµ½Ä³Ð©ÏñÏÂÁÐµÄ¶«Î÷£¨¼Ù¶¨Äã¶Ô chat Ö¸¶¨ {\ttfamily -v} ²¢ÇÒ¶Ô pppd Ö¸¶¨ {\ttfamily -d} Ñ¡Ïî£©....
ÕâÊÇ½ô¸úÔÚ pppd Æð¶¯×ÊÑ¶Ö®áá¼ÇÂ¼µ½ÏµÍ³¼ÇÂ¼µµ°¸ÀïµÄ chat Ö¸Áî¸å¼°Æä»ØÓ¦:

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
Oct 21 16:09:58 hwin chat[19868]: abort on (NO CARRIER)
Oct 21 16:09:59 hwin chat[19868]: abort on (BUSY)
Oct 21 16:09:59 hwin chat[19868]: send (ATZ^M)
Oct 21 16:09:59 hwin chat[19868]: expect (OK)
Oct 21 16:10:00 hwin chat[19868]: ATZ^M^M
Oct 21 16:10:00 hwin chat[19868]: OK -- got it
Oct 21 16:10:00 hwin chat[19868]: send (ATDT722298^M)
Oct 21 16:10:00 hwin chat[19868]: expect (CONNECT)
Oct 21 16:10:00 hwin chat[19868]: ^M
Oct 21 16:10:22 hwin chat[19868]: ATDT722298^M^M
Oct 21 16:10:22 hwin chat[19868]: CONNECT -- got it
Oct 21 16:10:22 hwin chat[19868]: send (^M)
Oct 21 16:10:22 hwin chat[19868]: expect (ogin:)
Oct 21 16:10:23 hwin chat[19868]: kepler login: -- got it
Oct 21 16:10:23 hwin chat[19868]: send (hartr^M)
Oct 21 16:10:23 hwin chat[19868]: expect (ssword:)
Oct 21 16:10:23 hwin chat[19868]:  hartr^M
Oct 21 16:10:23 hwin chat[19868]: Password: -- got it
Oct 21 16:10:23 hwin chat[19868]: send (??????^M)
Oct 21 16:10:23 hwin chat[19868]: expect (hartr)
Oct 21 16:10:24 hwin chat[19868]: [hartr -- got it
Oct 21 16:10:24 hwin chat[19868]: send (ppp^M)
Oct 21 16:10:27 hwin pppd[19872]: pppd 2.1.2 started by root, uid 0
Oct 21 16:10:27 hwin pppd[19873]: Using interface ppp0
Oct 21 16:10:27 hwin pppd[19873]: Connect: ppp0 <--> /dev/cua1
Oct 21 16:10:27 hwin pppd[19873]: fsm_sdata(LCP): Sent code 1, id 1.
Oct 21 16:10:27 hwin pppd[19873]: LCP: sending Configure-Request, id 1
Oct 21 16:10:27 hwin pppd[19873]: fsm_rconfreq(LCP): Rcvd id 1.
Oct 21 16:10:27 hwin pppd[19873]: lcp_reqci: rcvd MRU
Oct 21 16:10:27 hwin pppd[19873]: (1500)
Oct 21 16:10:27 hwin pppd[19873]:  (ACK)
Oct 21 16:10:27 hwin pppd[19873]: lcp_reqci: rcvd ASYNCMAP
Oct 21 16:10:27 hwin pppd[19873]: (0)
Oct 21 16:10:27 hwin pppd[19873]:  (ACK)
Oct 21 16:10:27 hwin pppd[19873]: lcp_reqci: rcvd MAGICNUMBER
Oct 21 16:10:27 hwin pppd[19873]: (a098b898)
Oct 21 16:10:27 hwin pppd[19873]:  (ACK)
Oct 21 16:10:27 hwin pppd[19873]: lcp_reqci: rcvd PCOMPRESSION
Oct 21 16:10:27 hwin pppd[19873]:  (ACK)
Oct 21 16:10:27 hwin pppd[19873]: lcp_reqci: rcvd ACCOMPRESSION
Oct 21 16:10:27 hwin pppd[19873]:  (ACK)
Oct 21 16:10:27 hwin pppd[19873]: lcp_reqci: returning CONFACK.
Oct 21 16:10:27 hwin pppd[19873]: fsm_sdata(LCP): Sent code 2, id 1.
Oct 21 16:10:27 hwin pppd[19873]: fsm_rconfack(LCP): Rcvd id 1.
Oct 21 16:10:27 hwin pppd[19873]: fsm_sdata(IPCP): Sent code 1, id 1.
Oct 21 16:10:27 hwin pppd[19873]: IPCP: sending Configure-Request, id 1
Oct 21 16:10:27 hwin pppd[19873]: fsm_rconfreq(IPCP): Rcvd id 1.
Oct 21 16:10:27 hwin pppd[19873]: ipcp: received ADDR
Oct 21 16:10:27 hwin pppd[19873]: (10.144.153.51)
Oct 21 16:10:27 hwin pppd[19873]:  (ACK)
Oct 21 16:10:27 hwin pppd[19873]: ipcp: received COMPRESSTYPE
Oct 21 16:10:27 hwin pppd[19873]: (45)
Oct 21 16:10:27 hwin pppd[19873]:  (ACK)
Oct 21 16:10:27 hwin pppd[19873]: ipcp: returning Configure-ACK
Oct 21 16:10:28 hwin pppd[19873]: fsm_sdata(IPCP): Sent code 2, id 1.
Oct 21 16:10:30 hwin pppd[19873]: fsm_sdata(IPCP): Sent code 1, id 1.
Oct 21 16:10:30 hwin pppd[19873]: IPCP: sending Configure-Request, id 1
Oct 21 16:10:30 hwin pppd[19873]: fsm_rconfreq(IPCP): Rcvd id 255.
Oct 21 16:10:31 hwin pppd[19873]: ipcp: received ADDR
Oct 21 16:10:31 hwin pppd[19873]: (10.144.153.51)
Oct 21 16:10:31 hwin pppd[19873]:  (ACK)
Oct 21 16:10:31 hwin pppd[19873]: ipcp: received COMPRESSTYPE
Oct 21 16:10:31 hwin pppd[19873]: (45)
Oct 21 16:10:31 hwin pppd[19873]:  (ACK)
Oct 21 16:10:31 hwin pppd[19873]: ipcp: returning Configure-ACK
Oct 21 16:10:31 hwin pppd[19873]: fsm_sdata(IPCP): Sent code 2, id 255.
Oct 21 16:10:31 hwin pppd[19873]: fsm_rconfack(IPCP): Rcvd id 1.
Oct 21 16:10:31 hwin pppd[19873]: ipcp: up
Oct 21 16:10:31 hwin pppd[19873]: local  IP address 10.144.153.104
Oct 21 16:10:31 hwin pppd[19873]: remote IP address 10.144.153.51
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




£¨×¢Òâ £­ ÎÒÊ¹ÓÃ¾²Ì¬µÄ IP ºÅÂë £­ Òò´ËÎÒµÄ»úÆ÷ËÍÕâÐ©¶«Î÷µ½ PPP ËÅ·þÆ÷È¥ £­ Èç¹ûÄãÊ¹ÓÃ¶¯Ì¬µÄ IP ºÅÂëÄÇ÷áÄã½«²»»á¿´¼ûÕâÐ©£®£©
»¹ÓÐ£¬Õâ¸öËÅ·þÆ÷ÐèÒªÖ¸¶¨µÄÃüÁîÀ´Æô¶¯ PPP£®



Õâ¿´ÆðÀ´Ã»Ê²÷áÎÊÌâ £­ ËùÒÔÈçÍ¬Ç°ÃæµÄ²âÊÔ°ã£¬ ping Ò»Ð© IP ºÅÂëÒÔ¼°Ö÷»úÃû³Æ£®

Æð¶¯ÄãµÄÈ«Çò×ÊÑ¶ä¯ÀÀÆ÷»òÊÇÈÎºÎÆäËü¶«¶«²¢ÇÒ¿ªÊ¼¹ä £­ ÄãÉÏÏßÁË!




\section{½áÊø PPP Á¬½á\label{off}}

µ±ÄãÍê³É PPP  Á¬½áÖ®áá£¬¿ÉÒÔÊ¹ÓÃ±ê×¼µÄ {\ttfamily ppp-off} Ö¸ÁîÖÕÖ¹Ëü£¨Òª¼ÇµÃ £­ ÄãµÃÊÇ root »òÕßÊÇ PPP  Èº×éµÄ×éÔ±! £©



Äã½«»áÔÚÄãµÄÏµÍ³¼ÇÂ¼Àï¿´¼ûÒ»Ð©ÏñÕâÑùµÄµÄ¶«Î÷:

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
Oct 21 16:10:45 hwin pppd[19873]: Interrupt received: terminating link
Oct 21 16:10:45 hwin pppd[19873]: ipcp: down
Oct 21 16:10:45 hwin pppd[19873]: default route ioctl(SIOCDELRT): Bad address
Oct 21 16:10:45 hwin pppd[19873]: fsm_sdata(LCP): Sent code 5, id 2.
Oct 21 16:10:46 hwin pppd[19873]: fsm_rtermack(LCP).
Oct 21 16:10:46 hwin pppd[19873]: Connection terminated.
Oct 21 16:10:46 hwin pppd[19873]: Exit.
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




±ðµ£ÐÄÄÇ¸ö {\ttfamily SIOCDELRT} - Õâ²»¹ýÊÇ pppd ±íÊ¾Òª½áÊøÁË¶øÃ»Ê²÷áºÃµ£ÐÄµÄ£®




\section{Õì´í\label{problems}}

ÄãµÄÁ¬ÏßÓÐ¸÷ÖÖ¿ÉÄÜµÄÔ­ÒòÎÞ·¨ÔË×÷ £­  chat ÎÞ·¨ÕýÈ·µØÍê³É£¬ÄãµÄÏßÂ·ÔÓÑ¶ºÜ´óµÈµÈ£®
ËùÒÔ£¬¼ì²éÄãµÄÏµÍ³¼ÇÂ¼ÕÒÑ°ÏßË÷£®




\subsection{ÎÒ°Ñ PPP ±àÒë½øÈ¥µ«ÊÇ Linux ËµÎÒÃ»ÓÐ...}

Ò»¸ö·Ç³£³£¼ûµÄÎÊÌâÊÇÈËÃÇÒÑ¾­½« PPP ±àÒëµ½ºËÐÄÖ®ÖÐ²¢ÇÒ³¢ÊÔÖ´ÐÐ pppd£¬µ«ºËÐÄÈÔÈ»±§Ô¹ËµËü²»Ö§Ô® PPP!
ÓÐÐí¶àÔ­Òò¿ÉÄÜµ¼ÖÂ´ËÊÂ·¢Éú£®




\subsubsection{ÄãÆô¶¯µÄÊÇÕýÈ·µÄºËÐÄÂð?}

ËäÈ»Äã{\bfseries ÒÑ¾­}ÖØÐÂ±àÒëºËÐÄÒÔÖ§Ô® PPP£¬ÄãÈ´Ã»ÓÐÆô¶¯ÐÂµÄºËÐÄ£®
Õâ¿ÉÄÜÊÇÒòÎªÄãÃ»ÓÐ¸üÐÂ {\ttfamily /etc/lilo.conf} ²¢ÖØÅÜ lilo£®



¼ì²éµÄ·½·¨ÊÇÏÂÕâ¸öÖ¸Áî {\ttfamily uname -a}£¬½«²úÉúÏñÕâÑùµÄ½á¹û 

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
Linux archenland 2.0.28 #2 Thu Feb 13 12:31:37 EST 1997 i586
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




Ëü¸ø³öÁËºËÐÄµÄ°æ±¾¼°ºËÐÄ±àÒëµÄÈÕÆÚ - ÕâÑùÄã¾ÍÖªµÀµ½µ×·¢ÉúÁËÊ²÷áÊÂ£®




\subsubsection{Äã½« PPP ºËÐÄÖ§Ô®±àÒëÎªÄ£×éÂð?}

Èç¹ûÄã½« PPP ºËÐÄÖ§Ô®±àÒëÎªÄ£×é£¬µ«È´Ã»ÓÐ±àÒë¼°°²×°Ä£×é£¬Äã¾Í»áµÃµ½Õâ¸ö´íÎó£®
¿´Ò»ÏÂ \onlynameurl{Kernel-HOWTO} ÒÔ¼°ÔÚ {\ttfamily /usr/src/linux} ÏÂµÄ {\ttfamily README} µµ°¸!



ÁíÒ»¸öÄ£×éÁ¬½áµÄ¿ÉÄÜÎÊÌâÊÇÄãÆÚÍûÐèÒªµÄÄ£×é×Ô¶¯µØ±»ÔØÈë£¬µ«È´Ã»ÓÐÖ´ÐÐ {\ttfamily kerneld} (»á×Ô¶¯ÔØÈë²¢ÒÆ³ýÄ£×éµÄ¹¤¾ß)£®
¿´Ò»ÏÂ \onlynameurl{kerneld mini-HOWTO} ÀïµÄ×ÊÑ¶ËµÃ÷ÈçºÎÉè¶¨ {\ttfamily kerneld}£®




\subsubsection{ÄãÊÇ·ñÄãÓÃÕýÈ·µÄ PPP °æ±¾ÅäºÏÄãµÄºËÐÄ?}

Äã{\bfseries ±ØÐë}Ê¹ÓÃ ppp-2.2 ÒÔÅäºÏºËÐÄ 2.0.X£®
Äã¿ÉÒÔÔÚºËÐÄ 1.2.X Ê¹ÓÃ ppp-2.2 (Èç¹ûÄãÐÞ²¹¹ýºËÐÄ)·ñÔòÄã±ØÐëÊ¹ÓÃ ppp-2.1.2£®




\subsubsection{ÄãÊÇ·ñÒÔ root Éí·ÝÖ´ÐÐ pppd?}

Èç¹ûÄã²»ÊÇÒÔ root Éí·ÝÖ´ÐÐ pppd (²¢ÇÒ pppd ²¢Î´Éè¶¨ÎªÒÔ root Éí·ÝÖ´ÐÐ)£¬Äã¾Í»áÊÕµ½´ËÑ¶Ï¢£®




\subsection{ÎÒµÄÊý¾Ý»úÁ¬ÉÏÁËµ« PPP ²¢Î´Æô¶¯}

Í¬ÑùÒ²ÓÐÐí²»¾¡µÄÔ­Òò(²Î¿¼Ò»ÏÂ comp.os.linux...)£®



Ò»¸ö{\bfseries ×î³£¼û}µÄ´íÎóÊÇÔÚÄãµÄÖ¸Áî¸åÀïÄãÉÙ´òÁËÄ³Ð©¶«Î÷£®
ÕâÀïÎ¨Ò»¿É×öµÄÊÇÄã½« Linux PC ÓëËÅ·þÆ÷µÄ¶Ô»°¼Çµ½ÄãµÄÏµÍ³¼ÇÂ¼ÖÐ({\ttfamily /var/log/messages})È»áá{\itshape Ò»ÐÐÒ»ÐÐµØ\/}¿´¸ö×ÐÏ¸£®
Äã¿ÉÄÜ»¹ÐèÒªÔÙ´ÎÒÔÊÖ¶¯·½·¨²¦ÈëËÅ·þÆ÷¼ì²éÒ»±é£®

ÄãµÃÒª´ÓÍ·µ½Î²Ð¡ÐÄµØ¼ì²é £­ ¶øÇÒÐÄÀïÒª¼ÇµÃÎÒÃÇÈËÀàÓÐÖÖÇãÏò£¬ÔÄ¶ÁµÄÊÇÎÒÃÇÈÏÎªÎÒÃÇ¼üÈëµÄ £­ ¶ø²»ÊÇÕæµÄÔÚÄÇÀïµÄ!




\subsection{ÏµÍ³¼ÇÂ¼Ëµ {``}{\ttfamily serial line is not 8 bit clean}...{''}}

ÕâÒ²ÓÐÐí¶àµÄÀàËÆÇéÐÎ - ÏñÊÇ {\ttfamily serial line looped back} µÈµÈ£¬µ¼ÖÂµÄÔ­Òò¿ÉÄÜÊÇÐí¶àÊÂÇéÖÐµÄÒ»¼þ(»òÒ»ÏµÁÐ)£®



ÒªÖªµÀµ½µ×·¢ÉúÁËÊ²÷á£¬±ØÐë¶Ô pppd ±³áá×öÁËÐ©Ê²÷áÓÐµãÁË½â£®



µ± pppd Æô¶¯áá£¬Ëü»áËÍ³öÁ¬½á¿ØÖÆÐ­¶¨(link control protocol)·â°üµ½Ô¶¶Ë»úÆ÷£®
Èç¹ûËüÊÕµ½ºÏ·¨µÄ»ØÓ¦²Å»á×ßµ½ÏÂÒ»½×¶Î(Ê¹ÓÃ IPCP - IP ¿ØÖÆ·â°ü)¶øÇÒÖ»ÓÐÔÚÕâÐ­ÉÌÍê³ÉÖ®ááÊµ¼ÊµÄ IP ²ã²Å»á½¨Á¢Òò´ËÄã²ÅÄÜÊ¹ÓÃ PPP Á¬½á£®



Èç¹ûµ±ÄãµÄ PC ËÍ³öÐ­ÉÌ·â°üÊ±ÔÚÔ¶¶ËÃ»ÓÐ PPP ËÅ·þÆ÷ÔÚÔË×÷£¬ÕâÐ©·â°üÔÚÔ¶¶ËÇ©Èë¹ý³ÌÖÐ½«±»µ¯»ØÀ´£®
ÒòÎªÕâÐ©·â°üÊÇÊ¹ÓÃ 8 bits£¬µ¯»ØÀ´Ê±»á½«µÚ°Ë¸öÎ»Ôª½Øµô(¼ÇÈÎ£¬ASCII ÊÇÆßÎ»ÔªµÄÂë)£®
PPP Òò´Ë¶ø±§Ô¹´ËÑ¶Ï¢£®



ÓÐÐí¶àÔ­Òò»áÔì³ÉÐ­ÉÌ·â°ü±»µ¯»Ø£®




\subsubsection{ÄãÃ»ÓÐÕýÈ·µØÇ©ÈëËÅ·þÆ÷}

µ±ÄãµÄ chat Ö¸Áî¸åÍê³Éáá£¬ÄãµÄ PC »áÆô¶¯ pppd£®È»¶ø£¬Èç¹ûÄã²¢Î´Íê³ÉÔÚËÅ·þÆ÷µÄÇ©Èë¹ý³Ì(°üÀ¨ËÍ³öÈÎºÎ±ØÒªÔÚËÅ·þÆ÷ÉÏÆô¶¯ PPP µÄÖ¸Áî)£¬PPP ¾Í²»»á¿ªÊ¼£®



Òò´ËÁ¬½á¿ØÖÆÐ­¶¨·â°ü±»µ¯»ØÄãÒ²Òò´ËÊÕµ½Õâ¸ö´íÎó£®



Äã±ØÐëÐ¡ÐÄµØ¼ì²é²¢ÐÞÕý(±ØÒªµÄ»°)ÄãµÄ chat Ö¸Áî¸å(²Î¼ûÉÏÃæËµÃ÷)£®




\subsubsection{Äã²¢Î´Æô¶¯ËÅ·þÆ÷ÉÏµÄ PPP}

Ä³Ð© PPP ËÅ·þÆ÷ÔÚÄãÍê³ÉÇ©Èë¹ý³ÌááÐèÒªÄãÊäÈëÖ¸Áî»ò°´ÏÂ {\ttfamily RETURN} ²Å»áÔÚÔ¶¶ËÆô¶¯ PPP£®



¼ì²éÄãµÄ chat Ö¸Áî¸å(²Î¼ûÉÏÃæËµÃ÷)£®



Èç¹ûÄãÒÔÊÖ¶¯·½Ê½Ç©ÈëÊ±·¢ÏÖÄã±ØÐëËÍ³ö {\ttfamily RETURN} ²Å»áÔÚÔ¶¶ËÆô¶¯ PPP£¬¼òµ¥µØÔÚÄãµÄ chat Ö¸Áî¸åÎ²¶Ë¼ÓÉÏ¿Õ°×µÄÆÚ´ý/ËÍ³ö×Ö´®¶Ô(¿ÕµÄËÍ³ö×Ö´®Êµ¼ÊÉÏ»áËÍ³ö {\ttfamily RETURN})£®




\subsubsection{Ô¶¶ËµÄ PPP ¹ý³ÌÆô¶¯ºÜÂý}

ÕâÓÐµã¶ù¼¼ÇÉ!



Ô¤ÉèµÄÇé¿öÏÂÄãµÄ Linux pppd ±»±àÒë³É×î¶àËÍ³öÊ®¸öÁ¬Ïß¿ØÖÆÒªÇó·â°ü£®
Èç¹ûËÅ·þÆ÷Æô¶¯ÓÐµãÂý£¬Ê®¸öÁ¬Ïß·â°ü¿ÉÄÜÔÚÔ¶¶Ë PPP ×¼±¸ºÃ½ÓÊÕÇ°¾ÍÈ«²¿ËÍ³öÁË£®



ì¶ÊÇÔÚÄãµÄ»úÆ÷ÉÏ£¬pppd ¿´µ½Ê®¸ö·â°ü±»µ¯»Ø(µÚ°ËÎ»Ôª±»½ØÈ¥)¶ø½áÊø£®



ÓÐÁ½¸ö·½·¨¿ÉÒÔ½â¾ö´ËÊÂ:-



ÔÚÄãµÄ PPP Ñ¡ÏîÖÐ¼ÓÉÏ {\ttfamily lcp-max-configure 30}£®
ÕâÔö¼Ó pppd ÔÚ·ÅÆúÇ°ËÍ³öµÄÁ¬Ïß·â°üµÄ×î´óÊýÄ¿£®¶ÔÒ»¸öÕæµÄºÜÂýµÄËÅ·þÆ÷À´Ëµ£¬Äã¿ÉÄÜ»¹ÐèÒª¸ü¶à£®



»òÕß£¬Äã¿ÉÒÔ»Ø¹ýÀ´ÓÃÒ»Ð©¼¼ÇÉ£®Äã»òÐí»á×¢Òâµ½µ±ÄãÒÔÊÖ¶¯Ç©Èë PPP ËÅ·þÆ÷²¢ÈÃ PPP Æô¶¯Ê±£¬ÊÕµ½µÄÀ¬»øµÄ{\bfseries µÚÒ»¸ö}×ÖÍê×ÜÊÇ tilde(\~{}) ×ÖÔª£®



ÀûÓÃ´ËµãÎÒÃÇ¿ÉÒÔÔÚ chat Ö¸Áî¸åÎ²¶Ë¼ÓÉÏÐÂµÄÆÚ´ý/ËÍ³ö×Ö´®¶Ô£¬ÆÚ´ý tilde ×ÖÔª²¢²»ËÍ³öÈÎºÎ¶«Î÷£®
Õâ¿´ÆðÀ´ÏñÕâÑù:-

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
\~      ''
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




×¢Òâ: ÒòÎª tilde ×ÖÔª¶Ô shell À´ËµÓÐÌØÊâÒâÒå£¬±ØÐë¼ÓÒÝ³ö·ûºÅ(¾ÍÊÇÇ°ÃæµÄµ¹Ð±Ïß)£®




\subsection{²»ÄÜÉèÁ¢Ô¤ÉèµÝËÍÂ·¾¶}

Èç¹û pppd ¾Ü¾ø½¨Á¢Ô¤ÉèµÝËÍÂ·¾¶£¬ÕâÊÇÒòÎª(Ó¦¸ÃÃ»´í)Ëü¾Ü¾øÒÆ³ý»òÈ¡´úÒÑÓÐµÄÔ¤ÉèµÝËÍÂ·¾¶£®



Í¨³£µÄÔ­ÒòÊÇÒòÎªÄ³Ð©Ì×¼þ½«ÄãµÄÒÒÌ«ÍøÂ·¿¨ÉèÎªÔ¤ÉèµÝËÍÂ·¾¶¶ø²»ÊÇÉèÎªÖ¸¶¨µÄÍøÂ·µÝËÍ£®



²Î¼û Linux NAG Óë Net2/3 HOWTOs ÀïµÄ×ÊÑ¶ÒÔÕýÈ·µØÉè¶¨ÄãµÄÒÒÌ«ÍøÂ·¿¨¼°Ïà¹ØµÄµÝËÍ£® 



ÁíÒ»¿ÉÄÜÔ­ÒòÊÇÄãµÄÇøÓòÍøÂ·ÒÑÊ¹ÓÃÁËÕ¢µÀÆ÷»òÂ·ÓÉÆ÷¶øÇÒÄãµÄµÝËÍ±í¸ñÒÑÉè¶¨Îª½«Ô¤ÉèµÝËÍÂ·¾¶Ö¸ÏòÕâÀï£®



ÒªÐÞÕýÕâÖÖÇé¿öÐèÒª¸ü¶àµÄÍøÂ·ÖªÊ¶¶øÒÑ¾­³¬³ö´Ë·Ý HOWTO µÄ¡õÎ§ÁË£®
½¨ÒéÄãÈ¡µÃÒ»Ð©×¨¼ÒµÄÒâ¼û(¾­ÓÉÐÂÎÅ×éÈº»òÄãÖÜÎ§¿ÉÒÔÎÊµÄÈË)£®




\subsection{ÆäËüÎÊÌâ}

»¹ÓÐÐí¶àÔ­Òòµ¼ÖÂ PPP ÎÞ·¨Á¬½Ó»òÊÇÎÞ·¨ÕýÈ·ÔË×÷£®



ÏÖÔÚ×ÐÏ¸¿´¿´ PPP FAQ £¨ÕâÕæµÄÊÇÒ»ÏµÁÐµÄÎÊÌâÓë»Ø´ð£©£®ÕâÊÇÒ»·Ý·Ç³£ÏêÊµµÄÎÄ¼þ¶øÇÒ´ð°¸¾ÍÔÚÀïÃæ! 
ÒÔÎÒ×Ô¼º£¨ºÜÀÃ£©µÄ¾­Ñé£¬Èç¹ûÄãµÄÎÊÌâ´ð°¸²»ÔÚÆäÖÐ£¬ÄÇ÷á¸ÃÎÊÌâ¾Í²»ÊÇ PPP µÄ´í! 
ÒÔÎÒÎªÀýÎÒÊ¹ÓÃ ELF ºËÐÄ¶øÇÒÃ»ÓÐÉý¼¶ÊÊµ±µÄºËÐÄÄ£×é£®ÔÚÊï¹â³öÏÖÖ®Ç°ÎÒ½ö½öÀË·ÑÁË´ó¸ÅÁ½Ìì£¨ÒÔ¼°Ò»¸öÍíÉÏµÄ´ó²¿·ÖÊ±¼ä£©×çÖäÈ¥ÄÇ¸öÊÂÊµÉÏÒÑ·Ç³£Á¼ºÃµÄ PPP ËÅ·þÆ÷£®




\section{µ±ÍêÈ«ÏÝì¶½ºÖøÊ±ÈçºÎÈ¡µÃ°ïÖú}

Èç¹ûÄã²»ÄÜÊ¹ÄãµÄ PPP  Á¬½áÔË×÷£¬»ØÍ·ÖØÐÂÔÄ¶ÁÕâ·ÝÎÄ¼þ²¢¼ì²éÃ¿Ò»¼þÊÂ £­ Í¬Ê±ÅäºÏ "chat -v..." ÒÔ¼° "pppd -d"  ÔÚÄãµÄÏµÍ³¼ÇÂ¼Àï½¨Á¢µÄÊä³ö×÷Îª²Î¿¼£®



Ò²Òª²Î¿¼ PPP  ±¾ÉíµÄÎÄ¼þÒÔ¼° FAQ  ²¢¼ÓÉÏÔÚ´ËÔø¾­Ìá¼°µÄÎÄ¼þ!



Èç¹ûÄãÈÔÈ»ÏÝì¶½ºÖø×´Ì¬µÄ»°£¬ÄÇ÷áÓÐÐ©ÄÜ¹»ÔÚ PPP  Õâ·½Ãæ°ïÄãµÄÈË»áºÏÀíµÄ¡¢ÓÐ¹æÂÉµÄÉ¨Ãè comp.os.linux.misc Óë comp.os.linux.networking ÐÂÎÅÌÖÂÛÈº£¬ÒÔ¼° comp.protocols.ppp£®



Äã¿ÉÒÔ³¢ÊÔ¼Ä¸öÈËµÄµç×ÓÓÊ¼þ¸øÎÒ£¬µ«ÎÒÕæµÄÓÐ×Ô¼ºµÄ¹¤×÷£¨ºÍÉú»î£©¶øÇÒÎÒ²»±£Ö¤»áºÜ¿ìµØ»Ø¸²£¨¼´Ê¹²»ÍêÈ«»áÕâÑù£©ÒòÎªÕâµÃÊÓÎÒÄ¿Ç°µÄ¹¤×÷¸ºµ£ÒÔ¼°ÎÒË½ÈËµÄÉú»î×´Ì¬¶ø¶¨!



ÌØ±ðÊÇ £­ {\bfseries ²»ÒªÕÅÌù¼ôÏÂÀ´µÄ´íÎóÕì²âÊä³öµ½ÐÂÎÅÌÖÂÛÈºÉÏÒ²²»Òª½åÓÉµç×ÓÓÊ¼þ¼Ä¸øÎÒ} £­ Ç°ÕßÀË·Ñ´óÁ¿µÄÍøÂ·Æµ¿í¶øááÕß½«×ª¸ø {\ttfamily /dev/null} (³ý·ÇÎÒÌØ±ðÒªÇó½«Ëü¼Ä¸øÎÒ!)




\section{Á¬½áÔË×÷Ö®ááµÄÆÕ±éÎÊÌâ}

Ò»¸öÎÊÌâÊÇÄã½«»á·¢ÏÖÐí¶à·þÎñÌá¹©ÕßÖ»Ö§Ô®ËûÃÇ¸øÐÂÕÊºÅµÄÌ××°Á¬ÏßÈíÌå£®
Õâ£¨µäÐÍ£©ÊÇ¸øÎ¢ÈíÊÓ´°»·¾³µÄ :-( £­ ¶øÇÒÐí¶à·þÎñÌá¹©ÕßµÄÖ§Ô®´¦¿´À´Ò»µã¶¼²»ÁË½â Unix (or Linux)£®
ËùÒÔÒªÓÐ×¼±¸£¬´ÓËûÃÇÄÇµÃ²»µ½Ì«¶àÐ­Öú!



Äãµ±È»¿ÉÒÔ°ïËûÃÇÒ»¸öÃ¦²¢ÇÒ½ÌÓýËûÃÇ¹Øì¶ Linux µÄÖªÊ¶£¨ÈÎºÎ ISP µÄÐ­ÖúÈËÔ±ÔÚÍø¼ÊÍøÂ·ÓÃÓïÖÐ¶¼Ó¦¸Ã "ÖªµÀËü" ¶øÕâÒâÎ¶ÖøËûÃÇÔÚ¼ÒÀïÓ¦¸ÃÒªÓÐÌ¨ Linux »úÆ÷ £­ µ±È»ÊÇÕâÑù£©!




\subsection{ÎÒÎÞ·¨¿´¼ûÎÒÁ¬ÏßµÄ PPP ËÅ·þÆ÷ÒÔÍâµÄÊÀ½ç}

ºÃµÄ £­ ÄãµÄ PPP  Á¬ÏßÒÑ½¨Á¢²¢Ö´ÐÐÖÐ¶øÇÒÄã¿ÉÒÔ½åÓÉ¸Ã PPP ËÅ·þÆ÷µÄ IP ºÅÂë£¨½åÓÉ {\ttfamily ifconfig ppp0} Ö¸ÁîËùÏÔÊ¾µÄµÚ¶þ¸ö»ò  "Ô¶¶Ë"  µÄ IP ºÅÂë£© ping ¸ÃËÅ·þÆ÷£¬µ«ÊÇÄã²»ÄÜ´¥¼°ÆäááµÄÈÎºÎµØ·½£®



Ê×ÏÈ£¬³¢ÊÔ ping ÄãÔÚ {\ttfamily /etc/resolv.conf} ÀïÖ¸¶¨×÷ÎªÃû³ÆËÅ·þÆ÷ÄÇÌ¨»úÆ÷µÄ IP ºÅÂë£®
Èç¹û¿ÉÒÔµÄ»°£¬ÄÇ÷áÄã¾Í{\bfseries ¿ÉÒÔ}¼ûµ½ÔÚÄã PPP  ËÅ·þÆ÷Ö®ÍâµÄ¶«Î÷£¨³ý·ÇÕâ¸ö IP ºÅÂë¸úÄãÁ¬ÏßµÄ "Ô¶¶Ë" IP ºÅÂëÏàÍ¬£©£®
ËùÒÔÏÖÔÚÀ´ÊÔÊÔ ping ÄãµÄ·þÎñÌá¹©ÕßµÄÍêÕûÍø¼ÊÍøÂ·Ãû³Æ £­ ÀýÈç

\begin{tscreen}
\begin{verbatim}
ping my.provider.net.au
\end{verbatim}
\end{tscreen}




Èç¹ûÕâÑùÎÞ·¨³É¹¦£¬ÄÇ÷áÄãÓÐ¸öÃû³Æ½âÎöÉÏµÄÎÊÌâ£®Õâ¿ÉÄÜÊÇÒòÎªÔÚÄãµÄ {\ttfamily /etc/resolv.conf} µµ°¸ÀïÓÐ´ò×Ö´íÎó£®
´òµç»°¸øÄãµÄ·þÎñÌá¹©Õß¶ÔÕÕËùµÃµÄ×ÊÑ¶²¢ÇÒÐ¡ÐÄµØ¼ì²éÕâ¸öµµ°¸£®Èç¹û¿´ÆðÀ´È«¶¼Ã»ÎÊÌâ£¬ÔÙ´òµç»°¸ø·þÎñÌá¹©ÕßÈ·¶¨ÄãÐ´ÏÂÕýÈ·µÄ IP ºÅÂë¡µ



Èç¹ûËüÈÔÈ»ÎÞ·¨ÔË×÷£¨¶øÇÒÄãµÄ·þÎñÌá¹©ÕßÈ·ÈÏËûµÄÃû³ÆËÅ·þÆ÷ÓÐ¿ª»ú²¢ÇÒÕýÔÚÖ´ÐÐ£©£¬ÄÇ÷áÄãµÄÎÊÌâÔÚÆäËüµÄµØ·½ £­ ¶øÇÒÎÒ½¨ÒéÄãÐ¡ÐÄµØ´ÓÍ·µ½Î²¼ì²éÄã°²×°µÄ Linux£¨ÌØ±ð×¢Òâµµ°¸È¨ÏÞ£©£®



Èç¹ûÄãÈÔÈ»²»ÄÜ½åÓÉ IP ºÅÂë ping Äã·þÎñÌá¹©ÕßµÄÃû³ÆËÅ·þÆ÷£¬ÄÇ÷á²»ÊÇËûÃÇ¹Øµô»úÆ÷£¨´ò¸öµç»°¸øËûÃÇÈ·¶¨Ò»ÏÂ£©¾ÍÊÇÓÐ¸öµÝËÍÎÊÌâ·¢ÉúÔÚÄãµÄ·þÎñÌá¹©ÕßÄÇ±ß£®
ÔÙÒ»´Î£¬´òµç»°¸øËûÃÇ²éÎÊ¿´¿´£®



ÓÐ¸ö¿ÉÄÜÊÇ "Ô¶¶Ë" ÊÇÒ»Ì¨ Linux PPP ËÅ·þÆ÷¶øÔÚÆäºËÐÄÀïÃ»ÓÐÖ¸¶¨ IP forwarding Ñ¡Ïî!



Ò»¸öÁ¼ºÃµÄ²âÊÔ·½·¨ÊÇÊ¹ÓÃ´ó¶àÌá¹©¸ø£¨Ò»ÕûÌ×£© Microsoft Windows µÄÈíÌå³¢ÊÔ½øÈëÄãµÄ·þÎñÌá¹©Õß£®
Èç¹ûÍêÈ«ÏàÍ¬µÄÕÊºÅÔÚÁíÍâÒ»Ì××÷ÒµÏµÍ³ÏÂÒ»ÇÐÕý³££¬ÄÇ÷áÎÊÌâÊÇÔÚÄãµÄ Linux  ÏµÍ³ÉÏ¶ø²»ÊÇÔÚÄãµÄ·þÎñÌá¹©ÕßÄÇ±ß£®




\subsection{ÎÒ¿ÉÒÔ¼ÄËÍµç×ÓÓÊ¼þ£¬µ«²»ÄÜ½ÓÊÕ}

Èç¹ûÄãÊ¹ÓÃ¶¯Ì¬µÄ IP ºÅÂë£¬ÕâÊÇºÜÕý³£µÄ£®²ÎÔÄÏÂÃæµÄ "\ref{dynamic-server} {(ÉèÁ¢·þÎñ)}" Ò»½Ú£®




\subsection{ÎªÊ²÷áÈËÃÇ²»ÄÜÀ´ÎÒµÄ»úÆ÷ finger, WWW, gopher, talk µÈµÈ?}

Í¬ÑùµØ£¬Èç¹ûÄãÊ¹ÓÃ¶¯Ì¬µÄ IP ºÅÂë£¬ÕâÊÇ·Ç³£Õý³£µÄ£®
²ÎÔÄÏÂÃæµÄ "\ref{dynamic-server} {(ÉèÁ¢·þÎñ)}"¸Ã½Ú£®




\section{ÒÔ¶¯Ì¬ IP Ìá¹©Íø¼ÊÍøÂ··þÎñ\label{dynamic-server}}

Èç¹ûÄãÊ¹ÓÃ¶¯Ì¬µÄ IP ºÅÂë£¨Ðí¶à·þÎñÌá¹©ÕßÒ²Ö»Ìá¹©¶¯Ì¬µÄ IP ºÅÂë³ý·ÇÄãÎªÄãµÄÁ¬Ïß¸¶³ö¸ü¶à´ú¼Û£©£¬ÄÇ÷áÄã±ØÐëÈÏÊ¶ÕâÒþº¬µÄÏÞÖÆ£®



Ê×ÏÈ£¬ÍâËÍ·þÎñÇëÇó½«²»»áÓÐÎÊÌâ£®ÕâÊÇËµÄã¿ÉÒÔÊ¹ÓÃ sendmail ËÍ³öµç×ÓÓÊ¼þ£¬´ÓÔ¶¶Ë½Úµã´«Êä(ftp)µµ°¸£¬ µ÷²é(finger)ÔÚÆäËü»úÆ÷ÉÏµÄÊ¹ÓÃÕß£¬ä¯ÀÀÈ«Çò×ÊÑ¶ÍøµÈµÈ£®



ÌØ±ðÊÇ£¬ËäÈ»Äã²»ÔÚÏßÉÏµ«Äã¿ÉÒÔ»Ø¸²´ø»ØÄã»úÆ÷ÉÏµÄµç×ÓÓÊ¼þ£®ÓÊ¼þ½«µ¥´¿µØ¶ªÔÚÄãµÄÓÊµÝØùÁÐÖÐÖ±µ½Äã²¦»ØÄãµÄ ISP ÔÙÐÐËÍ³ö£®



È»¶ø£¬ÄãµÄ»úÆ÷²¢·ÇÒ»Ìì 24 Ð¡Ê±¶¼Á¬½ÓÔÚÍø¼ÊÍøÂ·ÉÏ£¬ËüÃ¿´ÎÁ¬ÏßÒ²²»»áÓµÓÐÏàÍ¬µÄ IP ºÅÂë£®
ËùÒÔÄã²»¿ÉÄÜ½ÓµÃµ½Ö±½Ó¼Äµ½Äã»úÆ÷µÄµç×ÓÓÊ¼þ£¬²¢ÇÒºÜÄÑÉèÁ¢Ò»Ì¨È«Çò×ÊÑ¶ËÅ·þÆ÷»òµµ°¸´«ÊäËÅ·þÆ÷! 
ÒòÎªÍø¼ÊÍøÂ·ÓëÄãµÄ»úÆ÷²»´æÔÚÒ»ÖÖÎ¨Ò»µÄ£¬ÓÀ¾Ã¿ÉÒÔÁªÏµµÄ¹ØÏµ£¬ÒòÎªÄãµÄ»úÆ÷²¢Ã»ÓÐÎ¨Ò»µÄ IP ºÅÂë(¼Ç×¡ - ÆäËüµÄ»úÆ÷Ò²»áÊ¹ÓÃÕâÐ© IP ºÅÂë£¬µ±ËüÃÇ²¦ÉÏÏßÊ±)£®



Èç¹ûÄãÉèÁ¢Ò»Ì¨ WWW£¨»òÈÎºÎÆäËüËÅ·þÆ÷£©£¬ÔÚÍø¼ÊÍøÂ·ÉÏµÄÈÎºÎÈË¶¼ÍêÈ«²»»áÖªµÀ³ý·ÇËûÃÇÖªµÀÄãµÄ»úÆ÷ÏÖÔÚÕýÔÚÏßÉÏÒÔ¼°ËüÈ·Êµ£¨Ä¿Ç°£©µÄ IP ºÅÂë£®
ËûÃÇÓÐÐí¶à¹ÜµÀ¿ÉÒÔµÃµ½ÕâÏî×ÊÑ¶£¬°üÀ¨ÓÉÄã´òµç»°¸øËûÃÇ£¬¼Ä·¢µç×ÓÓÊ¼þ¸æËßËûÃÇ»òÕßÊÇÔÚÄã·þÎñÌá¹©ÕßµÄÕÊºÅÉÏÇÉÃîµØÊ¹ÓÃ ".plan" µµ°¸£¨¼ÙÉèÄãµÄÌá¹©ÕßÔÊÐí shell ¼° finger ´æÈ¡£©£®



ÏÖÔÚ£¬¶Ô´ó²¿·ÖµÄÊ¹ÓÃÕß¶øÑÔ£¬Õâ²»ÊÇ¸öÎÊÌâ £­ ´ó²¿·ÖÈËÃÇËùÏëÒª×öµÄÈ«²¿Ö»ÊÇ¼ÄËÍÓë½ÓÊÕµç×ÓÓÊ¼þ£¨Ê¹ÓÃÔÚÄã·þÎñÌá¹©ÕßÉÏµÄÕÊºÅ£©ÒÔ¼°Á¬Ïßµ½È«Çò×ÊÑ¶Íø£¬´«Êäµµ°¸ÒÔ¼°ÆäËüÍø¼ÊÍøÂ·ÉÏµÄ·þÎñ£®
Èç¹ûÄã±ØÐëÓµÓÐÓÉÍâÍùÄÚµÄÁ¬Ïß·þÎñ£¬ÄãÕæµÄÓ¦¸ÃÈ¡µÃ¾²Ì¬µÄ IP ºÅÂë£®ÁíÍâÒ»ÖÖ·½·¨ÊÇÑÐ¾¿Ç°ÃæÌáÊ¾¹ýµÄ·½·¨...




\subsection{Éè¶¨µç×ÓÓÊ¼þ}

¼´Ê¹ÊÇ¶¯Ì¬µÄ IP ºÅÂë£¬ÄãµÄÈ·¿ÉÒÔÅäÖÃÄã»úÆ÷ÉÏµÄ sendmail À´ËÍ³öÄãÔÚ±¾µØ¶ËÐ´ºÃµÄÈÎºÎµç×ÓÓÊ¼þ£®
ÓÐ¹Ø sendmail µÄÅäÖÃ¿ÉÄÜ»áÊÇºÜº¬ºý¶øÇÒºÜÀ§ÄÑµÄ £­ ËùÒÔÕâ·ÝÎÄ¼þ²»»áÊÔÍ¼¸æËßÄã¸ÃÔõ÷á×ö£®
È»¶ø£¬Äã¿ÉÄÜÓ¦¸ÃÅäÖÃÄãµÄ sendmail ÒÔ±ãÄãµÄÍø¼ÊÍøÂ··þÎñÌá¹©ÕßÄÜÊÚÃüÄã×÷Îª "smart relay" Ö÷»ú£¨ÔÚ {\ttfamily sendmail.cf} µÄ {\bfseries DS} Ñ¡Ïî£©£®£¨¸üÎªÏêÏ¸µÄÅäÖÃ×ÊÑ¶Çë²ÎÔÄ sendmail µÄÎÄ¼þ £­ ²¢ÏêÔÄËæ¸½ì¶ sendmail µÄ m4 ÅäÖÃ¾Þ¼¯£®¼¸ºõ¿ÉÒÔÈ·¶¨ÀïÃæÒ»¶¨ÓÐÒ»¸öÄÜ·ûºÏÄãµÄÐèÒª£©£®



Ò²ÓÐÒ»±¾·Ç³£ºÃµÄÊéÔÚ½² Sendmail(O'Reilly and Associates ³ÆËüÎª 'Ê¥¾­')£¬µ«¶Ô´ó²¿·ÝµÄÊ¹ÓÃÕßÀ´ËµÊµÔÚÌ«¹ýÀ§ÄÑÁË!



Ò»µ©ÄãÅäÖÃºÃ sendmail áá£¬Äã¿ÉÄÜÏëÔÚ PPP Á¬Ïß¸ÕÒ»Æð¶¯µÄÊ±ºò¾ÍÒª sendmail ¸Ï¿ìËÍ³öÈÎºÎ´ýÔÚÓÊ¼þØùÁÐÀïµÄÑ¶Ï¢£®
ÒªÕâ÷á×öµÄ»°£¬¼ÓÈëÕâÐÐÖ¸Áî

\begin{tscreen}
\begin{verbatim}
sendmail -q &
\end{verbatim}
\end{tscreen}




µ½ÄãµÄ {\ttfamily /etc/ppp/ip-up} Ö¸Áî¸åÖÐ(²Î¼ûÏÂÃæËµÃ÷)£®



ÓÉÍâÍùÄÚµÄµç×ÓÓÊ¼þ¶Ô¶¯Ì¬µÄ IP ºÅÂë¶øÑÔÊÇ¸öÎÊÌâ£®´¦ÀíÕâ¸öÎÊÌâµÄ·½·¨ÊÇ:
\begin{itemize}
\item ÅäÖÃÄãµÄÊ¹ÓÃÕßÓÊµÝ³ÌÊ½ÈÃËùÓÐËÍ³öÈ¥µÄÓÊ¼þÔÚ "reply to" ±íÍ·ÖÐÓÐ¸öÔÚÄãµÄÍø¼ÊÍøÂ··þÎñÌá¹©ÕßÉÏµÄµç×ÓÓÊµÝÎ»Ö·£®\\ 
Èç¹û¿ÉÒÔµÄ»°£¬ÄãÒ²Ó¦¸Ã½«ÄãµÄ FROM µØÖ·ÉèÎªÄã ISP Ìá¹©µÄµç×ÓÓÊµÝÎ»Ö·£®
\item Ê¹ÓÃ popclient ³ÌÊ½´ÓÄãµÄ·þÎñÌá¹©ÕßÄÇ±ßß¢È¡ÄãµÄµç×ÓÓÊ¼þ£®»òÕß£¬Èç¹ûÄãµÄ ISP Ê¹ÓÃ IMAP£¬Ê¹ÓÃÖ§Ô® IMAP µÄÊ¹ÓÃÕßÓÊµÝ³ÌÊ½(ÀýÈç pine)£®
\end{itemize}




Äã¿ÉÒÔ½åÓÉÔÚ {\ttfamily /etc/ppp/ip-up} Ö¸Áî¸åÖÐ·ÅÈë±ØÒªµÄÖ¸ÁîÒÔ±ãÔÚ²¦½ÓÊ±½«Õâ¸ö¹ý³Ì×Ô¶¯»¯(²Î¼ûÏÂÃæËµÃ÷)£®




\subsection{Éè¶¨±¾µØµÄÃû³ÆËÅ·þÆ÷}

ËäÈ»Äã´ó¿ÉÊ¹ÓÃÔÚÄã ISP  ÄÇÀïµÄÁìÓòÃû³ÆËÅ·þÆ÷£¬ÄãÒ²¿ÉÒÔÉèÁ¢Ò»Ì¨±¾µØµÄÔÝ´æ×¨ÓÃ£¨´ÎÒª£©Ãû³ÆËÅ·þÆ÷£¬²¢½åÓÉ {\ttfamily ip-up} Ö¸Áî¸åÆô¶¯£®
ÅÜ±¾µØ£¨ÔÝ´æ×¨ÓÃ£©Ãû³ÆËÅ·þÆ÷µÄºÃ´¦ÊÇÈç¹ûÄãÔÚÁ¬ÏßÆÚ¼ä³£³£ÁªÏµÏàÍ¬µÄ½ÚµãÄÇ÷áËü¿ÉÒÔ½ÚÊ¡ÄãµÄÊ±¼ä£¨ÒÔ¼°Æµ¿í£©£®



ÔÝ´æ×¨ÓÃÃû³ÆËÅ·þÆ÷£¨ÔÚ {\ttfamily named.boot} µµ°¸ÀïÊ¹ÓÃÒ»ÐÐ  'forwarders' Ö¸ÏòÄã ISPs µÄ DNS£©µÄÃû³ÆËÅ·þÆ÷ÅäÖÃ±È½Ï¼òµ¥£® 
O'Reilly book (DNS and Bind) ½âÊÍËùÓÐÄãÐèÒªÖªµÀµÄ¶«Î÷£®



Ò²ÓÐÒ»·Ý \onlynameurl{DNS-HOWTO} ¿ÉÒÔÈ¡µÃ£®



Èç¹ûÄãÓÐÒ»Ð¡ÐÍÇøÓòÍøÂ·¾­ÓÉÄãµÄ Linux PC È¡ÓÃÍø¼ÊÍøÂ·(ÀýÈçÊ¹ÓÃ IP Î±×°)£¬
ÔÚ±¾µØ¶ËÖ´ÐÐÃû³ÆËÅ·þÆ÷(Ê¹ÓÃ forwarders µ¼Ïò)»áÊÇ¸öºÃÖ÷Òâ£¬ÒòÎªËü»á½µµÍÓÉÃû³Æ½âÎöËùÕ¼ÓÃµÄÍøÂ·Æµ¿í¼°ÑÓ³ÙÊ±¼ä£®



ÍøÂ·×÷ÒµµÄÒ»¸öÒªµã: µ±ÄãÒªÔÚÄã ISP µÄÁìÓòÀï¿ªÊ¼ÆôÓÃÒ»Ì¨´ÎÒªµÄ£¬ÔÝ´æ×¨ÓÃµÄÃû³ÆËÅ·þÆ÷Ö®Ç°ÏÈÑ¯ÎÊÄãµÄ ISP Ïà¹ØµÄÈ¨ÏÞ£®
ÕýÈ·ÅäÖÃËü£¬ÄãµÄ DNS Ò»µã¶¼²»»áÔì³ÉÄã ISP  µÄÀ§ÈÅ£¬µ«ÊÇÈç¹ûÄã×ö´íÁËÐ©Ê²÷á£¬Ëü¿ÉÄÜ»áÒýÆðÂé·³...




\section{Ê¹ÓÃ PPP Á¬½áÁ½¸öÍøÂ·\label{WAN}}

»ù±¾ÉÏÁ¬½áµ¥Ò»Ì¨ Linux PC µ½ PPP  ËÅ·þÆ÷ÒÔ¼°Ê¹ÓÃ PPP Á¬½áÁ½¸öÇøÓòÍøÂ·Ã»ÓÐÊ²÷á²î±ð£®¼ÇµÃ£¬PPP ÊÇÒ»ÖÖ{\bfseries µã¶Ôµã}µÄÐ­¶¨£®



È»¶ø£¬Äã{\bfseries µÄÈ·}µÃÁË½â¹Øì¶µÝËÍÂ·¾¶ÈçºÎ½¨Á¢µÄÎÊÌâ£®ÔÄ¶Á NET-2 howto ÒÔ¼° Linux Network Administrator Guide (NAG)£®
ÄãÒ²½«·¢ÏÖÕâ±¾Êé "TCP/IP Network Administration" (by O'Reilly and Assoc -  ISBN 0-937175-82-X)»áÓÐ¼«¼ÑµÄ°ïÖú£®



Èç¹ûÄãÏëÔÚÁ¬½áµÄÄ³Ò»±ßÊ¹ÓÃÒ»¸öÍøÂ·ºÅÂëµÄ´ÎÍøÂ··Ö¸î£¬Äã»á·¢ÏÖ Linux (draft) sub networking mini-howto ÂúÓÐÓÃµÄ£®
Õâ¿ÉÔÚ \nameurl{http://www.interweft.com.au/other/}{Linux Sub networking mini-HOWTO} ÕÒµ½£®



ÎªÁËÁ¬½áÁ½¸öÇøÓòÍøÂ·£¬ÄãÊ¹ÓÃµÄ{\bfseries ±ØÐë}ÊÇ²»Í¬µÄ IP ÍøÂ·±àºÅ(»òÊÇÍ¬ÑùÍøÂ·±àºÅµÄ´ÎÍøÂ·)¶øÇÒÄã½«µÃÊ¹ÓÃ¾²Ì¬µÄ IP ºÅÂë £­ »òÊ¹ÓÃ IP Î±×°£®
Èç¹ûÄãÏëÒªÊ¹ÓÃ IP Î±×°µÄ»°£¬²ÎÔÄ IP masquerade mini-howto ÓÐ¹ØËüµÄÉè¶¨½éÉÜ£®




\subsection{Éè¶¨ IP ºÅÂë}

ÓëÆäËüÇøÓòÍøÂ·µÄÍøÂ·¹ÜÀíÕßÐ­ÉÌÁ½¶ËµÄ PPP ½çÃæÊ¹ÓÃµÄ IP ºÅÂë£®
Èç¹ûÄãÊ¹ÓÃ¾²Ì¬µÄ IP ºÅÂë£¬Õâ¿ÉÄÜÒ²»áÒªÇóÄã²¦½ÓÌØ¶¨µÄµç»°ºÅÂë£®



ÏÖÔÚ±à¼­ÊÊµ±µÄ {\ttfamily /etc/ppp/options[.ttyXX]} µµ°¸ £­ ¶Ôì¶´ËÁ¬ÏßÔÚÄãÕâÒ»¶ËÊ¹ÓÃÌØ¶¨µÄÊý¾Ý»ú¼°´®ÁÐ²ºÊÇ¸öºÃÖ÷Òâ£®
Äã¿ÉÄÜÒ²µÃÒªÈ¥±ä¸üÄãµÄ {\ttfamily /etc/ppp/options} µµ°¸ £­ ²¢ÇÒÒ²ÒªÎªÈÎºÎÆäËüµÄÁ¬Ïß½¨Á¢ÊÊµ±µÄ {\ttfamily options.ttyXX} µµ°¸!



ÔÚÊÊµ±µÄÑ¡Ïîµµ°¸ÀïÖ¸¶¨ PPP Á¬½ÓÖÐÄãÕâ¶ËµÄ IP ºÅÂë£¬ÕâÓëÇ°ÃæËùÕ¹Ê¾Ê¹ÓÃ¾²Ì¬ IP ºÅÂë²¦½ÓµÄ·½Ê½ÍêÈ«ÏàÍ¬£®




\subsection{Éè¶¨µÝËÍÂ·¾¶}

Äã±ØÐë°²ÅÅÄãÇøÓòÍøÂ·ÉÏµÄ·â°ü¾­¹ý PPP Á¬½áËù½¨Á¢µÄ½çÃæµÝËÍ³öÈ¥£®ÕâÊÇ¸öÁ½½×¶ÎµÄ¹ý³Ì£®



Ê×ÏÈ£¬Äã±ØÐë½¨Á¢´ÓÖ´ÐÐ PPP Á¬½áµÄ»úÆ÷µ½Á¬½áµÄÔ¶·½ÍøÂ·È¥µÄµÝËÍÂ·¾¶£®
Èç¹û¸ÃÁ¬½áÍ¨ÍùÍø¼ÊÍøÂ·£¬ÄÇ÷áÕâ¿ÉÒÔ½åÓÉ pppd µÄÑ¡Ïî 'defaultroute' ÓÉËü×Ô¼º½¨Á¢µÄÔ¤ÉèµÝËÍÂ·¾¶À´´¦Àí¶øÄã²»±Ø×öÈÎºÎÊÂ£®



È»¶øÈç¹û¸ÃÁ¬½áÖ»ÊÇÁ¬½áÁ½¸öÇøÓòÍøÂ·£¬ÄÇ÷á±ØÐë¼ÓÈëÒ»¸öÖ¸¶¨µÄÍøÂ·µÝËÍÂ·¾¶£®
ÕâÊÇÔÚ {\ttfamily /etc/ppp/ip-up} Ö¸Áî¸åÖÐÊ¹ÓÃ 'route' Ö¸ÁîÖ´ÐÐµÄ£¨²ÎÔÄÁ¬ÏßÆð¶¯Ö®áá... ¸Ã½ÚÀïÓÐ¹ØÈçºÎÖ´ÐÐµÄ½éÉÜ£©£®



ÄãµÃ×öµÄµÚ¶þ¼þÊÂÊÇ¸æËßÔÚÄãÇøÓòÍøÂ·ÉÏµÄÆäËüµçÄÔÕâÌ¨ Linux µçÄÔÊµ¼ÊÉÏÊÇ¸Ã ppp Á¬½áÖÐÍ¨ÍùÔ¶·½ÍøÂ·µÄ'Õ¢µÀ'£®



µ±È»£¬ÕâÐ©¹¤×÷¸ÃÁ¬½áÁíÒ»¶ËµÄÍøÂ·¹ÜÀíÕßÒ²È«¶¼µÃ×ö!
È»¶ø£¬ÒòÎªËý/Ëû±ØÐë½«·â°üµÝËÍµ½ÄãµÄÍøÂ·£¬Ò»¸ö{\bfseries Ö¸¶¨µÄÍøÂ·µÝËÍÂ·¾¶}ÊÇ±ØÒªµÄ£¬¶ø²»ÊÇÔ¤ÉèµÝËÍÂ·¾¶(³ý·ÇÔ¶¶ËµÄÇøÓòÍøÂ·ÊÇÁ¬ÉÏÄãÈ¥È¡ÓÃÍø¼ÊÍøÂ·µÄ)£®




\subsection{ÍøÂ·°²È«}

Èç¹ûÄãÊ¹ÓÃ PPP Á¬½áÄãµÄÇøÓòÍøÂ·µ½Íø¼ÊÍøÂ·ÉÏÈ¥ £­ »òÉõÖÁÖ»ÊÇµ½Ò»¸ö{``}ÍâÃæµÄ{''}ÇøÓòÍøÂ·ÉÏÈ¥£¬Äã¶¼±ØÐë¿¼ÂÇ°²È«ÐÔµÄÎÊÌâ£®
ÎÒÇ¿ÁÒ¹ÄÀøÄã¿¼ÂÇÉèÁ¢Ò»Ì¨·À»ðÇ½!



Äã»¹Ó¦¸ÃÔÚÒÔ´Ë·½Ê½Á¬µ½ÍâÃæµÄÇøÓòÍøÂ·»òÍø¼ÊÍøÂ·{\bfseries Ö®Ç°}ÏÈ¸æËßÄãµÄÇøÓòÍøÂ·¹ÜÀíÕß£®
Ã»ÓÐÕâÑù×öµÄ»°¿ÉÄÜÊ¹ÄãÈÇÉÏÑÏÖØµÄÂé·³!




\section{½¨Á¢Á¬½áÖ®áá - {\ttfamily /etc/ppp/ip-up} Ö¸Áî¸å\label{ip-up}}

Ò»µ© PPP Á¬½á½¨Á¢áá£¬ pppd »áÕÒÑ° {\ttfamily /etc/ppp/ip-up} Ö¸Áî¸å£®
Èç¹ûÕâ¸öÖ¸Áî¸å´æÔÚ²¢ÇÒ¿ÉÒÔÖ´ÐÐµÄ»°£¬ÄÇ÷á PPP  ËÅ·þ³ÌÊ½¾Í»áÖ´ÐÐÕâ¸öÖ¸Áî¸å£®
ÕâÔÊÐíÄã×Ô¶¯Ö´ÐÐÈÎºÎ¿ÉÄÜÓÐ±ØÒªµÄÌØÊâµÝËÍÂ·¾¶Ö¸Áî¼°ÈÎºÎÄãÏëÔÚÃ¿´Î PPP Á¬½áÆô¶¯Ê±Ö´ÐÐµÄ¶¯×÷£®



Õâ²»¹ý¾ÍÊÇÒ»°ãÆÕÍ¨µÄ shell Ö¸Áî¸å£¬¿ÉÒÔ×öÈÎºÎÖ¸Áî¸åÄÜ×öµÄÊÂ(Ò²¾ÍÊÇ£¬ÈÎºÎÄãÏë×öµÄÊÂ)£®



ÀýÈç£¬Äã¿ÉÄÜÏëÒª sendmail ¸Ï¿ì´¦ÀíÔÚÓÊ¼þØùÁÐÖÐµÈ´ýÍâËÍµÄÑ¶Ï¢£®



ÀàËÆµØ£¬Äã¿ÉÒÔÔÚ {\ttfamily ip-up} Àï²åÈëÒ»Ð©Ö¸ÁîÈ¡µÃ£¨Ê¹ÓÃ POP£©ÔÚÄãµÄ ISP ÄÇ±ßµÈÖøÄãµÄÈÎºÎµç×ÓÓÊ¼þ£®



²»¹ýÔÚ {\ttfamily /etc/ppp/ip-up} Ò²ÓÐÐ©ÏÞÖÆ:-

\begin{itemize}
\item ËüÒÔ¾ÖÏÞµÄ»·¾³±äÊýÒÔÔö¼Ó°²È«ÐÔ£®ÕâÒ²¾ÍÊÇËµÄã±ØÐë¸ø³öÖ´ÐÐµµµÄÈ«²¿Â·¾¶Ãû³ÆµÈ£®
\item ¼¼ÊõÉÏÀ´Ëµ£¬{\ttfamily /etc/ppp/ip-up} ÊÇÒ»¸ö{\itshape ³ÌÊ½\/}¶ø·ÇÖ¸Áî¸å£®
ÕâÊÇËµËü¿ÉÒÔ±»Ö±½ÓÖ´ÐÐ - Ò²Òò´ËËüÔÚµÚÒ»ÐÐ¿ªÊ¼±ØÐë¾ßÓÐ±ê×¼µÄ file magic ({\ttfamily \#!/bin/bash}) ²¢ÇÒÄÜ±» root ¶ÁÈ¡¼°Ö´ÐÐ£®
\end{itemize}





\subsection{ÌØÊâµÝËÍÂ·¾¶}

Èç¹ûÄãÁ¬½áµÄÊÇÁ½¸öÇøÓòÍøÂ·£¬Äã½«µÃÉèÁ¢Ò»¸öµ½ 'ÍâÃæµÄ' ÇøÓòÍøÂ·µÄÖ¸¶¨µÝËÍÂ·¾¶£®
Õâ¿ÉÒÔºÜÈÝÒ×µÄÊ¹ÓÃ {\ttfamily /etc/ppp/ip-up} Ö¸Áî¸å´ï³É£®Î¨Ò»µÄÀ§ÄÑ·¢ÉúÔÚÄãµÄ»úÆ÷ÓÐ¶à¸ö PPP  Á¬½áÊ±£®



ÕâÊÇÒòÎª {\ttfamily /etc/ppp/ip-up} Õâ¸öÖ¸Áî¸åÊÇÓÉÃ¿Ò»¸öÆð¶¯µÄ ppp Á¬ÏßËùÖ´ÐÐµÄ£¬ËùÒÔÄãµÃÒªÐ¡ÐÄµØÎªÃ¿Ò»¸öÆð¶¯µÄÁ¬½áÖ´ÐÐÕýÈ·µÄµÝËÍÖ¸Áî!




\subsection{´¦Àíµç×ÓÓÊ¼þØùÁÐ}

µ±Á½¸öÇøÓòÍøÂ·µÄÁ¬½á½¨Á¢Ö®áá£¬Äã¿ÉÄÜÏëÒªÈ·¶¨·ÅÔÚØùÁÐÖÐµÄµç×ÓÓÊ¼þ±»{\itshape Çå³ö\/} - ËÍµ½ËüµÄÄ¿µÄµØ£®
Õâ¿ÉÒÔÓÃÊÊµ±µÄºô½Ð {\ttfamily sendmail} À´´ï³É£® 



ÔÚ pppd ´«µÝ¸øÖ¸Áî¸åµÄÌØ¶¨²ÎÊýÉÏÊ¹ÓÃ bash µÄ `case' ÐðÊöÀ´Íê³ÉÕâ¸ö¹¤×÷£®
ÀýÈç£¬ÕâÊÇÎÒÓÃÀ´´¦ÀíÎÒÃÇµÄ¹ãÓòÍøÂ·Á¬½á¼°Í¨ÍùÎÒ¼ÒÒÒÌ«ÍøÂ·µÄ£¨Ò²ÊÇÓÉÏàÍ¬µÄ PPP  ËÅ·þÆ÷´¦Àí£©{\ttfamily /etc/ppp/ip-up} Ö¸Áî¸å£®




\subsection{Ò»¸ö {\ttfamily /etc/ppp/ip-up} Ö¸Áî¸åµÄÀý×Ó}

ÏÂÃæµÄÀý×ÓÌá¹©²»Í¬µÄÊ¹ÓÃ¡õÀý£®

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
#!/bin/bash
#
# Script which handles the routing issues as necessary for pppd
# Only the link to Newman requires this handling.
#
# When the ppp link comes up, this script is called with the following
# parameters
#       $1      the interface name used by pppd (e.g. ppp3)
#       $2      the tty device name
#       $3      the tty device speed
#       $4      the local IP address for the interface
#       $5      the remote IP address
#       $6      the parameter specified by the 'ipparam' option to pppd
#
case "$5" in
# Handle the routing to the Newman Campus server
        202.12.126.1)
                /sbin/route add -net 202.12.126.0 gw 202.12.126.1
# and flush the mail queue to get their email there asap!
                /usr/sbin/sendmail -q &
                ;;
        139.130.177.2)
# Our Internet link
# When the link comes up, start the time server and synchronise to the world
# provided it is not already running
                if [ ! -f /var/lock/subsys/xntpd ]; then
                        /etc/rc.d/init.d/xntpd.init start &
                fi
# Start the news server (if not already running)
                if [ ! -f /var/lock/subsys/news ]; then
                        /etc/rc.d/init.d/news start &
                fi
                ;;
        203.18.8.104)
# Get the email down to my home machine as soon as the link comes up
# No routing is required as my home Ethernet is handled by IP
# masquerade and proxyarp routing.
                /usr/sbin/sendmail -q &
                ;;
        *)
esac
exit 0
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




Æð¶¯Í¨ÍùÎÒÃÇ Newman Ð£Ô°µÄ ppp Á¬½áÒÔ¼°Õâ¸öÖ¸Áî¸åµÄ½á¹û£¬ÎÒÃÇ×îááµÃµ½ÏÂÃæÕâ¸öµÝËÍ±í¸ñ¼ÇÂ¼£¨ÕâÌ¨»úÆ÷Ò²ÊÇÎÒÃÇÍ¨³£ÓÃµÄ PPP ËÅ·þÆ÷²¢ÇÒ´¦ÀíÎÒÃÇµÄÍø¼ÊÍøÂ·Á¬½á£©£®
ÎÒÒÑ¾­ÔÚÕâ¸öÊä³öÀï¼ÓÈëÒ»Ð©×¢½âÒÔ½âÊÍÃ¿¸öÏîÄ¿ÊÇÊ²÷á:

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
[root@kepler /root]# route -n
Kernel routing table
Destination     Gateway         Genmask         Flags MSS    Window Use Iface
# the HOST route to our remote internet gateway
139.130.177.2   *               255.255.255.255 UH    1500   0      134 ppp4
# the HOST route to our Newman campus server
202.12.126.1    *               255.255.255.255 UH    1500   0       82 ppp5
# the HOST route to my home ethernet
203.18.8.104    *               255.255.255.255 UH    1500   0       74 ppp3
# two of our general dial up PPP lines
203.18.8.64     *               255.255.255.255 UH    552    0        0 ppp2
203.18.8.62     *               255.255.255.255 UH    552    0        1 ppp1
# the specific network route to the Newman campus LAN
202.12.126.0    202.12.126.1    255.255.255.0   UG    1500   0        0 ppp5
# the route to our local Ethernet (super-netting two adjacent C classes)
203.18.8.0      *               255.255.254.0   U     1500   0     1683 eth0
# the route to the loop back device
127.0.0.0       *               255.0.0.0       U     3584   0      483 lo
# the default route to the Internet
default         139.130.177.2   *               UG    1500   0     3633 ppp4
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}





\subsection{´¦Àíµç×ÓÓÊ¼þ}

ÉÏÒ»½ÚÌá¼°ÈçºÎ´¦ÀíÍâËÍµÄÓÊ¼þ £­ Ò»µ©Á¬Ïß½¨Á¢Ö®áá¼òµ¥µØ½åÓÉÇå³öÓÊ¼þØùÁÐ´ï³É£®

Èç¹ûÄãÖ´ÐÐÁ¬Íù¹ãÓòÍøÂ·µÄÁ¬½á£¬Äã¿ÉÒÔ¸úÔ¶¶ËÇøÓòÍøÂ·µÄÍøÂ·¹ÜÀíÕßÐ­µ÷ÇëËüÃÇÖ´ÐÐÍêÈ«ÏàÍ¬µÄ¶¯×÷£®
ÀýÈç£¬ÔÚÎÒÃÇµÄ¹ãÓòÍøÂ·Á¬½áÖÐ Newman Ð£Ô°ÄÇÒ»¶ËµÄ {\ttfamily /etc/ppp/ip-up} Ö¸Áî¸å¿´ÆðÀ´Ïñ:

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
#!/bin/bash
#
# Script which handles the routing issues as necessary for pppd
# Only the link to Hedland requires this handling.
#
# When the ppp link comes up, this script is called with the following
# parameters
#       $1      the interface name used by pppd (e.g. ppp3)
#       $2      the tty device name
#       $3      the tty device speed
#       $4      the local IP address for the interface
#       $5      the remote IP address
#       $6      the parameter specified by the 'ipparam' option to pppd
#
case "$5" in
        203.18.8.4)
                /usr/sbin/sendmail -q
                ;;
        *)
esac
exit 0
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




È»¶øÈç¹ûÄãÖ»ÄÜÊ¹ÓÃ¶¯Ì¬ IP ºÅÂë·½Ê½µÄ PPP  Á¬ÏßÁ¬ÍùÄãµÄ ISP£¬ÄãµÃ´ÓÔÚÄã ISP »úÆ÷ÉÏµÄÕÊºÅÈ¡µÃÄãµÄµç×ÓÓÊ¼þ£®
ÕâÍ¨³£ÊÇÊ¹ÓÃ POP(Post Office Protocol)Ð­¶¨À´´ï³ÉµÄ£®¿ÉÒÔÊ¹ÓÃ `popclient' ³ÌÊ½´¦ÀíÕâ¸ö³ÌÐò £­ ¶ø {\ttfamily ip-up} Ö¸Áî¸åÒ²¿ÉÒÔÎªÄã×Ô¶¯»¯Õâ¸ö³ÌÐò£®



¼òµ¥µØ½¨Á¢Ò»¸ö {\ttfamily /etc/ppp/ip-up} Ö¸Áî¸å£¬ÆäÖÐ°üº¬ÓÐÆð¶¯ popclient ³ÌÊ½µÄÊÊµ±Ö¸Áî£®
ÔÚÎÒÖ´ÐÐ Red Hat Linux  µÄÏ¥ÉÏÐÍµçÄÔÉÏ£¨ÈÎºÎÂÃÐÐÊ±ÎÒ¶¼´øÖøËü£©ÊÇÕâÑùµÄ

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
popclient -3 -c -u hartr -p <password> kepler.hedland.edu.au |formail -s procmail
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




Äã¿ÉÒÔÊ¹ÓÃ slurp »òÆäËüÈíÌåÒÔÏàÍ¬µÄ·½Ê½È¡µÃÍøÂ·ÐÂÎÅ£¬ÒÔ¼°ÖîÈç´ËÀàµÄ·þÎñ£®
¼ÇµÃ£¬ip-up Õâ¸öÖ¸Áî¸åÖ»ÊÇ¸ö±ê×¼µÄ bash Ö¸Áî¸åÒò´Ë¿ÉÒÔÓÃÀ´×Ô¶¯»¯µ±Ã¿´ÎÊÊµ±µÄ PPP Á¬½á½¨Á¢Ê±ÐèÒªÍê³ÉµÄÈÎºÎ¹¦ÄÜ£®




\section{Ê¹ÓÃ {\ttfamily /etc/ppp/ip-down}}

Äã¿ÉÒÔ½¨Á¢Ò»Ö¸Áî¸åÔÚÁ¬½ÓÒ»µ©½áÊøÖ®ááÖ´ÐÐ£®Õâ´æ·ÅÔÚ {\ttfamily /etc/ppp/ip-down} Àï£®
Õâ¿ÉÒÔÓÃÀ´»¹Ô­ÈÎºÎ¶ÔÓ¦ÄãÔÚ {\ttfamily /etc/ppp/ip-up} Ö¸Áî¸åÖÐ×öµÄÌØÊâ¶¯×÷£®




\section{ÇøÓòÍøÂ·ÉÏµÄµÝËÍÎÊÌâ}

Èç¹ûÄãÒÑ¾­Á¬½ÓÔÚÄ³¸öÇøÓòÍøÂ·ÉÏµ«ÊÇÈÔÈ»ÏëÒªÊ¹ÓÃÔÚÄã¸öÈËµÄ Linux »úÆ÷ÉÏµÄ pppd µÄ»°£¬ÄãµÃÒªÓ¦¸¶Ä³Ð©µÝËÍ·â°üµÄÎÊÌâ£¬´ÓÄãµÄ»úÆ÷µ½ÄãµÄÇøÓòÍøÂ·£¨¾­¹ýÄãµÄÒÒÌ«ÍøÂ·½çÃæ£©ÒÔ¼°µ½Ô¶¶ËµÄ PPP ËÅ·þÆ÷ºÍ¸üÍâÃæµÄÊÀ½ç£®



ÕâÒ»½Ú²¢²»³¢ÊÔ½ÌÄãÓÐ¹Ø·â°üµÝËÍµÄ»úÖÆ £­ ËüÖ»´¦ÀíÒ»¸ö¼òµ¥µÄ£¬ÌØ¶¨µÄµÝËÍÇé¿ö£¨¾²Ì¬µÄ£©!



Èç¹ûÄã²»ÊìÏ¤µÝËÍ»úÖÆµÄ»°£¬ÄÇ÷áÎÒÇ¿ÁÒµØ¹ÄÀøÄãÔÄ¶Á Linux Network Administrator Guide (NAG)£®
Í¬Ê± O'Reilly µÄÊé "TCP/IP Network Administration" Ò²ÒÔ·Ç³£ÈÝÒ×ÁË½âµÄ·½Ê½º­¸ÇÁËÕâ¸öÖ÷Ìâ£®



¾²Ì¬µÝËÍÂ·¾¶µÄ»ù±¾¹æÔòÊÇÔ¤ÉèµÝËÍÂ·¾¶Ó¦¸ÃÊÇÖ¸ÏòÍøÂ·Î»Ö·ºÅÂë×î¶àµÄÄÇÒ»¸ö£®
¶Ôì¶ÆäËüµÄÍøÂ·ÔòÔÚµÝËÍ±í¸ñÖÐÊäÈëÖ¸¶¨µÝËÍÂ·¾¶£®



ÎÒÎ¨Ò»´òËãÔÚÕâÀï½éÉÜµÄÇé¿öÊÇÄãµÄ Linux »úÆ÷ÔÚÒ»¸öÃ»ÓÐÁ¬ÉÏÍø¼ÊÍøÂ·µÄÇøÓòÍøÂ·ÉÏ £­ ¶øÄãÏëÒªÔÚÈÔÈ»Á¬½ÓÖøÇøÓòÍøÂ·µÄÇé¿öÏÂ²¦½Óµ½Íø¼ÊÍøÂ·ÉÏ¹©×Ô¼ºÊ¹ÓÃ£®



Ê×ÏÈ£¬È·¶¨ÄãµÄÒÒÌ«ÍøÂ·µÝËÍÂ·¾¶ÊÇÉèÍùÄÜ¹»Í¨¹ýÄãµÄÇøÓòÍøÂ·µÄÖ¸¶¨ÍøÂ·Î»Ö· £­ ²»ÊÇÉèÍùÔ¤ÉèµÝËÍÂ·¾¶!



½åÓÉ·¢³ö route  Ö¸Áî¼ì²éÖ®£¬ÄãÓ¦¸Ã»á¿´¼ûÈçÏÂµÄÑ¶Ï¢:

\begin{tscreen}
\begin{verbatim}
[root@hwin /root]# route -n
Kernel routing table
Destination     Gateway         Genmask         Flags MSS    Window Use Iface
loopback        *               255.255.255.0   U     1936   0       50 lo
10.0.0.0        *               255.255.255.0   U     1436   0      565 eth0
\end{verbatim}
\end{tscreen}




Èç¹ûÄãµÄÒÒÌ«ÍøÂ·½çÃæ (eth0) Ö¸ÏòÔ¤ÉèµÝËÍÂ·¾¶£¬£¨ÔÚ eth0 ¸ÃÐÐµÄµÚÒ»ÁÐÉÏ»áÏÔÊ¾ "default" ×ÖÑù£©ÄÇ÷áÄãµÃÒª±ä¸üÄãµÄÒÒÌ«ÍøÂ·ÆðÊ¼Ö¸Áî¸åÊ¹ËüÖ¸ÏòÌØ¶¨µÄÍøÂ·ºÅÂë¶ø·ÇÔ¤ÉèµÝËÍÂ·¾¶£¨²ÎÕÕ  Net2 HOWTO ÒÔ¼° NAG£©£®



Õâ½«ÔÊÐí pppd ÉèÁ¢ÄãµÄÔ¤ÉèµÝËÍÂ·¾¶£¬ÈçÏÂËùÊ¾:

\begin{tscreen}
\begin{verbatim}
[root@hwin /root]# route -n
Kernel routing table

Destination     Gateway         Genmask         Flags MSS    Window Use Iface
10.144.153.51   *               255.255.255.255 UH    488    0        0 ppp0
127.0.0.0       *               255.255.255.0   U     1936   0       50 lo
10.1.0.0        *               255.255.255.0   U     1436   0      569 eth0
default         10.144.153.51   *               UG    488    0        3 ppp0
\end{verbatim}
\end{tscreen}




ÈçÍ¬ÄãËù¼ûµ½µÄ£¬ÎÒÃÇÓµÓÐ¾­ÓÉ ppp0 µ½ PPP ËÅ·þÆ÷(10.144.153.51)µÄÖ÷»úµÝËÍÉè¶¨¶øÇÒÒ²ÓµÓÐÊ¹ÓÃ PPP ËÅ·þÆ÷×÷ÎªÕ¢µÀµÄÔ¤ÉèÍøÂ·µÝËÍÉè¶¨£®



Èç¹ûÄãµÄÉè¶¨µÃÒª±È´Ë¸ü¸´ÔÓ £­ ÔÄ¶ÁÒÑ¾­Ìá¹ýÓÐ¹ØµÝËÍµÄÎÄ¼þ²¢Çë½ÌÔÚÄãÉíÅÔµÄ×¨¼Ò!



Èç¹ûÄãµÄÇøÓòÍøÂ·ÉÏÒÑ¾­ÓÐÂ·ÓÉÆ÷£¬ÄÇ÷áÔÚÄãÄÇÀïÒÑ¾­½¨Á¢ÁËÍ¨Íù¿í¹ãÍøÂ·ÊÀ½çµÄÕ¢µÀ£®
ÄãÈÔÓ¦°ÑÄãµÄÔ¤ÉèµÝËÍÂ·¾¶Ö¸Íù PPP ½çÃæ £­ ²¢ÇÒÊ¹ÆäËüµÄµÝËÍÂ·¾¶Ö¸¶¨µ½ÓÉÂ·ÓÉÆ÷·þÎñµÄÍøÂ·£®




\subsection{°²È«ÉÏµÄ×¢ÒâÊÂÏî}

µ±ÄãÔÚÏÖÓÐµÄÇøÓòÍøÂ·ÉÏÉè¶¨Ò»Ì¨ Linux »úÆ÷Á¬½áµ½Íø¼ÊÍøÂ·ÉÏ£¬ÄãÔÚ²»Öª²»¾õÖÐÒÑ¾­¶ÔÍø¼ÊÍøÂ· £­ ÒÔ¼°ÔÚÄÇÀïµÄº§¿ÍÃÇ £­ ¿ª·ÅÁËÄãµÄÕû¸öÇøÓòÍøÂ·£®
ÔÚÄãÕâÑù×öÖ®Ç°£¬ÎÒÇ¿ÁÒµØ¹ÄÀøÄãÇë½ÌÄãµÄÍøÂ·¹ÜÀíÕß²¢²Î¿¼¸Ã´¦µÄ°²È«²ßÂÔ£®
Èç¹ûÄãµÄ PPP Á¬Ïß±»³É¹¦µØÓÃÀ´¹¥»÷ÄãµÄÕ¾Ì¨µÄ»°£¬ÄÇ÷áÄã×îÉÙÒ²»áÕÐÖÂÍ¬â·µÄÊ¹ÓÃÕß£¬ÍøÂ·¼°ÏµÍ³µÄ¹ÜÀíÕßÇ¿ÁÒµÄ·ßÅ­£®
ÄãÒ²¿ÉÄÜ»á·¢ÏÖÄã×Ô¼ºÖÃÉíì¶·Ç³£ÑÏÖØµÄÂé·³!

ÔÚÄãÁ¬½ÓÇøÓòÍøÂ·µ½Íø¼ÊÍøÂ·ÉÏÈ¥Ö®Ç°£¬ÉõÖÁÊÇ¶¯Ì¬µÄÁ¬ÏßÄã¶¼Ó¦¸ÃÒª¿¼ÂÇ°²È«µÄÒþÓÇ £­ Òò´ËÔçµã²Î¿¼ O'Reilly µÄ "Building Internet Firewalls"!




\section{½¨Á¢ PPP ËÅ·þÆ÷\label{ppp-server}}

ÈçÍ¬Ç°ÃæÌá¹ýµÄ£¬Õâ¼þ¹¤×÷ÓÐÐí¶à·½·¨¿ÉÒÔ¿ÉÒÔ´ï³É£®
ÎÒÔÚÕâÀïËù½éÉÜµÄÊÇÎÒÔõ÷á×öµÄ·½·¨£¨Ê¹ÓÃ Cyclades ¶à²º´®ÁÐ¿¨£©ÒÔ¼°Ò»×é×Ô¶¯×ª½ÓµÄµç»°ÏßÂ·£®



Èç¹ûÄã²»Ï²»¶ÎÒÔÚÕâÀï½éÉÜµÄ·½·¨£¬Çë×ÔÓÉµØÊ¹ÓÃÄã×Ô¼ºµÄ·½·¨£®
²»¹ý£¬ÎÒºÜÀÖÒâÔÚÕâ·ÝÊ¹ÓÃËµÃ÷Î´À´µÄ°æ±¾ÖÐ°üº¬¶îÍâµÄ·½Ê½£®ËùÒÔ£¬Çë°ÑÄãµÄÆÀÂÛ¸ú·½·¨¼Ä¸øÎÒ!



Çë×¢Òâ£¬ÕâÒ»½ÚÖ»¸úÈçºÎÉè¶¨ Linux  ×÷Îª PPP ËÅ·þÆ÷ÓÐ¹Ø£®ÎÒ²»Ïë£¨²»Ôø£©°üº¬ÓÐ¹ØÉè¶¨ÌØÊâÖÕ¶Ë»úËÅ·þÆ÷¼°ÕâÒ»ÀàµÄ×ÊÑ¶£®



¶øÇÒ£¬ÎÒÉÐÎ´ÊµÑé¹ýÅäºÏ shadow ÃÜÂëÊ¹ÓÃ£¨µ«Ó¦¸Ã»á×ö£©£®Òò´ËÄ¿Ç°½éÉÜµÄ×ÊÑ¶²¢²»°üº¬ÈÎºÎ shadow ÐèÒªµÄÉè¶¨£®




\subsection{±àÒëºËÐÄ}

ËùÓÐÔçÏÈÌá¹ý¹Øì¶±àÒëºËÐÄÒÔ¼°ºËÐÄÓë pppd °æ±¾µÄËµÃ÷¶¼ÊÊÓÃ£®Õâ½Ú¼ÙÉèÄãÒÑ¾­¶Á¹ýÕâ·ÝÎÄ¼þÇ°ÃæµÄÕÂ½Ú!



¶Ôì¶ PPP  ËÅ·þÆ÷£¬Äã±ØÐëÔÚÄãµÄºËÐÄÖÐ°üº¬ IP forwarding µÄ¹¦ÄÜ£®
ÄãÒ²¿ÉÄÜ»áÏ£Íû°üº¬ÆäËüµÄ¹¦ÄÜ£¨ÏñÊÇ IP firewalls, accounting µÈµÈ£©£®



Èç¹ûÄãÊ¹ÓÃ¶à²º´®ÁÐ¿¨£¬ÄÇ÷áÄãÒ²±ØÐëÃ÷È·µØÔÚÄãµÄºËÐÄÖÐ°üº¬±ØÒªµÄÇý¶¯³ÌÊ½!




\subsection{ËÅ·þÆ÷ÏµÍ³µÄ¸Å¹Û}

ÎÒÃÇÊ¹ÓÃÏàÍ¬µÄÊ¹ÓÃÕßÃû³Æ£¯ÃÜÂëÅä¶ÔÌá¹©²¦½Ó PPP (and SLIP) ÕÊºÅÒÔ¼° shell ÕÊºÅ£®
ÕâÑù×öµÄºÃ´¦£¨¶ÔÎÒÃÇ¶øÑÔ£©ÊÇÊ¹ÓÃÕßÖ»ÐèÒªÒ»¸öÕÊºÅ¾Í¿ÉÒÔÊ¹ÓÃËùÓÐÖÖÀàµÄÁ¬Ïß£®



ÒòÎªÎÒÃÇÊÇ½ÌÓý×éÖ¯£¬ÎÒÃÇ²¢²»¶ÔÖ°Ô±ÒÔ¼°Ñ§ÉúµÄÊ¹ÓÃÊÕ·Ñ£¬ËùÒÔ²»±Øµ£ÐÄ¼ÆËãÓëÊÕ·ÑµÄÎÊÌâ£®



ÔÚÎÒÃÇµÄ½ÚµãÓëÍø¼ÊÍøÂ·Ö®¼äÎÒÃÇÉèÖÃÓÐÒ»Ì¨·À»ðÇ½£¬¶øÕâ»áÏÞÖÆÄ³Ð©Ê¹ÓÃÕßµÄ´æÈ¡£¬ÒòÎª²¦½ÓÏßÂ·ÊÇÔÚÎÒÃÇµÄ£¨Íø¼ÊÍøÂ·£©·À»ðÇ½ÄÚ£¨ÀíÓÉºÜÃ÷ÏÔ£¬ÆäËûÍø¼ÊÍøÂ··À»ðÇ½µÄÏ¸½ÚÒ²²»»áÔÚ´Ë³öÏÖ¶øÇÒÔÚÈÎºÎÇé¿öÏÂ¶¼Ã»ÓÐ¹ØÏµ£©£®



Ê¹ÓÃÕß½¨Á¢Á¬ÍùÎÒÃÇ½ÚµãÖ® PPP Á¬½áµÄ³ÌÐò£¨µ±È»ÊÇÔÚËûÃÇÓµÓÐÓÐÐ§µÄÕÊºÅáá£©ÊÇ:
\begin{itemize}
\item ²¦ÈëÎÒÃÇµÄ×Ô¶¯×ª½Ó²¦ºÅÆ÷£¨ÕâÊÇÁ¬½áÒ»¶ÑÊý¾Ý»úµÄµ¥Ò»µç»°ºÅÂë £­ µÚÒ»Ì¨¿Õ¡õµÄÊý¾Ý»ú»á½ÓÆð²¦ÈëµÄµç»°£©£®
\item Ê¹ÓÃÒ»¶ÔÓÐÐ§µÄÊ¹ÓÃÕßÃû³ÆÒÔ¼°ÃÜÂëÇ©Èë£®
\item ÔÚ shell ÌáÊ¾·ûºÅÏÂ£¬·¢³ö {\ttfamily ppp} Ö¸ÁîÒÔÆô¶¯ËÅ·þÆ÷ÉÏµÄ PPP ³ÌÐò£®
\item Æô¶¯ËûÃÇ»úÆ÷ÉÏµÄ PPP£¨¿ÉÒÔÊÇÖ´ÐÐ Windows, DOS, Linux, MAC OS »òÈÎºÎ×÷ÒµÏµÍ³µÄ»úÆ÷ £­ ÕâÊÇËûÃÇµÄÎÊÌâ£©£®
\end{itemize}




ÕâÌ¨ËÅ·þÆ÷ÎªÃ¿¸ö²¦ÈëµÄ²ºÊ¹ÓÃ¸ö±ðµÄ {\ttfamily /etc/ppp/options.ttyXX} µµ°¸£¬¶øÕâÎª¶¯Ì¬µÄ IP ·ÖÅäÉè¶¨Ô¶¶ËµÄ IP ºÅÂë£®
ËÅ·þÆ÷ÎªÔ¶µØµÄ¿Í»§¶ËÊ¹ÓÃ´úÀíÎ»Ö·½âÎöÐ­¶¨(proxyarp)À´µÝËÍ·â°ü£¨¾­ÓÉÊÊµ±µÄ pppd Ñ¡Ïî¼ÓÒÔÉè¶¨£©£®
Õâ±ÜÃâÁËÊ¹ÓÃ routed »òÊÇ gated µÄÐèÇó£®



µ±Ê¹ÓÃÕß´ÓËûÃÇÄÇ¶Ë¹Ò¶ÏÊ±£¬pppd »áÕì²â³öÀ´²¢¸æËßÊý¾Ý»úÒªËü¹Ò¶Ï£¬Í¬Ê±Í£µô PPP Á¬½á£®




\subsection{ËùÐèµÄÈ«²¿ÈíÌå}

Äã½«»áÐèÒªÏÂÁÐµÄÈíÌå:-
\begin{itemize}
\item Linux£¬ÊÊµ±µØ±àÒëÒÔ°üº¬±ØÒªµÄÑ¡Ïî£®
\item ÊÊºÏì¶ÄãºËÐÄµÄ pppd °æ±¾£®
\item Ò»Ì×ÄÜ¹»´ÏÃ÷µØ´¦ÀíÊý¾Ý»úÍ¨Ñ¶µÄ 'getty' ³ÌÊ½£®\\ 
ÔÚÕâÀïÎÒÃÇÊ¹ÓÃµÄÊÇ getty\_ps2.0.7h £¬µ«»ý¼«¿¼ÂÇ mgetty£®
ÎÒÁË½â mgetty ¿ÉÒÔÕì²â³öÊ¹ÓÃ pap/chap µÄºô½Ð£¨ pap ÊÇ Windows 95 Ê¹ÓÃµÄ±ê×¼£©²¢×Ô¶¯µØÆð¶¯ pppd£¬µ«ÊÇÎÒÉÐÎ´ÑÐ¾¿¹ýËü£®
\item ÄãµÄ²¦½ÓÊ¹ÓÃÕßÄÜ¹»´æÈ¡µÄÒ»Ì¨ÁìÓòÃû³ÆËÅ·þÆ÷ (DNS)£®\\ 
Èç¹ûÓÐ¿ÉÄÜµÄ»°ÄãÕæµÄÓ¦¸ÃÖ´ÐÐÄã×Ô¼ºµÄÁìÓòÃû³ÆËÅ·þÆ÷...
\end{itemize}





\subsection{Éè¶¨±ê×¼µÄ²¦½Ó(shell access)}

ÔÚÄã¿ÉÒÔÉèÁ¢ÄãµÄ PPP  ËÅ·þÆ÷Ö®Ç°£¬ÄãµÄ Linux »úÆ÷±ØÐëÄÜ¹»´¦Àí±ê×¼µÄ²¦½Ó´æÈ¡£®



{\bfseries Õâ·ÝÊ¹ÓÃËµÃ÷²¢²»º­¸ÇÕâÏîÉè¶¨·½·¨£®Çë²ÎÔÄÄãÑ¡ÔñÖ® getty µÄÎÄ¼þÒÔ¼° \onlynameurl{Serial HOWTO} ÀïÓÐ¹ØÕâÏîÉè¶¨µÄ×ÊÑ¶£®}




\subsection{ÉèÁ¢ PPP Ñ¡Ïîµµ°¸}

Äã½«µÃÎªËùÓÐ²¦½Ó²ºÉèÁ¢Ò»¸öÈ«ÌåµÄ {\ttfamily /etc/ppp/options} µµ°¸£¬ÆäÖÐÊÇÍ¨ÓÃµÄÑ¡Ïî£®
ÎÒÃÇÊ¹ÓÃµÄÑ¡ÏîÊÇ:

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
asyncmap 0
netmask 255.255.254.0
proxyarp
lock
crtscts
modem
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




×¢Òâ - ÎÒÃÇÃ»ÓÐÊ¹ÓÃÈÎºÎ(Ã÷ÏÔµÄ)µÝËÍÉè¶¨ - ÌØ±ðÊÇÕâÀïÃ»ÓÐ {\ttfamily defaultroute} Ñ¡Ïî£®
ÕâÀíÓÉÊÇÒòÎªËùÓÐÄã(×öÎª PPP ËÅ·þÆ÷)ËùÒª×öµÄ¾ÍÊÇ½«·â°ü{\bfseries ´Ó} PPP ¿Í»§¶ËµÝËÍµ½ÄãµÄÇøÓòÍøÂ·»òÍø¼ÊÍøÂ·²¢ÇÒ½«·â°üÓÉÄãµÄÇøÓòÍøÂ·µÝËÍ{\bfseries µ½}ÄãµÄ¿Í»§¶Ë£®



È«²¿ËùÐèµÄÖ»ÊÇµ½¿Í»§»úÆ÷µÄÖ÷»úµÝËÍ£¬¶øÊ¹ÓÃ pppd µÄ '{\ttfamily proxyarp}' Ñ¡Ïî´ï³É£®



Õâ¸ö '{\ttfamily proxyarp}' Ñ¡ÏîÉèÁ¢Ò»¸ö´úÀíÎ»Ö·½âÎöÐ­¶¨µÄÏîÄ¿ì¶ PPP ËÅ·þÆ÷µÄÎ»Ö·½âÎöÐ­¶¨(ARP)±í¸ñÖÐ£¬ÄÇ»ù±¾ÉÏ¾ÍÊÇËµ '½«ËùÓÐÒª¸ø PPP ¿Í»§¶ËµÄ·â°üËÍ¸øÎÒ'£®
ÕâÊÇ½¨Á¢µ¥Ò» PPP ¿Í»§¶ËµÄµÝËÍÂ·¾¶×î¼òµ¥µÄÒ»¸ö·½Ê½ - µ«Äã²»ÄÜÓÃÕâÖÖ·½Ê½ÔÚÁ½¸öÇøÓòÍøÂ·Ö®¼äµÝËÍ·â°ü - Äã±ØÐë¼ÓÈëÊÊµ±µÄÍøÂ·µÝËÍ¶ø²»ÄÜÊ¹ÓÃ´úÀíÎ»Ö·½âÎöÐ­¶¨£®



Äã¼¸ºõÒ»¶¨»áÏ£ÍûÌá¹©¶¯Ì¬·ÖÅäµÄ IP ºÅÂë¸øÄãµÄ²¦½ÓÊ¹ÓÃÕß£®Äã¿ÉÒÔ½åÓÉ·ÖÅä IP ºÅÂë¸øÃ¿¸ö²¦½Ó²ºÀ´´ï³ÉÄ¿µÄ£®
ÏÖÔÚ£¬ÎªÄãµÄÃ¿¸ö²¦½Ó²º½¨Á¢Ò»¸ö {\ttfamily /etc/ppp/options.ttyXX} µµ°¸£®



ÔÚÕâÀïÃæ£¬Ö»Òª¼òµ¥µØ·ÅÈë±¾µØ£¨ËÅ·þÆ÷£©µÄ IP ºÅÂë¼°¸Ã²ºËùÒªÊ¹ÓÃµÄ IP ºÅÂë£®ÀýÈç

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
kepler:slip01
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


ÌØ±ð×¢Òâ£¬ÔÚÕâ¸öµµ°¸ÀïÄã¿ÉÒÔÊ¹ÓÃºÏ·¨µÄÖ÷»úÃû³Æ£¨ÎÒ·¢ÏÖÎÒÖ»¼ÇµÃÔÚÎÒÍøÂ·ÉÏÖØÒª»úÆ÷ÓëÉè±¸µÄ IP ºÅÂë £­ Ãû³Æ»á¸üÓÐÒâÒå²Å¶Ô£©!




\subsection{Éè¶¨ pppd ÒÔ±ãÈÃÊ¹ÓÃÕß£¨³É¹¦µØ£©Ö´ÐÐËü}

ÒòÎªÆð¶¯ ppp Á¬½áÒþº¬ÖøÅäÖÃºËÐÄÉè±¸£¨ÍøÂ·½çÃæ£©¼°²Ù¿ØºËÐÄµÝËÍ±í¸ñµÄ¶¯×÷£¬ËùÒÔÐèÒªÌØ±ðµÄÈ¨ÏÞ £­ ÊÂÊµÉÏÐèÒªÍêÕûµÄ root È¨ÏÞ£®



ÐÒÔËµÄÊÇ£¬ pppd ÒÑ¾­Éè¼Æ³É¿ÉÒÔ°²È«µØÉè¶¨ÎªÒÔ root µÄÉí·ÖÖ´ÐÐ£®ËùÒÔÄã±ØÐë
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
chmod u+s /usr/sbin/pppd
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




µ±ÄãÁÐ³öÕâ¸öµµ°¸Ê±£¬ËüÓ¦¸Ã»áÈçÍ¬ÕâÑù
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
-rwsr-xr-x   1 root     root        74224 Apr 28 07:17 /usr/sbin/pppd
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




Èç¹ûÄãÃ»ÓÐÕâÑù×ö£¬Ê¹ÓÃÕß½«²»ÄÜÉèÁ¢ËûÃÇµÄ PPP Á¬½á£®




\subsection{Îª pppd Éè¶¨Ò»¸öÈ«ÓòµÄ±ðÃû(alias)}

ÎªÁË¼ò»¯ÎÒÃÇ²¦½Ó PPP Ê¹ÓÃÕßµÄÁ¬Ïß³ÌÐò£¬ÎÒÃÇ½¨Á¢Ò»¸öÈ«ÓòµÄ±ðÃû(·ÅÔÚ {\ttfamily /etc/bashrc})Èç´ËÒ»µ©ËûÃÇÇ©ÈëÖ®ááÖ»ÒªÒ»¸ö¼òµ¥µÄÖ¸Áî¾ÍÄÜÆð¶¯ËÅ·þ¶ËµÄ ppp£®



Õâ¿´ÆðÀ´Ïñ
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
alias ppp="exec /usr/sbin/pppd -detach"
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




ËüËù×÷µÄÊÇ
\begin{itemize}
\item exec : ÒâÖ¸ÒÔÕâ¸öÖ¸ÁîËùÖ´ÐÐµÄ³ÌÊ½Ìæ»»ÕýÔÚÖ´ÐÐµÄ³ÌÊ½£¨ÔÚÕâ¸öÀý×ÓÖÐÊÇ shell£©£®
\item pppd -detach : Æð¶¯ pppd ²¢ÇÒ²»Òª°Ñ²úÉúµÄ³ÌÐò·ÅÈë±³¾°Ö´ÐÐ£®ÕâÈ·±£µ± pppd ½áÊøÊ±²»»áÁôÏÂÈÎºÎ³ÌÐò£®
\end{itemize}


µ±Ò»¸öÊ¹ÓÃÕßÏñÕâÑùÇ©ÈëÊ±£¬ËûÃÇÔÚ 'w' µÄÊä³öÖÐ¿´ÆðÀ´»áÏñÕâÑù
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
  6:24pm  up 3 days,  7:00,  4 users,  load average: 0.05, 0.03, 0.00
User     tty       login@  idle   JCPU   PCPU  what
hartr    ttyC0     3:05am  9:14                -
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




¾ÍÕâÑù... ÎÒ¸æËß¹ýÄãÕâÊÇÒ»¸öºÜ¼òµ¥µÄ£¬»ù±¾µÄ PPP ËÅ·þÏµÍ³!




\section{ÔÚ null modem (Ö±½ÓÁ¬Ïß)ÉÏÊ¹ÓÃ PPP\label{direct}}

Õâ·Ç³£µØ¼òµ¥ - ÒòÎªÃ»ÓÐÊý¾Ý»úËùÒÔÊÂÇé±äµÃ¸üÈÝÒ×£®



Ê×ÏÈ£¬Ñ¡ÔñÆäÖÐÒ»²¿»úÆ÷×öÎª'ËÅ·þÆ÷'£¬ÔÚ´®ÁÐ²ºÉÏÉèÁ¢ getty ÒÔ±ãÈÃÄã¿ÉÒÔ´Ó'¿Í»§¶Ë'Ê¹ÓÃ minicom È¥È¡ÓÃ´Ë´®ÁÐ²ºÒÔ²âÊÔÁ¬½ÓÐÔ£®



Ò»µ©Äã³É¹¦ÁË£¬Äã¿ÉÒÔ³ýÈ¥Õâ¸ö getty£¬³ý·ÇÄãÏëÓÃÊ¹ÓÃÕßÃû³Æ/ÃÜÂëÀ´È·ÈÏÁ¬Ïß£®
ÒòÎªÄãÓÐÁ½²¿»úÆ÷µÄ'ÊµÌå¿ØÖÆÈ¨'£¬ÎÒ¼ÙÉèÄã²¢²»ÏëÈç´Ë×ö£®



ÏÖÔÚ£¬ÔÚËÅ·þÆ÷¶Ë³ýÈ¥ getty ²¢È·ÈÏÄãÒÑÔÚÁ½²¿»úÆ÷ÉÏÕýÈ·µØÊ¹ÓÃ 'setserial' À´Éè¶¨´®ÁÐ²º£®



ËùÓÐÄãÒª×öµÄ¾ÍÊÇÔÚÁ½¸öÏµÍ³ÉÏÆô¶¯ pppd£®
ÎÒ¼ÙÉèÄãÔÚÁ½Ì¨»úÆ÷ÉÏ¶¼Ê¹ÓÃ {\ttfamily /dev/ttyS3} ½¨Á¢Á¬Ïß£® 
Òò´Ë£¬ÔÚÁ½²¿»úÆ÷ÉÏÖ´ÐÐÖ¸Áî:-

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
pppd -detach crtscts lock <local IP>:<remote IP> /dev/ttyS3 38400 &
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




Õâ½«»á½¨Á¢ÆðÁ¬½á - µ«Ä¿Ç°ÎªÖ¹Äã»¹Î´Ö¸¶¨µÝËÍÂ·¾¶£®
Äã¿ÉÒÔÔÚÃ¿²¿»úÆ÷ÉÏÓÃ ping Ö¸ÁîÀ´²âÊÔÁ¬½á£®Èç¹ûÕâÑù¿ÉÒÔµÄ»°£¬ÖÕÖ¹ÆäÖÐÒ»¸ö pppd ³ÌÐòÒÔ½áÊøÁ¬½á£®



ÄãÐèÒªµÄµÝËÍÂ·¾¶Êµ¼ÊÉÏ¿´Äã¾¿¾¹Ïë×öÊ²÷á¶ø¶¨£®
Ò»°ãÀ´Ëµ£¬ÆäÖÐÒ»²¿»úÆ÷»áÁ¬ÉÏÒÒÌ«ÍøÂ·(Æä¼°ááµÄÍøÂ·)Òò´ËËùÐèµÄµÝËÍÍêÈ«ºÍ PPP ËÅ·þÆ÷Óë¿Í»§¶ËÒ»Ñù£®



Òò´ËÔÚ¾ßÓÐÒÒÌ«ÍøÂ·µÄ»úÆ÷ÉÏ£¬pppd µÄÖ¸ÁîÓ¦¸ÃÊÇ

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
pppd -detach crtscts lock proxyarp <local IP>:<remote IP> /dev/ttyS3 38400 &
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




¶øÁíÒ»²¿»úÆ÷ÉÏÊÇ

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
pppd -detach crtscts lock defaultroute <local IP>:<remote IP> /dev/ttyS3 38400 &
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}




Èç¹ûÄãÁ¬½ÓÁ½¸öÍøÂ·(Ê¹ÓÃ´®ÁÐÁ¬½á!)»òÓÐ¸ü¸´ÔÓµÄµÝËÍÐèÇó£¬Äã¿ÉÒÔÍêÈ«°´ÕÕÕâ·ÝÎÄ¼þÇ°ÃæËùÌáµÄ·½·¨À´Ê¹ÓÃ {\ttfamily /etc/ppp/ip-up}£®



{\bfseries Robert Hart}\\ 
Port Hedland, Western Australia\\ 
Melbourne, Victoria, Australia
August/October 1996
January/March 1997



\end{document}
