Linux PPP HOWTO

Robert Hart, hartr@interweft.com.au

v3.0, 31 March 1997



--------------------------------------------------

Translated by Ilgiz Kalmetev (2:5011/36.6@fidonet)

--------------------------------------------------



      Linux PC   PPP, 

 PPP  ,    LAN    

      Linux    PPP. 

       PPP .





 



    GPL (GNU Public License).









       comp.os.linux.answers

     HTML :



    Linux Howto Index <http://sunsite.unc.edu/mdw/linux.html#howto>



    PPP-HOWTO <http://www.interweft.com.au/other/ppp-howto/ppp-howto.html>



  (SGML, ASCII, postscript, DVI)   

<ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/other-formats>.



  sunsite.unc.edu   , , 

 .









        .  

 Al Longyear     PPP (  

 ,    ),   (  Linux Howto) 

 Debi Tackett (MaximumAccess.com)      , 

 ,    .



 ,    ,       

 .      HOWTO,   

 -   ,       .  

HOWTO     ,   -     

Linux -  ,       .





1.  



PPP (Point to Point Protocol --  -) -   

   IP (Internet Protocol)     

   -     

( - ),   telnet  

    (, ,   ISDN).



 PPP,     Linux PC  PPP   

   ,     () ,  

     .



     Linux PC  PPP ,  

          

  PC /  .



  PPP -   ,     PPP 

   Linux PC     (  

   Internet),    (Wide Area Network --

-- WAN).



     PPP  Ethernet , ,

  -   Ethernet   

  10 / (/ -    ),   

        56 / (/ - 

   ).



,      PPP,    

      .



1.1.   



PPP   ; ()   

,  ,  ,   . ,

 ,       

 "-".



    ,    PPP,  - ,

 ,     - .



      Linux     

   PPP,   PPP .



 Linux PC    PPP    ,

        ( ,  ).

  ,      

   PPP .



  ,    ( ),

 ,  ,    ,  

 (   ,  , ,  

),  .



 PPP   ,       

  , , ,     ,

   Linux PC  .



,         

    .



         Linux PC 

  PPP ,     LAN  (  

)   PPP (    

 WAN-).





1.2.    Linux



    Linux,       

     .



   Linux ( Unix)      , 

   ..



   BSD  System V.      

Unix,          .

     ,     , 

  , !



     :



    Slackware

        BSD



    Red Hat (   Caldera)

        SysV (    )



    Debian

        SysV 



   BSD      /etc/... ,  :



  ______________________________________________________________________

          /etc/rc

          /etc/rc.local

          /etc/rc.serial

                  (   )

  ______________________________________________________________________





  ,     BSD   

 /etc/rc.d...    ,      /etc.



 System V       /etc/...  

/etc/rc.d/...    :



  ______________________________________________________________________

  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

  ______________________________________________________________________





   ,     ethernet

      ,      

 ,   ,   .





1.3.    PPP,    



   ( Red Hat  Caldera),  PPP  

   ,   X Windows.  HOWTO  

     .   

    ,      !



  Red Hat 4.x,   Red Hat PPP-TIP 

<http://www.interweft.com.au>    Linux    Red Hat 

Software <http://www.redhat.com>   .





2. IP 

            

 ,    ,   , 

 IP .    

   .



     (LAN)  Internet,    

IP          ,

    .      IP ,

          LAN

(    ).         

     ,   '' IP  

    ,    IP 

,     -.



, ,  IP ,     (

 )   '  

',      ,   

Internet.



 IP ,    LAN,     

.   :



        A

     10.0.0.0 (  255.0.0.0)



    16    B

     172.16.0.0 - 172.31.0.0 (  255.255.0.0)



    256    C

     192.168.0.0 - 192.168.255.0 (  255.255.255.0)



         IP 

   ,      

      .



       Internet.



,       ethernet  , 

  .  ,  IP   

 ,  . ,   ethernet  

 10.0.0.1 (),      , 

PPP,  PPP      () IP 

.  PC    ,     LAN - .



,   Linux   IP Masquerade (  

    NAT)   Linux   

ipfwadm,     LAN   (   

),       IP     ethernet.



      . IP Masquerade mini-HOWTO  

<http://sunsite.unc.edu/mdw/HOWTO/mini/IP-Masquerade>



  ,       

   PPP,  IP  (  ,  

)  .



     LAN  ,    

 (ISP)      ( 

 IP )    IP  . 

  ,  IP Masquerading.



 ,    PC    ISP, 

     IP .   

   , PPP ,      ,  

  ,  IP        PPP 

    .       

     ISP.



  IP ,        IP  

   .       

  Linux   sendmail, ftpd, httpd  ..    

  ,  ,  ,    

  IP    (        

   - FQDN -   DNS ).



  -   IP  (  

  ,  )    .





3.   



3.1.  PPP 



    ,    Linux

 PPP,    PPP    IP ,  

PPP. ,  PPP       Linux 

 (   /   

   PPP).



   PPP    dip ( 

  SLIP ),  dip -  .   

,      dip   PPP 

.



 ,       Linux

PPP (chat/pppd).





3.2.   LAN  LAN c ,  PPP



   ()     

LAN  LAN  ,  PPP.





3.3.  PPP 



   ,       

Linux PPP .     ,  

    PPP  (  16 ).



 ,  ,  .  ,    

.





3.4.  PPP    



       PPP    

Linux PC  ()  .     

  OS  Linux.   ,    

     ,   

.





3.5.        ...



    PPP . . ,  

   pppd,   .



      Linux (). . Serial-HOWTO  

    , .     

<http://www.in.net/info/modems/index.html>  ,   

   .



  dip   PPP .    chat



  socks  IP Masquerade.   ,  

   .



  diald    . . 

  diald.



  EQL         .



       PPP (  

  Red Hat 4.x). .     

 .



    ,    

 PPP. .  .





4.    



  HOWTO ,     Linux 1.2.x  PPP 2.1.2 

 Linux 1.3.X/2.0.x  PPP 2.2.



      PPP   Linux - 

ppp-2.2f.   (ppp-2.3) -     -.



  PPP 2.2.0   1.2.13.     . 

      1.2.13   ppp-2.2, 

       .



       ,     

 PPP 2.1.2   Linux  2.0.X.



,  ,      , 

       Linux 2.0.x.,

, . kerneld mini-HOWTO    / 2.0.x ( 

Linux 2.0.x   /usr/src/linux/Documentation/...).



       ,   

     Linux  PPP,   

,     .





5.  / 



  :



  ,    PPP ;



  man pppd  man chat; 



  Linux Network Administration Guide (NAG); . The Network Administrators' 

Guide <http://sunsite.unc.edu/mdw/LDP-books/nag-1.0/nag.html>



  Net-2/3 HOWTO; . Linux NET-2/3-HOWTO 

<http://sunsite.unc.edu/mdw/HOWTO/NET-2-HOWTO.html>



     Linux,   /usr/src/linux/Documentation, 

     Linux;



       - .     

<http://www.in.net/info/modems/index.html>



   Unix/Linux,  O'Reilly  . . 

(O'Reilly and Associates On-Line Catalogue < http://www.ora.com/>).   

   Unix/Linux,  ( )     

      !



 PPP-FAQ,  Al Longyear,   Linux PPP-FAQ 

<ftp://sunsite.unc.edu/pub/Linux/docs/faqs>.     

   /,      ,

 PPP   ().



     Linux     ; 

      .



 Linux      , 

  ,       ()  !

   (  ),    ,  

       .



      Linux  -  

Linux Documentation Project <http://sunsite.unc.edu/mdw/>. HOWTO  

   .



          PPP 

     ,       

,    !     

 (          

 comp.os.linux ...      Linux).



  (    ,  RFCS)  

    ,      HOWTO.



   LAN  ,  PPP,    

     TCP/IP .       

     O'Reilly "  TCP/IP"  

"  "!





5.1.     Linux



     Linux,    

      .      

   ,   ,  contribute your expertise and 

views.



:      "" / 

 .    ,    'lurk' 

(     ),     

 (  ),    ''   

  .



 -  ,     ,  ,   

       .



        ,    

,       !



       Linux - 

Linux Mailing List Directory 

<http://summer.snu.ac.kr/~djshin/linux/maillist/index.shtml>





6.   ,       PPP  



     -       

! 



 ,       , 

   ,    Linux   PPP  

  .





6.1. /  



   Linux     PPP,   

  Linux PPP  

<ftp://sunsite.unc.edu/pub/Linux/system/Network/serial/ppp/ppp-2.2.0f.tar.gz>.



      . ,    

    (ppp-2.3       

     ).



PPP         

,       HOWTO!





6.2.   PPP  



Linux  PPP  



 PPP   



    PPP



 , ,       PPP 

  ,     .



         - 



______________________________________________________________________



PPP Dynamic channel allocation code copyright 1995 Caldera, Inc.

PPP line discipline registered.

______________________________________________________________________





      PPP.



   ,        

         

    .  ,    

    ,       

     .



         

 ``   Linux".



 , . Kernel-HOWTO  Linux Kernel HOWTO 

<http://sunsite.unc.edu/mdw/HOWTO/Kernel-HOWTO.html>





6.3.     ISP



    ,  PPP    

.     ISP (  PPP , 

    intranet),       

,   PPP .



   Linux,      

   ISP (  ,   intranet PPP 

),        MS WINDOWS.



,    ISP,     Linux,

-  Linux     ,      

  .



 ``    PPP " ,   

   PPP ,      -   

  .





6.4.      



     PPP      

  ,      .



            

 .



      ``    

 ".





6.5.      IP  (DNS)



   ,   PPP    

  PPP ,     ,  

       ,  

  www.interweft.com.au  IP ,    

    .  :



  /etc/resolv.conf

  /etc/host.conf



 ``     IP "   

   .



          Linux PC,  

   (  ). ,    , 

IP      ,     

(      ISP).





6.6. PPP   root 



    PPP    Linux   PPP 

      ( PPP -  

 )    ,  pppd  

root.



  .  `` PPP   root".





6.7.  PPP       PPP



     ,    

     PPP.   PPP  ,    

 ,     :



  ______________________________________________________________________

  /etc/ppp/options

  /etc/ppp/scripts/ppp-on

  /etc/ppp/scripts/ppp-on-dialer

  /etc/ppp/options.tpl

  ______________________________________________________________________



         

 ,     PPP:



  ______________________________________________________________________

  /etc/ppp/options.ttyXX

  /etc/ppp/ip-up

  /etc/ppp/pap-secrets

  /etc/ppp/chap-secrets

  ______________________________________________________________________



 ,  PPP       

,    ;        

  PPP    ,    .



  . ``  PPP ".





6.8.   PPP   PAP (Password Autentificaion Protocol)



 ISP   PPP   PAP.     

    PAP (      

       (/),  

   PAP),       .



      ,   

       , PPP , 

PAP     /     .



         

   (LCP),      

 PPP.



 ``  PPP   PAP (Password Autentificaion Protocol)"

   ,    , 

   PPP,  PAP.





6.9.   PPP  



       , 

( minicom  seyon)   pppd   Linux PC .



.  `` PPP  "      .





6.10.    PPP 



       ,    

     .



 ``   -   ''

   ,    chat  

      PPP .



     / ,  

     PAP/CHAP  .





6.11.   



    .



    `` PPP ''.





6.12.      



    PPP .  PPP   

      .      

 PPP -       .



     PPP    

      !



 `` "       

,     .



      ,   . Al Longyear 

 PPP-FAQ,        !





6.13.  ,   



   PPP  (,   IP  

), Linux PPP    ( 

root) ,    ,      

  .



  `` ,   "    

/etc/ppp/ip-up, ,     PPP,    ,

      email   ISP,  

       .





6.14.    IP   PPP    

      IP 



   ,  IP     

  Linux PC     .



 ``   IP   PPP    IP 

"       ()     

  ( -  ),    .





7.   Linux 



    PPP,   Linux   

   PPP.       Linux, 

      -    /usr/src/linux    

 .



   -   Linux,   

  (  )   .



 ,   Linux    .



       PPP,    .  

  ,    syslog   

dmesg | less,     .     

 PPP,    



______________________________________________________________________



PPP Dynamic channel allocation code copyright 1995 Caldera, Inc.

PPP line discipline registered.

______________________________________________________________________



(     Linux 2.0.x).



   Linux     ftp  sunsite.unc.edu  

.





7.1.     Linux



          

 Linux.      Linux Kernel-HOWTO 

<http://sunsite.unc.edu/mdw/HOWTO/Kernel-HOWTO.html>.



       Linux,   

  root.



1.    /usr/src :   cd /usr/src



2.       /usr/src/linux



3.      ,      

<ftp://sunsite.unc.edu/pub/Linux/kernel/v2.0>   .



       ( 1.2.X),     

  Linux <ftp://sunsite.unc.edu/pub/Linux/kernel/old>.



4.    -      . 

     tar   /usr/src.



 :  'tar' -  -   (   

  Linux   tar),      .

 Linux  DOS'  zip,   

   .



5.       Linux,    

,      .   

rm -rf /usr/src/linux



6.     ,   

tar xzf linux-2.0.XX.tar.gz



7. , cd /usr/src/linux    README.    

        .   

(        ,   , 

           ).





7.2.    



   ,  /    PC,   

   !!!    ( 

 )       ( IRQ,  

-  .).





7.3.   -  Linux 1.2.13



   ,    README,  

  .      

make config



 ,   PPP,    ,  

  PPP (PPP   pppd,   PPP  ).



______________________________________________________________________



PPP (point-to-point) support (CONFIG_PPP) [n] y

______________________________________________________________________





    make config,    Linux  

   PC,   .    

README,       .



 1.2.13   4 PPP .    

,      PPP ,   

  . (. README.LINUX ,     

 PPP-2.1.2      , 

   ).



 :   1.2.13       

 -             

 make config, ,  CTRL-C   .





7.4.   -   Linux 1.3.x  2.0.x



 Linux 1.3x  2.0.x      1.2.13. 

    README,    . 

     



make config



,    



make menuconfig



        , 

           

.



       X Window System



make xconfig



    PPP       

 .



   PPP ,    PPP 

   .   'kerneld',   

  (),     PPP, 

      PPP.     

:        ,    

 ,   .



  ,      :



______________________________________________________________________



Enable loadable module support (CONFIG_MODULES) [Y/n/?] y

______________________________________________________________________





   PPP  ,    :



______________________________________________________________________



PPP (point-to-point) support (CONFIG_PPP) [M/n/y/?]

______________________________________________________________________





   PPP,  M, ,   PPP  , 

 Y.



    1.2.13,  2.0.x  PPP      

     ,     PPP 

.





7.5.    PPP-2.2  /proc/net/dev



   PPP-2.2,  ,     PPP 

 ' '  ,     ,   

 /proc/net,      pppd:



  ______________________________________________________________________

  [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

  ______________________________________________________________________



     ( )  ppp,    

(  ppp):



  ______________________________________________________________________

  [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

  ______________________________________________________________________







7.6.     PPP



    Linux PC  PPP ,     

IP  .   ,     

Linux   LAN    LAN  .



   LAN   (    LAN),   

   .   IP    - 

 !



   ,     IP masquerade,  

 LAN,      '' 

 IP .



  IP Masquerade  IP fire walling,     

     :



______________________________________________________________________



Prompt for development and/or incomplete code/drivers (CONFIG_EXPERIMENTAL)?

______________________________________________________________________





        ,  

    IP Masquerade and IP fire walling

  Linux 2.0.XX  .



        ,    

    () PPP.





8.     PPP 



,     PPP   ,   

  (    

/ PPP ):



 () ().      ,     

 ,      -    (0) 

 (9).



      IP ?



    IP ,      IP 

     PPP .   ISP  

   IP ,     IP , 

       (netmask).



      IP .  

 ,      ,     

.



      IP ,  PPP  

 (  )     IP , 

  -  .     !



    IP     ISP?



     ,    .



   . PPP   MS WINDOWS 95  

  DNS     .    ISP 

(   )   ,      

IP  DNS ().



 Linux,         DNS. Linux  

PPP    IP  DNS     -  

   .



 :  Linux ( PPP )     DNS  

,  ,   ,    , 

  pppd dns-addr.



    PAP/CHAP?



   ,      "id",  "secret"  

  . (       

     ISP).



    PPP,     - , 

  PPP    ?



    ,   PPP,     ?



  Windows NT Microsoft ,  ,    MS PAP/CHAP?



  LAN, ,     

MS WINDOWS NT .



      -    !





9.      



  ,         ,  

    .



:



    DOS com1: = Linux /dev/cua0 ( /dev/ttyS0)



    DOS com2: = Linux /dev/cua1 ( /dev/ttyS1)







  , ,    4  ,  

 PC com1  com3   IRQ4,  com2  com4  

 IRQ3.



       ,  

  IRQ   ,     .  

 ,        

,  IRQ.     ( 

      )   

 IRQ  .



    Linux 2,     "" IRQ, 

  cat /proc/interrupts,     :



  ______________________________________________________________________

   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

  ______________________________________________________________________





,     IRQ4 ()  IRQ15 ( 

 PPP   . (     com2,

IRQ3  com4   IRQ14,    ,    

).



:   ,   ,    

  IRQ!       ,    

  ,      IRQ   

.   ,    SCSI  

,         IDE , 

   IRQ14  15!



  , ,    PC    

,  IRQ     ,  OS    

 -    !



        IRQ,   

  Linux,  IRQ   .   

 setserial          

  rc.local  rc.serial,    rc.local,    

 SysV.  ,  ,  



______________________________________________________________________



/bin/setserial -b /dev/ttyS2 IRQ 11 

/bin/setserial -b /dev/ttyS3 IRQ 15

______________________________________________________________________





,         

kerneld  serial,          IRQ  

.    .  ,     serial 

Linux    .



,     serial  ,    

 IRQ  .    .





9.1. ,      





    ()  (14,400   ), 

      ,  

      .



  ,      

UART (  )  16550(A).   

   (   ),  , 

      8250 UART,   

        .



 



setserial -a /dev/ttySx



 Linux    UART,    .     UART

 16550A,      (   $50). 

    , ,     

 IRQ!



 :    16550 UART  .   

 ,       - 16550A UART.

        . 

,       ,    , 

    16550A,       

.





9.2.   



, Linux      cuaX  

 ttySx   .



 ,         2.0.x,    

  ttySx   ,    .  , 

   cuaX       .





9.3.   



 PPP        -   

     !     

   ,    ,   

PPP.   :



     (RTS/CTS) (&K3   Hayes )



     (   Hayes):



  E1 Command/usr/src/linux-2.0.27/include/linux/serial.h   

   (   chat)



  Q0     (   chat)



  S0=0   (   ,    )



  &C1   (Carrier Detect)    



  &S0   (DSR)  



  ( ) Data Terminal Ready



 ,       , 

<http://www.in.net/info/modems/index.html>,      .



   ,     

    .     

   ,    

      ( 

   ) .



     .     , 

         

 ( 115,200 ,    38,400    14,400).



     ( minicom  

seyon),     ,     PPP.



         AT$V,   

      .



    ,   ()    

,   AT$F -   . ( 

 ,    ,    

   PPP -  -    ).



      ,   .  

:          

,         AT.  

          

     PPP.



         Linux  ISP  

 ,          

   .



,   ,       

 ,       , 

    ,    

  . (    , 

  ,        , 

   ,    ).





9.4.        



      ,   , 

   ,      ( 

    -  - ,  Linux - 

   ).  

,     (    

   ),  -    

.



        :



    (Clear To Send/Request to Send - CTS/RTS)



    (Control-S  Control-Q,  

   XON/XOFF).



          () 

,   PPP    8  -   ,  

-    ,    

 Control-S  Control-Q.  ,      

   ,  things can rapidly go berserk!



  ,  PPP (  8  

)     ,    

       .





9.5.      



,         ,

  ,     , 

 ISP    ,      .



      ( minicom), 

   PPP  ,    PPP ,  

     PPP .



( :        PPP  - 

  ,          

           PPP).



   ,  "" (   )   

       ( )   , 

           

 (   ,    PPP ).



    PAP,         

,        (  ) 

    (   ).



 :



    :     

     / , 

 PAP.  ,   ISP     PAP,  

      ,     ,   

 - .



   ,        

    PAP .



  PPP   -       ,  

     lcp .  ppp ,    

,    ,     !



     PPP,     enter -  ,  

      ,    enter!



C      -     

 (,  !)    .  

 ,   Linux    :



 ,  ,      ;



 ,  ,     ;



    ,   PPP  ,    

  ,     ,    

.



     PPP,    , 

       -  PPP     

 ,     PPP .



    



______________________________________________________________________



~y}#.!}!}!} }8}!}$}%U}"}&} } } } }%}& ...}'}"}(}"} .~~y}



______________________________________________________________________



(and it just keeps on coming!)



   PPP      .   

- ,         PPP- 

     ,      / 

.    ,    ,  

  .    ,   

 PPP .



         (     

 PPP ,  ),   enter,  , 

  PPP  ...



  ,      " " (, 

    +++     ATHO,    

 OK).



       ,     

, man      Serial HOWTO!   

,    .





10.      IP  (DNS)



  -     ,   

  .  TCP/IP  (  ),   

   -        -

"". ,    Linux  archenland,   

    interweft.com.au .     

  - archenland.interweft.com.au (     

FQDN -    ).



   ,   ,    IP .



   ( )  ,    

, -   ,   Domain Name Service 

(  ).



  :



     IP  - . 



,     'resolver'   Linux PC, 

   ;



 resolver       (/etc/hosts / 

 ,      (  resolver' 

  /etc/host.conf);



      ,   ;



     ,   PC    ;



  DNS    IP    ,    

.  ,         , 

  .        

   resolver -       

 .



   PPP ,     Linux , 

         IP  ( 

) ,      ,     

   IP ,    .



     ,    ,    

    /etc/hosts ( ,     

);  -   IP    ( 

,    LAN).



     ,   Linux ,   

      .   

    (DNS). ,  ,   IP ()

      /etc/resolv.conf .





10.1.  /etc/resolv.conf



    PPP     IP 

 DNS (   -      

     ).



  , Linux    IP     

,   MS WINDOWS 95.      (),   

ISP    !



 /etc/resolv.conf    :



______________________________________________________________________



domain your.isp.domain.name 

nameserver 10.25.0.1 

nameserver 10.25.1.2

______________________________________________________________________





   (   ) ,  

 ,    ISP.      

  :



-rw-r--r--   1 root     root           73 Feb 19 01:46 /etc/resolv.conf



    /etc/resolv.conf,      LAN,

  IP  PPP DNS     .





10.2.  /etc/host.conf



   ,    /etc/host.conf  . 

    



______________________________________________________________________



order hosts,bind 

multi on

______________________________________________________________________





   resolver',        

,     DNS .





11.  PPP   root



 PPP    ,   

   .,    root.



  ( root)   PPP ,   

pppd   setuid root: 



-rwsr-xr-x   1 root     root        95225 Jul 11 00:27  /usr/sbin/pppd



 /usr/sbin/pppd  setuid,    root   :



chmod u+s /usr/sbin/pppd



  pppd     root,   

 .      

pppd   ,      

  .



,   'set uid root',    

  ,         

'suid root'.   ( pppd)      

   suid root,      

( -  ).



   ,   ,     - 

  ,        

PPP ,        ppp-on/off 

/. (  ,  PC   ).



,    ,      PPP  

(,       Linux PC,    ,  

      ),      

 PPP ( root,  /etc/group) :



    pppd - suid root,  root   PPP,  

 'other'.    



-rwsr-x---   1 root     PPP        95225 Jul 11 00:27 /usr/sbin/pppd



    ppp-on\off -  root   PPP



   ppp-on/off /  PPP



-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



   other  ppp-on/off.



  ,    PPP   PPP  /etc/group



    ,       

 !   ppp-off   root. 

,       (  

    ).



 (  ),   ,    

sudo.          , 

  ()   / 

,  .  sudo    

/  PPP   .





12.   PPP 



     root,     

 ,    PPP,    , 

 PPP     .



PPP        PPP .



        PPP 2.1.2  2.2.



 PPP 2.1.2 :



  ______________________________________________________________________

  /usr/sbin/pppd          # the PPP binary

  /usr/sbin/ppp-on        # the dialer/connection script

  /usr/sbin/ppp-off       # the disconnection script

  /etc/ppp/options        # the options pppd uses for all connections

  /etc/ppp/options.ttyXX  # the options specific to a connection on this port

  ______________________________________________________________________





 PPP 2.2 :



  ______________________________________________________________________

  /usr/sbin/pppd                  # the PPP binary

  /etc/ppp/scripts/ppp-on         # the dialer/connection script

  /etc/ppp/scripts/ppp-on-dialer  # part 1 of the dialer script

  /etc/ppp/scripts/ppp-off        # the actual chat script itself

  /etc/ppp/options                # the options pppd uses for all connections

  /etc/ppp/options.ttyXX          # the options specific to a connection on this port

  ______________________________________________________________________



 Red Hat Linux     ,    

  Red Hat 4.X     

/usr/doc/ppp-2.2.0f-2/scripts.



   /etc    ppp:



drwxrwxr-x   2 root     root         1024 Oct  9 11:01 ppp



    -        .



   ,      options, 

 options.tpl.       ,     

.



 ,       PPP  

(     man pppd).       

    /etc/ppp/options,      

 options,       ,   

      /.



     / (   PPP

),    /etc/ppp/options,  ,  

     ,    

/      options   

 ,      PPP   

 ,    .



        options.ttyx1, 

options.ttyx2  . ( x -      

).



,   PPP ,      

 /etc/ppp/options.         

     pppd.



  ,    /etc/ppp/options.ttySx. 

   PPP,      ,    

  options     "/etc/ppp/options."   

       PPP   ( 

 pppd "file option-file"   ).





12.1.  options.tpl



  PPP, ,   options.tpl,   

 .       ,   () 

() /etc/ppp/options.         

.      ,     

     .





  ______________________________________________________________________

  # /etc/ppp/options -*- sh -*-    pppd

  #  13-Jul-1995 jmk

  #    : 01-Aug-1995

  #   : 19:45



  #        . 

  #    "chat",     

  #  ppp .

  #connect "echo     connect."



  #     ,  pppd  .

  #    ,  ,    ,  

  # ,      

  #disconnect "chat -- \d+++\d\c OK ath0 OK"



  # async   -- 32-bit hex;   - ,   

  #    escape-,  pppd   .

  # 0x00000001 -    '\x01',  0x80000000 -   '\x1f'.

  #asyncmap 0



  #            

  # .

  #auth



  #      (., RTS/CTS), 

  #      

  #crtscts



  #       (., XON/XOFF), 

  #      

  #xonxoff



  #        , 

  #     ,   IPCP  

  # .       

  #defaultroute



  # ,      'escape'  

  # (  ,      escape'  

  # async   ). ,   escape' 

  #      ,  . 

  # ,    escape      ,  

  #    asyncmap,      

  # . ,   escape' -  0x20 - 0x3f  0x5e.

  #escape 11,13,ff



  #     .

  #local



  # ,  pppd   lock   UUCP  

  #  ,      

  # 

  #lock



  #    .  Ultrix   

  #   ,   crtscts.  (    

  # )

  #modem



  #   MRU [Maximum Receive Unit]  <n>  .

  # pppd       ,   <n> . 

  #   MRU 128.  MRU   1500.  

  #    296 (40    TCP/IP + 256  

  # ).

  #mru 542



  #      <n>, 32-    

  # "-"  (., 255.255.255.0).

  #netmask 255.255.255.0



  #    ,     IP ,

  #   ( )  IP    

  #          IP

  #    IPCP  (      

  #     options).

  #noipdefault



  #   "passive"  LCP.     pppd  

  #  ;       , 

  # pppd     LCP    

  # ( ,     ).

  #passive



  #    pppd    LCP    

  #     LCP     (  "passive"

  #    pppd).

  #silent



  #          LCP  IPCP

  # (   ).

  #-all



  #     / ( 

  #  , .. /  ).

  #-ac



  #    asyncmap ( asyncmap  , ..

  # escape   ).

  #-am



  #      ( pppd   ,  

  #   ).

  #-detach



  #    IP  (    IP

  #          options)

  #-ip



  #     .    pppd  

  #  looped-back .

  #-mn



  #    MRU [Maximum Receive Unit] 

  # (  , .. 1500).

  #-mru



  #       (  

  # , ..    ).

  #-pc



  # ,       PAP.

  #     -    

  #     PAP  ISP,     ,

  #   ISP      (    

  # )

  #+pap



  #     PAP.

  #-pap



  # ,       CHAP [Cryptographic

  # Handshake Authentication Protocol].

  #     -    

  #    CHAP  ISP,     ,

  #   ISP      (    

  # )

  #+chap



  #     CHAP.

  #-chap



  #    IP    Van Jacobson 

  # (  , ..  )

  #-vj



  #    (   -d).    , pppd

  #           

  # .    -  syslog   daemon

  #   .       

  #   /etc/syslog.conf (. syslog.conf(5)).  (

  # pppd    extra ,    

  #   ,   local2  daemon).

  #debug



  #    <d>       .

  # ,  gethostname()   porsche,  FQDN - 

  # porsche.Quotron.COM,      ,   

  #  Quotron.COM.

  #domain <d>



  #     PPP    .   n

  #  -  : 1 -   

  # , 2 - ,      

  #  4 - ,      

  #kdebug n



  #   MTU [Maximum Transmit Unit]  <n>.   

  #        MRU, pppd   

  #        ,   n 

  #    PPP.

  #mtu <n>



  #         <n>.

  # ,          ISP, 

  #   PAP/CHAP.

  #name <n>



  #          

  #  PAP,   <u>.

  #  ,     'name'!

  #user <u>



  #          

  #    (  name).

  #usehostname



  #         <n>.

  #remotename <n>



  #        ARP [Address Resolution Protocol]

  #  IP     Ethernet   

  #proxyarp



  #        

  #  PAP.

  #login



  #    , pppd    LCP echo-request

  #    n .  Linux, echo-request 

  #        n . 

  #      echo-request  echo-reply.

  #        lcp-echo-failure  

  #       .

  #lcp-echo-interval <n>



  #    , pppd  ,    peer ,  n

  # LCP echo-requests     LCP echo-reply.

  #   , pppd  .   

  #      lcp-echo-interval.

  #     ,   pppd  ,

  #     (,   ) 

  # ,     .

  #lcp-echo-failure <n>



  #    LCP (  )  <n> 

  # (  3).

  #lcp-restart <n>



  #     LCP terminate-request  <n>

  # (  3).

  #lcp-max-terminate <n>



  #     LCP configure-request  <n>

  # (  10).

  #  PPP   .     

  # ,     'serial line looped back'   ,

  #     PPP    .

  #lcp-max-configure <n>



  #    LCP configure-NAKs,   

  #   configure-Rejects,  <n> (  10).

  #lcp-max-failure <n>



  #    IPCP (  )  <n>

  #  (  3).

  #ipcp-restart <n>



  #     IPCP terminate-request  <n>

  # (  3).

  #ipcp-max-terminate <n>



  #     IPCP configure-request  <n>

  # (  10).

  #ipcp-max-configure <n>



  #    IPCP configure-NAKs,   

  #   configure-Rejects,  <n> (  10).

  #ipcp-max-failure <n>



  #    PAP (  )  <n> 

  # (  3).

  #pap-restart <n>



  #     PAP authenticate-request 

  # <n> (  10).

  #pap-max-authreq <n>



  #    CHAP (   

  # challenges)  <n>  (  3).

  #chap-restart <n>



  #     CHAP challenge  <n>

  # (  10).

  #chap-max-challenge



  #    pppd  re-challenge    <n>

  # .

  #chap-interval <n>



  #    pppd    peer    IP

  # ,    IP     . 

  #ipcp-accept-local



  #    pppd    peer   () IP

  # ,    IP     . 

  #ipcp-accept-remote

  ______________________________________________________________________







12.2.     ? (PAP/CHAP )



,     ,     (). , 

      .



,    ,  - (/etc/ppp/options.tpl)  

man pppd,      ,    

.



    ,   , 

        pppd,  

   



  ______________________________________________________________________

  # /etc/ppp/options (NO PAP/CHAP)

  #

  #  pppd     

  -detach

  #

  #    

  modem

  #      uucp,    

  #       

  lock

  #     

  crtscts

  #         

  defaultroute

  #   "escape-" 

  asyncmap 0

  #       552 

  mtu 552

  #       552 

  mru 552

  #

  #-------END OF SAMPLE /etc/ppp/options (no PAP/CHAP)

  ______________________________________________________________________







13.   PPP   PAP (Password Authentication Protocol)



 ,    ,  PAP  CHAP,   

  .



   options   



  ______________________________________________________________________

  #

  #  pppd   ISP     

  # ' '  

  name <your ISP user name>       #      

  #

  #    PPP **    PAP  CHAP

  #      .   ,

  #   - ,   PPP  (    PAP

  #  CHAP),          

  #  (     -     ).

  #+chap

  #+pap

  #

  #        /etc/ppp/pap-secrets,

  #    .

  # :   ,   MS  , 

  #    MS RAS Windows NT.

  #+papcrypt

  ______________________________________________________________________





13.1.  MSCHAP



Windows NT Microsoft RAS    CHAP.   

   PPP,    README.MSCHAP80,  

  .



  ,     ,  

 ,    pppd.    

   MS CHAP,     



______________________________________________________________________



rcvd [LCP ConfReq id=0x2 <asyncmap 0x0> <auth chap 80> <magic 0x46a3>]

______________________________________________________________________





   - auth chap 80.



 ,   MS CHAP,     pppd,  

  . , .    

README.MSCHAP80    PPP,  ,    

  .



   ,        Linux 

   PPP,    MS WINDOWS NT.  

PPP  Linux        

  MSCHAP80.





13.2.   PAP/CHAP



      pap  chap,    

   . :



______________________________________________________________________



/etc/ppp/pap-secrets

/etc/ppp/chap-secrets

______________________________________________________________________





      root,  root   

   740.



,       PAP  CHAP - ,   

,    ,   .



"-!..   ? "    .



  ,      PPP   ,  

       -   . 

     WAN ,    LAN,

 PPP.



PAP   ( CHAP )   ,

            

  . ,  PPP     

 ,  PAP,    .



  ,  ISP       , 

          .  ISP 

     ,      

   ISP      .



 ,      name pppd. ,   

   ,    ISP,  



______________________________________________________________________



name your_user name_at_your_ISP



______________________________________________________________________



   /etc/ppp/options.



,      our_user 

name_at_your_ISP  PAP,  pppd  ,  

   ,      

PAP.    name  ,     

  CHAP.



  PAP    ,     

   . ,    

    ISP,       (*) 

      .



  ,   ISP   ,   

   -    ,    

 ( )  .    

         

,     ,      

!





13.3.   PAP 



 /etc/ppp/pap-secrets   :



______________________________________________________________________



# Secrets for authentication using PAP

# client        server       secret     acceptable_local_IP_addresses



______________________________________________________________________





  -   ,     

 (         

 IP    ISP).



,   ISP     fred   flintstone,  

  name fred  /etc/ppp/options[.ttySx]    

/etc/ppp/pap-secrets  



______________________________________________________________________



# Secrets for authentication using PAP

# client        server  secret          acceptable local IP addresses 

fred            *       flintstone



______________________________________________________________________





 ,        IP,    

   ,   IP.  

    ,   - ,   

 PPP  ( )     

  IP ,       ISP.





13.4.   CHAP



 ,       -    

           

.



,    - fred   - barney,     

 name fred  remotename barney,     name barney 

remotename fred     /etc/ppp/options.ttySx .



/etc/chap-secrets   fred 



______________________________________________________________________



# Secrets for authentication using CHAP

# client        server  secret            acceptable local IP addresses 

fred            barney  flintstone 

barney          fred    wilma

______________________________________________________________________





  barney



______________________________________________________________________



# Secrets for authentication using CHAP

# client        server  secret            acceptable local IP addresses 

barney          fred    flintstone 

fred            barney  wilma

______________________________________________________________________





   ,        

  .     

            

.





13.5.   PAP 



       ,  PAP.

       ,     

,  -  .



,            ( 

 ) ,    .    -  

     /etc/ppp/pap-secrets.



   , PPP      . PPP 

   ' '   ()  

,   remotename  pppd.



  ,      PPP , 

 username fred.    /etc/ppp/pap-secrets   



______________________________________________________________________



fred    pppserver1      barney 

fred    pppserver2      wilma

______________________________________________________________________





,     pppserver1,    name fred 

remotename pppserver1   ppp-,   pppserver2 - name fred

remotename pppserver2.



        pppd,   

file filename,     ,      

 PPP ,       , 

,    remotename.





14.  PPP  



,      /etc/ppp/options  /etc/resolv.conf (,  

 ,  /etc/ppp/pap|chap-secrets),    

,  PPP  . (     

 ,     ).



  ,       

   . Minicom    - ALT Q (   

 minicom CTRL Q)



,     root.



    ( minicom),   PPP 

    .     ,  

 PPP  ,  .    ,   

 .



   pap  chap,         

 ,     (      

,   enter  ,    ).



        

(ALT Q  CTL Q  minicom)     Linux ( root) 



______________________________________________________________________



pppd -d -detach /dev/ttySx 38400 &

______________________________________________________________________





-d    -    ppp   

     -   ,    

.



      ,  PPP  

.     ,  PPP  

  .



       PPP,  



______________________________________________________________________



ifconfig



______________________________________________________________________





  ethernet  loopback     - :



  ______________________________________________________________________

  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

  ______________________________________________________________________







  inet addr:10.144.153.10 IP    .



  P-t-P:10.144.153.5  IP  .



(, ifconfig     IP ,  ,  

  PPP .)



 : ifconfig   ,   UP ()  

RUNNING ()!



     ppp   - 



  ______________________________________________________________________

  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

  ______________________________________________________________________





 PPP    ....    !



        (   ). 

  ,  



  ______________________________________________________________________



  route -n

  ______________________________________________________________________





   - :



  ______________________________________________________________________

  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

  ______________________________________________________________________





 ,     ,     ppp.



 -   (  H)      

,     -   .



 - ,    (  pppd 

defaultroute.  - ,  ,   Linux PC  

 ,     () ethernet -   

     -  PPP  .  PPP  

          

   .



        ,  - 

.  ,   syslog  ,  ,

 pppd       ,    

   ,    ethernet  -  

        :   

      !!!



       ,  , 

       ( 

route add default...).     -  route add net....



   ''   IP     

  ifconfig,  .



______________________________________________________________________



ping 10.144.153.51



______________________________________________________________________





   - 



  ______________________________________________________________________

  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

  ______________________________________________________________________





      -    

CTRL C,         :



  ______________________________________________________________________

  --- 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

  ______________________________________________________________________





,  .



      (  PPP  ,

    ,    ,    ). 





______________________________________________________________________



ping sunsite.unc.edu

______________________________________________________________________





    ,  Linux  IP   

 FQDN,   ''  DNS,     

/etc/resolv.conf -     (     

 ). ,    



  ______________________________________________________________________

   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

  ______________________________________________________________________





,  ,  CTRL C,    ...



  ______________________________________________________________________

  --- 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

  ______________________________________________________________________





    ,   IP  DNS   

ISP.      ,  ,    

  /etc/resolv.conf .



   ,      ,    ISP  

      .    

        ,      

ISP.   ISP -      .

      ISP,   -   .



  ,  , 



______________________________________________________________________



ppp-off

______________________________________________________________________





  ,    .



   ,        

      +++,  ,  

 - OK, " "  ATH0.



      ,  pppd



______________________________________________________________________



rm -f /var/lock/LCK..ttySx

______________________________________________________________________







15.    -   



         ,  

    ,     

.



         PPP  

,     ( root     PPP) -   

   .





15.1.      / 



  ISP    PAP/CHAP,     !



  ppp  ,      .  

PPP 2.1.2    /usr/sbin,   PPP 2.2    

/etc/ppp/scripts.  



 PPP-2. 1.2



ppp-on

ppp-off



  PPP-2. 2



ppp-off

ppp-on

ppp-on-dialer



,    PPP 2.1.2,      

.      -    ,   

  -      (    

    HOWTO)!



  PPP 2.1.2    ,   

PPP 2.2 .         

  PPP-2.1.2 .





15.2.  ppp-on



    ,    .



  ______________________________________________________________________

  #!/bin/sh

  #

  #     PPP.      .

  #    ,      ps. 

  #   .

  #

  #  .    .

  TELEPHONE=555-1212      #   

  ACCOUNT=george          #     ('George Burns')

  PASSWORD=gracie         #     ( 'Gracie Allen')

  LOCAL_IP=0.0.0.0        #  IP ,  .  = 0.0.0.0

  REMOTE_IP=0.0.0.0       #  IP ,  .  0.0.0.0

  NETMASK=255.255.255.0   #   ,  

  #

  #  ,      'ppp-on-dialer'

  export TELEPHONE ACCOUNT PASSWORD

  #

  #   ,        

  # . ,    ,    connect 

  #    $PATH. (  ,  'root'  

  #   ,    .)

  #

  DIALER_SCRIPT=/etc/ppp/ppp-on-dialer

  #

  #  

  #

  #

  exec /usr/sbin/pppd debug /dev/ttySx 38400 \

          $LOCAL_IP:$REMOTE_IP \

          connect $DIALER_SCRIPT

  ______________________________________________________________________





  ppp-on-dialer:



  ______________________________________________________________________

  #!/bin/sh

  #

  #     ppp-on.    

  # .

  #

  /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

  ______________________________________________________________________





 PPP-2.2,  ppp-off  :



  ______________________________________________________________________

  #!/bin/sh

  ######################################################################

  #

  #   .

  #

  if [ "$1" = "" ]; then

          DEVICE=ppp0

  else

          DEVICE=$1

  fi



  ######################################################################

  #

  #  pid  ppp0 ,   .  .

  if [ -r /var/run/$DEVICE.pid ]; then

          kill -INT `cat /var/run/$DEVICE.pid`

  #

  #  kill  ,   ,    pid.

  #    ,    lock . 

  # ,    .

          if [ ! "$?" = "0" ]; then

                  rm -f /var/run/$DEVICE.pid

                  echo "ERROR: Removed stale pid file"

                  exit 1

          fi

  #

  # .  pppd    .

          echo "PPP link to $DEVICE terminated."

          exit 0

  fi

  #

  # ppp     ppp0

  echo "ERROR: PPP link is not active on $DEVICE"

  exit 1

  ______________________________________________________________________







15.3.    PPP 



     ,      

.





15.3.1.  ppp-on



           

 ISP,     ISP,    ISP.



    TELEPHONE= -     shell,

     = ( , ).  

     ,     ISP  

.



,    IP  (   )   

/etc/ppp/options,  ,  



______________________________________________________________________



$LOCAL_IP:$REMOTE_IP \

______________________________________________________________________





, ,    DIALER_SCRIPT    

     ,     .

 ,       , ,  

       ppp-on!





15.3.2.  ppp-on-dialer



 -  ,     ppp .



 : chat   .    

,        

(  )      .



,      ,   ,  

 () !





15.4.    chat...



 chat -   " " " ". 

   ,     -  , 

 -.



    -  ,    -,  

     ( "")    

 -  ,   -! ,   

   , (, NO CARRIER),     

,  chat     .



 chat   :



______________________________________________________________________



exec /usr/sbin/chat -v

______________________________________________________________________





  chat  -v ,  chat   /  

 ( /var/log/messages).    ,   chat 

 ,   ,   -v,    

    syslog.



______________________________________________________________________



TIMEOUT         3

______________________________________________________________________





        3 .   

    5  10 ,     !



______________________________________________________________________



ABORT           '\nBUSY\r'

______________________________________________________________________





   BUSY,    .



______________________________________________________________________



ABORT           '\nNO ANSWER\r'

______________________________________________________________________





   NO ANSWER,    .



______________________________________________________________________



ABORT           '\nRINGING\r\n\r\nRINGING\r'

______________________________________________________________________





 ()   RINGING,    .



 ,  -     !



______________________________________________________________________



"              \rAT

______________________________________________________________________





    ,     .



______________________________________________________________________



OK-+++\c-OK   ATH0

______________________________________________________________________





   ,      

   chat.



What is says is... OK,     (     

 ),   +++ (   Hayes- 

,      )   OK.



  ATH0 (    ).    

    ,     !



______________________________________________________________________



TIMEOUT         30

______________________________________________________________________





     30     .   

    chat,  - ,  

   45   .



______________________________________________________________________



OK              ATDT$TELEPHONE

______________________________________________________________________





 OK (    ATH0)   ,    

 .



______________________________________________________________________



CONNECT         ''

______________________________________________________________________





  CONNECT (   ,    

)      .



______________________________________________________________________



ogin:--ogin:    $ACCOUNT

______________________________________________________________________





,    -  .   

   (... ogin:),         ,  

          .  

 ,  username (   shell $ACCOUNT).



______________________________________________________________________



assword:        $PASSWORD

______________________________________________________________________





       (   

 shell).



  chat     . chat  

   ,   .   

   man chat (man 8 chat).





15.4.1.  PPP    



  ppp-on-dialer    ,   

 pppd       ,  

 ,       PPP  .



    ,   PPP  ,   

  ppp-on-dialer.



   (  )    

-  -        

 ( ,       Bourne - 

 $  [  ] (    ).



   chat    ,    

  ppp,   PPP   ISP.



  ,  PPP     bash Linux.



______________________________________________________________________



[hartr@kepler hartr]$

______________________________________________________________________





 ,   



______________________________________________________________________



ppp

______________________________________________________________________





  PPP  .



     ,       



______________________________________________________________________



hartr--hartr    ppp

______________________________________________________________________



 ,          ,  

      .



   ,   ppp.



 :    \    ,   

chat ,    chat    !



 ,       !



     ,  minicom, 

 ,  ,    "" .





15.5.  chat   PAP/CHAP



  ISP  PAP/CHAP,    chat   .



   chat     -    , 

     pppd    !



  ______________________________________________________________________

  #!/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         ''                              \

  ______________________________________________________________________





15.6.  pppd   file option_file



   ,       -d  pppd. 

 'debug'  .



       ,  

 . (:      ,  

pppd      syslog     - but to do 

this you must fail to connect and keep on trying for quite a few minutes).



   ,    ,    .



    ppp   - ,  /etc/ppp/options,  

/etc/ppp/options.ttySx,     file  pppd - 



______________________________________________________________________



exec /usr/sbin/pppd debug file options.myserver /dev/ttyS0 38400 \

______________________________________________________________________





16.    



  root Xterm (    X)    

        root.



   ,  



tail -f /var/log/messages



( -      ).



   (  )  



ppp-on &



(        /usr/sbin/ppp-on). 

        ,    ,

&,           ,  ppp 

   (   ).



    ,      

.



  -   (     -v  chat

 -d  pppd) ....  -  chat  ,   

,      pppd:



  ______________________________________________________________________

  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

  ______________________________________________________________________



( -    IP  -   , 

  PPP  -    ,    

IP .) ,        ppp. 



    -     ,  IP 

   .



      -     -  

!





17.  PPP 



   PPP    ppp-off,  

  ( -    root'    PPP!).



      - :



  ______________________________________________________________________

  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.

  ______________________________________________________________________





   SIOCDELRT -    pppd  ,   

    .





18. 



  ,       , chat  

  ,    ..    

 syslog.





18.1.    PPP  ,  ...



     ,     PPP    

  ,     pppd,  ,    

 ppp!   ,    .





18.1.1.        ppp,     

.   ,     /etc/lilo.conf   

 lilo.    ?



    -  uname -a,    



______________________________________________________________________



Linux archenland 2.0.28 #2 Thu Feb 13 12:31:37 EST 1997 i586

______________________________________________________________________





    ,     -   

,     .





18.1.2.    ppp    ?



    ,     ppp   

  ,        .  

Kernel-HOWTO   README  /usr/src/linux!



 ,     ,   ,   , 

     ,    

kerneld (       ).



 kerneld mini-HOWTO     kerneld.





18.1.3.     PPP   ?



   ppp-2.2    2.0.x.    

ppp-2.2    1.2.x (  )    

  ppp-2.1.2.





18.1.4.   pppd  root?



    pppd   root ( pppd -  suid  root), 

     .





18.2.   ,  ppp  



       (. comp.os.linux...).



   -      . 

,     -  ,   

 chat,   syslog (/var/log/messages)   . 



     PPP  ,  

       .



     -     

     ,   -     

     ,   

   !





18.3. Syslog  "serial line is not 8 bit clean..."



      -    looped 

  ..,       .



 ,  ,     , 

  pppd .



 pppd ,   LCP (  )  

 .     ,     

 ( IPCP )       - 

  IP  ,      PPP.



      ppp ,    PC  lcp 

,     login   . 

    8 ,      

 8-  (,  ASCII - 7  ),  PPP  

   .



     .





18.3.1.     



   chat ,   PC  pppd. , 

          (  

,    PPP  ),  PPP  .



 lcp  ,     .



      (  )   

chat (. ).





18.3.2.    PPP  



 PPP  ,     /  return  

  ,      ppp.



   chat (. ).



     ,      

 return,   PPP,      "-

"     chat ( ""  

  return).





18.3.3.  PPP   



This one is a bit tricksy!



 ,  Linux pppd     10 lcp 

.    ,   10    

  ,   PPP    .



   pppd ,   10    ( 8- 

 )  .



    :



 lcp-max-configure 30    ppp.    

   lcp   . 

        

    .



     get a bit tricksy in return. , , 

, ,      PPP ,  PPP  

,    ppp      (~).



      -     

"-"     chat,    

    .   , , :



______________________________________________________________________



\~      ''

______________________________________________________________________





 :        

shell,    'escape' (, ,   

  ).





18.4.      



 pppd      , ,  

 ( )  /  

   .



    ,      

   ethernet-,    .  



. NAG Linux  Net2/3 HOWTOS       

 ethernet   c  .



 ,   LAN   /    

       .



        IP  

     HOWTO.     

(  ).





18.5.  



  ,  ,   ppp     

 /  .



 PPP FAQ (     ). 

 -   ,    !    

() ,       ,   -  

 ppp!      ELF ,      

,   .



    2  (  ),   

PPP ,    !





19.  ,   ,    



      PPP,      

 -   ,  "chat -v ..."  "pppd -d"   

 .



     PPP  FAQ    

 !



    ,        

comp.os.linux.misc  comp.os.linux.networking   comp.protocols.ppp



      ,       

 (  ),    ,    (  

),           

 !



  -          

,    EMAIL -      /dev/null (   

   ).





20.  , ,   



 ,   ,   ,    

       , 

      .  - () Microsoft

Windows :-(  -      ISP, ,    

  UNIX ( Linux). ,     , 

     !



You could of course do the individual a favour and educate then about Linux (any 

ISP help desk person should be reasonably 'with it' in Internet terms and that 

means they should have a home Linux box - of course it does)!





20.1.      PPP ,    



 -  PPP  ,      IP  PPP 

 (  "" IP    ifconfig ppp0), 

       PPP .



 ,   IP ,     

/etc/resolv.conf  DNS.   ,      

 PPP  ( DNS      IP ,   "" 

IP   ).     Internet  

  , 



ping my.provider.net.au



   ,        .



  -      /etc/resolv.conf.



   ,    .  

 ,      ,   

 IP .



      (    ,  

 DNS  ),     - ,   

     Linux (  

   ).



       IP DNS     IP 

,       (    

)        . , 

     .



     ,   " "  Linux PPP 

,    IP      !



   -       , 

  ,   ,  Microsoft

Windows.           , 

  -   Linux ,     .





20.2.    email,     



    IP ,    . . 

" " .





20.3.       finger, WWW, gopher, talk ?



,     IP ,   . 

. " " .





21.      IP 



    IP  (    

   IP ,       

   ),      ,   

 .



 ,        .

     email  sendmail (     

),   ftp    ,  finger

  ,     ..



 ,     email,      , 

    .       

,       ISP.



,       24       

     IP    .     

 email,   ,      

  ftp ,      !  

,      ,   ,

    IP  ( -    

  IP ,     ).



   WWW (   ),    

  ,    ,    

       IP .   , 

     ,       ,

   ".plan"   shell    

 (,       shell  finger).



,   ,    - ,   

  -     email (  

 )    WWW, ftp     .   

      ,   

  IP .       

,   ...





21.1.  email



   IP , , ,   sendmail  

     email,    .



 sendmail    -       

 ,   . ,     

sendmail ,          

"smart host" (sendmail.cf -  DS). (    sendmail

.  sendmail -    m4,    

sendmail.    ,    ).



     Sendmail ( ''  O'Reilly  

),    -      

!



    sendmail,     sendmail  

  ,      , 

 PPP .   ,  



sendmail -q &



   /etc/ppp/ip-up (. ).



  -     IP .   

:



      ,     

   "reply to",   email ,   

  .



  ,      FROM ,    

email,   ISP  .



   popclient, fetchmail,       

 .   ,   ISP  IMAP, 

   ,    IMAP ( 

pine).



        , 

    /etc/ppp/ip-up (. ).





21.2.     

                                                

          ISP,

      ()  , 

   ip-up.   ()  

   ,      (  ),   

             

.



 DNS      (   

"forwarders'   named.boot,   DNS  ISP)  

.  O'Reilly (DNS  Bind)  ,      .



  DNS-HOWTO.



     LAN,       

 Linux PC ( IP Masquerade, ),     

    (  forwarders)   

      ,   

 IP    .



  :    ISP,    

         ISP. 

   DNS       

 ISP ,     - ,    

  .





22.   ,  PPP



       Linux PC  PPP   

  LAN,  PPP     LAN.



, PPP -   -.



,       . 

 NET-2 howto     Linux (NAG).  

     "  TCP/IP" ( 

O'Reilly  Assoc - ISBN 0-937175-82-X).



         ,    

  Linux subnetworking mini-howto).    Linux Subnetworking

mini-HOWTO <http://www.interweft.com.au/other/>.



 ,    LAN,      IP

 (       )    

  IP  -   IP masquerade.   

  IP masquerade, . IP masquerade mini-howto  

  .





22.1.  IP 



     LAN  IP ,   

     PPP.     

IP ,    ,      

 .



    /etc/ppp/options[.ttyXX] -  

  -           

.      /etc/ppp/options -   

  options.ttyXX    !



 IP     PPP     

  ,      IP .





22.2.  



      LAN  ,  

 PPP .  -  .



 ,      ,  PPP 

 ()    .    ,     

       ,  

 pppd    ,   'defaultroute'

pppd.



 ,     LAN,     

   ,    .    

  'route'      /etc/ppp/ip-up (. 

 ,   ...    ,   ).



 ,    ,      

LAN,   Linux    ''  ()  

  ppp .



,         

  ! ,   /      

 ,     ,    

 (unless the LANs at the far and of the link are linking into you to 

access the Internet across your connection).





22.3.  



    LAN  ,  PPP -     

"" LAN,      .     

   firewall!



        LAN   , 

      LAN  .  

      -   -  

   !





23.  ,    -  /etc/ppp/ip-up



   PPP , pppd  /etc/ppp/ip-up.    

   , PPP   .    

    ,   

,    ,      

 PPP .



   shell,     ,     shell 

(      ).



,    sendmail   ,  

.



        ip-up   

( POP),     ISP.



   /etc/ppp/ip-up:



      ,   . 

 ,           ..



  /etc/ppp/ip-up -  ,   .  ,   

    -     

  (#!/bin/bash)          

    root.





23.1.  



    LAN,       

 '' LAN.   ,   /etc/ppp/ip-up. 

  ,       PPP 

.



 ,  /etc/ppp/ip-up    ppp ,  

,         

     -    

,     !





23.2.   



     LAN,    ,  

,        , 

.      sendmail.



    bash 'case'   ,

 ,  pppd.    /etc/ppp/ip-up, 

  ,    WAN      LAN 

ethernet (      ppp ).





23.3.   /etc/ppp/ip-up



     .



  ______________________________________________________________________

  #!/bin/bash

  #

  # ,       pppd

  #    Newman   .

  #

  #  ppp  ,      

  # 

  #       $1       ,  pppd (. ppp3)

  #       $2        tty

  #       $3        tty

  #       $4       IP    

  #       $5       IP 

  #       $6      ,   'ipparam'  pppd

  #

  case "$5" in

  #     Newman Campus

          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)

  #  Internet 

  #    ,      

  # . ,      

                  if [ ! -f /var/lock/subsys/xntpd ]; then

                          /etc/rc.d/init.d/xntpd.init start &

                  fi

  #    (   )

                  if [ ! -f /var/lock/subsys/news ]; then

                          /etc/rc.d/init.d/news start &

                  fi

                  ;;

          203.18.8.104)

  #         

  #   ,     Ethernet  IP

  # masquerade  proxyarp .

                  /usr/sbin/sendmail -q &

                  ;;

          *)

  esac

  exit 0

  ______________________________________________________________________





   ppp      Newman  

  ,      

 (      PPP ,   

   ).     ,   

,    ):



  ______________________________________________________________________

  [root@kepler /root]# route -n

  Kernel routing table

  Destination     Gateway         Genmask         Flags MSS    Window Use Iface

  # HOST       

  139.130.177.2   *               255.255.255.255 UH    1500   0      134 ppp4

  # HOST    Newman   

  202.12.126.1    *               255.255.255.255 UH    1500   0       82 ppp5

  # HOST     ethernet

  203.18.8.104    *               255.255.255.255 UH    1500   0       74 ppp3

  #     PPP 

  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

  #     Newman LAN  

  202.12.126.0    202.12.126.1    255.255.255.0   UG    1500   0        0 ppp5

  #     Ethernet (     C)

  203.18.8.0      *               255.255.254.0   U     1500   0     1683 eth0

  #    loop back

  127.0.0.0       *               255.0.0.0       U     3584   0      483 lo

  #     Internet

  default         139.130.177.2   *               UG    1500   0     3633 ppp4

  ______________________________________________________________________





23.4.  email



  ,     - ,  

 (flushing)  ,   .



   WAN ,        

 LAN,  c   . ,    WAN

    Newman   /etc/ppp/ip-up  :



______________________________________________________________________



#!/bin/bash

#

# ,       

#   pppd

#    Hedland   .

#



#   ppp ,      

#       $1       ,  pppd ( ppp3)

#       $2        tty

#       $3        tty

#       $4       IP    

#       $5       IP 

#       $6      ,   'ipparam'  pppd

#

case "$5" in

        203.18.8.4)

                /usr/sbin/sendmail -q

                ;;

        *)

esac

exit 0

______________________________________________________________________





      ISP   IP   PPP , 

    email      ISP.   

   POP (  ).   

  ,   'popclient', -  ip-up   

  !



   /etc/ppp/ip-up,     

popclient.    ,    Red Hat Linux 

(     ), 



______________________________________________________________________



popclient -3 -c -u hartr -p <password> kepler.hedland.edu.au |formail -s procmail

______________________________________________________________________





    slurp  - ,       

  .. ,  -     bash   

 ,    ,   

      PPP . 





24.  /etc/ppp/ip-down



   ,   ,     

.   /etc/ppp/ip-down.   ,  

 -,       /etc/ppp/ip-up.





25.   LAN



    LAN,     PPP   

 Linux,        LAN (   

ethernet),     PPP     ( ).



        -    

  ,   () !



        Linux 

(NAG),      .   O'Reilly " 

 TCP/IP"       .



    -     

  ,       . 

  ,      .



 ,      - ,   

Linux PC   LAN,      -    

      ,  

  LAN.



  ,    Ethernet  , 

       LAN    

 !



 ,   route.    -  :



[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



   ethernet (eth0)     , ( 

   "default"   eth0),      

  ethernet,       

  ,       (

 Net2 HOWTO  NAG).



  pppd         

:



[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



  ,      PPP  (10.144.153.51)  ppp0

      ,   PPP  

 .



      ,   -  

 ,         

!



   LAN   ,        

 ,   .        

      PPP -     

  ,   .





25.1.    



     Linux   LAN,   

,       LAN  -  , 

   . ,    ,  

         

 .   PPP       

    ,          

,    .     

   !



,    LAN  ,     

     -    

O'Reilly "  "!





26.  PPP 



  ,     .   , 

,     (   Cyclades)  

   .



    ,    , ,  

   .      

    HOWTO.  , ,    

  !



,  ,       Linux 

  PPP .  ()      

   .



  -     (   

-).



     ,     

 ,    shadow suite,  .





26.1.  



           

   pppd.    ,    

   !



 PPP ,    IP forwarding   .    

    ( IP fire wall,   

 .  .).



     ,    

     !





26.2.     



    PPP ( SLIP)  shell,   

   / .     ( ),  

           

  .



  -  ,       

  ,         

  .



  firewall     ,    

       

() firewall' (   ,   

 firewall'       ).



,      PPP    

 (,     ): 



      (   ,  

    -      ).



   ,       .



    shell   ppp,   PPP  .



  PPP   PC (  Windows, DOS, Linux MAC OS   ) 

  ).



    /etc/ppp/options.ttyXX   

 ,     IP . 

  proxyarp     (

  pppd).     routed  gated.



  " "   , pppd    

   " ",    PPP.





26.3.   



     :



 Linux,  ,     .



   pppd   .



  'getty',     .



  getty_ps2.0.7,   mgetty .  ,  mgetty 

 ,   pap/chap (pap -   Windows95) 

 pppd ,      .



     (DNS),    

. 



     DNS,    ...





26.4.   (  shell)  .



,      PPP ,  Linux box   

      .



 howto     .  .  

  getty  Serial-HOWTO    .





26.5.   PPP 



     /etc/ppp/options     

,   . ,   :



  ______________________________________________________________________

  asyncmap 0

  netmask 255.255.254.0

  proxyarp

  lock

  crtscts

  modem

  ______________________________________________________________________





 -    ()  -   , 

   defaultroute.    ,  ,   ( PPP 

)  ,      ppp 

  LAN/INTERNET      LAN .



,     -       

  pppd 'proxyarp'.



 'proxyarp'  ()  ARP   ARP  PPP 

,     '  ,  

PPP   '.       

 PPP ,      ,   

 LAN -      ,   

  ARP.



      IP   

  .      IP 

     . ,  

/etc/ppp/options.ttyXX      .



     () IP   IP ,   

   . 



______________________________________________________________________



kepler:slip01

______________________________________________________________________





 ,  ,       

     ( ,     IP   

       -   )!





26.6.  pppd,    ()    



   ppp      

( )   ,  , 

  -    root.



 , pppd    ''   

 uid  root.      



______________________________________________________________________



chmod u+s /usr/sbin/pppd

______________________________________________________________________





    ,   



______________________________________________________________________



-rwsr-xr-x   1 root     root        74224 Apr 28 07:17 /usr/sbin/pppd

______________________________________________________________________





    ,        ppp.





26.7.     pppd



 ,      PPP ,  

   ( /etc/bashrc) ,     

 ppp  ,      .



   



______________________________________________________________________



alias ppp="exec /usr/sbin/pppd -detach"

______________________________________________________________________





  



 exec :      (   shell) 

  ,  .



 pppd -detach :  pppd,      .



 ,   pppd  ,      

.



     ,    'w' 

  



  ______________________________________________________________________

    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                -

  ______________________________________________________________________



  -  ...     ,  PPP !





27.  PPP   ( ) 



   -  ,     .



       '',  getty  

 ,     ,   , 

 minicom,       ''.



   ,    getty     

,   ,   / ,

   .    ' ' 

 ,   ,      .



,    getty,  ,    

    ,  ,  

'setserial'.



,     ,   pppd   .   

,    /dev/ttyS34   . ,  

   :



______________________________________________________________________



pppd -detach crtscts lock <local IP>:<remote IP> /dev/ttyS3 38400 &

______________________________________________________________________





   -        . 

   ,   .   ,  

,     pppd.



    -     ,    

.   ,       ethernet ( 

),      ,   PPP   .



    Ethernet, pppd  



______________________________________________________________________



pppd -detach crtscts lock proxyarp <local IP>:<remote IP> /dev/ttyS3 38400 &

______________________________________________________________________





   



______________________________________________________________________



pppd -detach crtscts lock defaultroute <local IP>:<remote IP> /dev/ttyS3 38400 &

______________________________________________________________________





     (  !)  

   ,     

/etc/ppp/ip-up    ,      .



Robert Hart Port Hedland, Western Australia Melbourne, Victoria, Australia 

August/October 1996 January/March 1997



























