home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / LINUX / HOWTO / mini / pppmcom.txt < prev    next >
Text File  |  1997-07-07  |  9KB  |  259 lines

  1.  
  2. PPP-over-minicom mini-HOWTO                  Winfried Trⁿmper <winni@xpilot.org>
  3. ---------------------------                  v0.0  09 December 1996
  4.  
  5. You want a menu-driven tool for dealing with PPP? An easy but powerful
  6. database with telephone numbers of your ISP? Want to see what happens
  7. when logging in? Then this mini-HOWTO is for you!
  8.  
  9.  
  10.   1. Introduction
  11.  
  12.         PPP has become the standard network protocol for hooking up
  13.         to the internet via dial-in connections. The associated
  14.         daemon "pppd" ships with a very primitive tool for dialing
  15.         which handles only very simple setups well.
  16.         I will describe an alternate solution on the basis of "minicom".
  17.  
  18.         This document is a short version of the German "Internetanbindung
  19.         mit PPP" ("http://www.uni-koeln.de/themen/linux/ppp/")
  20.  
  21.  
  22.   1.1. The terminal program "minicom"
  23.  
  24.         "minicom" is a very sophisticated tool for dialing into
  25.         other computers (ISPs or BBSs). It has a fancy colored menu,
  26.         a telephone database and a powerful scripting language. Thus
  27.         it is ideally suited for use in conjunction with "pppd".
  28.  
  29.         BTW, if you run "/sbin/mgetty /dev/modem" everyone with a
  30.         valid account on your machine can dial in (e.g. using
  31.         "minicom"). But thats another story. Please see the docs of
  32.         "mgetty" for details.
  33.  
  34.  
  35.   1.2. Feedback
  36.  
  37.         I'm only interested in feedback that improves this mini-HOWTO.
  38.         I won't answer general questions about Linux, PPP, SLIP or
  39.         networking.
  40.  
  41.  
  42.   1.3. Known bugs
  43.  
  44.         At the time of writing, there seem to be some bugs in
  45.         "minicom", "runscript" and the method described below:
  46.  
  47.               - "runscript" does not wait for external programs to
  48.                 finish 
  49.  
  50.                         print "blah"
  51.                         ! sleep 10
  52.                         print "blup"
  53.  
  54.                 This script exits immediatly (but not when straced
  55.                 ...)
  56.  
  57.               - "pppd" takes the serial device away from minicom
  58.                 (when not fed via stdin)
  59.  
  60.  
  61.         It seems that Miquel van Smoorenburg (the author of minicom)
  62.         is too busy to get his fingers on the above. So volunteers
  63.         are welcome.
  64.  
  65.  
  66.  
  67.   2.0. Dialing with minicom
  68.  
  69.         Many guides on PPP recommend to leave minicom after it's been
  70.         used for dialing. But there is really no need to leave this
  71.         comfortable program ...
  72.  
  73.  
  74.   2.1. Configure minicom
  75.  
  76.         Execute "minicom -s" and choose the menu item "Serial port
  77.         setup". The first entry should be "Serial Device" this is
  78.         the most important setting: the serial device your
  79.         modem is attached to. (Any volunteers to mess up minicom to
  80.         handle several serial devices at once?)
  81.         Press <return> to confirm and <esc> to exit to the initial
  82.         setup menu. Choose "Exit to minicom" and type "atdt99999".
  83.         Your modem should start to dial immediatly and you should
  84.         hear a click when the modem hooks up to the line. Of course
  85.         "99999" is no valid telephone number.
  86.  
  87.  
  88.   2.2. Starting PPP manually
  89.  
  90.         Maybe you've already tried to dial the telephone number of
  91.         your ISP instead of "99999". Did you see funny characters
  92.         on the screen after login in (if not, type "ppp")? They
  93.         result from the "pppd" (or equivalent) started at the other
  94.         end of the line. If so you can try to start the
  95.         "pppd"-daemon on your side and evaluate the log-files
  96.         afterwards.
  97.  
  98.         To start "pppd" inside minicom, you can define a new
  99.         upload method (figure out yourself) or re-define the
  100.         setting "kermit programm" from the configuration menu
  101.         "Filename and paths":
  102.  
  103.                 A - Download directory :
  104.                 B -   Upload directory :
  105.                 C -   Script directory :
  106.                 D -     Script program : /usr/bin/runscript
  107.                 E -     Kermit program : /usr/sbin/pppd file /etc/ppp/mini_options
  108.  
  109.         Now if you see those funny characters next time you dial
  110.         to your ISP you can press <Alt-K> to start "pppd".
  111.  
  112.         The rest of this mini-HOWTO deals with automating the task
  113.         of logging in and starting "pppd".
  114.  
  115.  
  116.   2.3. Evaluating logfiles
  117.  
  118.         Although I do not want to explain how PPP is to be configured,
  119.         I give a short tip how to read the log-file. To extract the
  120.         essential information from the logfile "/var/log/debug" (or
  121.         alternative "/var/log/daemon.log") execute the commands
  122.  
  123.                 tail -n 40  /var/log/debug |\
  124.                         grep -E " pppd\[[0-9]*\]:" |\
  125.                         sed -e "s/^.*pppd\[/[/" 
  126.  
  127.         You should see messages like
  128.  
  129.                 sent [LCP ConfReq id=0x1 <mru 296>]
  130.                 rcvd [LCP ConfRej id=0x1 <mru 296>]
  131.  
  132.         which indicate that we sent a config-request to set the maximum
  133.         recieve unit (mru) to 296. The other side refects this setting
  134.         ("configuration rejected"). In this case I just removed the
  135.         option "mru" from "/etc/ppp/options" (see below).
  136.  
  137.  
  138.   2.4. Configure a telephone number
  139.  
  140.         If the above was successful you may want to store a telephone
  141.         number in minicoms database. Press <Alt-D> to pop up the
  142.         dialing menu and use the cursor keys to select "Edit":
  143.  
  144.                 A -  Name                : Xeno
  145.                 B -  Number              : 022039697303
  146.                 C -  Dial string #       : 1
  147.                 D -  Local echo          : No
  148.                 E -  Script              : /etc/ppp/login.script
  149.                 F -  Username            : ppp-382
  150.                 G -  Password            : top-secret
  151.                 H -  Terminal Emulation  : VT102
  152.                 I -  Backspace key sends : Delete
  153.                 J -  Linewrap            : Off
  154.                 K -  Line Settings       : Curr 8N1
  155.  
  156.         This is a sample entry to dial to one of my ISPs. The script
  157.         "/etc/ppp/login.script" is shown below. Two special variables
  158.         are passed to this script: $(LOGIN) and $(PASS) which are
  159.         set to the values submitted as username (F) and password (G).
  160.         This feature makes minicom somewhat flexible because you
  161.         need only one script to automate your login to several ISPs.
  162.  
  163.  
  164.   2.5. A login script
  165.  
  166.         "minicom" starts the login-script after it recieves the string
  167.         "CONNECT". To be precise, "minicom" does not execute the script
  168.         itself but calls the utility "runscript" as a sub-process for that.
  169.  
  170.         Below is a example I use for my ISPs.
  171.  
  172.                 # v1.0, 20.08.96 Winfried Trⁿmper <winni@xpilot.org>
  173.                 print ""
  174.                 print "Automatic login via /etc/ppp/login.script"
  175.         
  176.                 ## uncomment if you need to press enter to get the prompt
  177.                 #send ""
  178.         
  179.                 expect {
  180.                         "ogin:"
  181.                         "ogin>"
  182.                         "sername:"
  183.                         "sername>"
  184.                         "NO CARRIER" exit 1
  185.                 }
  186.                 send "$(LOGIN)"
  187.                 expect {
  188.                         "assword:"
  189.                         "assword>"
  190.                         timeout 20
  191.                 }
  192.                 send "$(PASS)"
  193.                 expect {
  194.                         "port"  send "ppp"
  195.                         "Start your PPP now"
  196.                         "}!}!}"
  197.                         timeout 10
  198.                 }
  199.                 print ""
  200.                 print "Now switching into ppp-mode ..."
  201.                 print ""
  202.  
  203.                 ! /usr/sbin/pppd  file /etc/ppp/mini_options
  204.  
  205.                 print ""
  206.                 print "the command   killall -TERM pppd   terminates pppd"
  207.  
  208.  
  209.         The ability of "runscript" to call external programs is used
  210.         to start "pppd". Copy your original options-file for ppp
  211.         to "/etc/ppp/options.ttyS1"  (where you have to replace "ttyS1"
  212.         with the device your modem is attached to) and delete  all
  213.         lines from /etc/ppp/options that are specific to your modem
  214.         (like "connect", "crtscts" or "modem").
  215.         Put t