home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Edition 1: Linux / CD1.iso / doc / HOWTO / mini / ISP-Connectivity < prev    next >
Text File  |  1998-10-14  |  14KB  |  331 lines

  1.   ISP-Connectivity-mini-HOWTO
  2.   Michael Strates, mstrates@croftj.net
  3.   v2.0, 6 November 1997
  4.  
  5.   This document describes how to setup PPP, connect up to your ISP, con-
  6.   figure mail and news, get a permanent IP (if available), get a domain
  7.   name, and have a bonda fide system running in a little over thirty
  8.   minutes.
  9.   ______________________________________________________________________
  10.  
  11.   Table of Contents
  12.  
  13.  
  14.   1. Introduction
  15.  
  16.      1.1 New versions of this document
  17.      1.2 Feedback
  18.      1.3 Standard Disclaimer
  19.      1.4 Copyright Information
  20.  
  21.   2. Connecting to the Outside World
  22.  
  23.      2.1 Talking and Communicating with pppd and chat
  24.      2.2 IP's, Domain Names and Subnets
  25.  
  26.   3. Electronic Mail on your Linux Box
  27.  
  28.  
  29.  
  30.   ______________________________________________________________________
  31.  
  32.  
  33.  
  34.   1.  Introduction
  35.  
  36.   The main goal of this document obviously is to make the new user
  37.   friendly with the many terms of connecting your Linux PC up to the
  38.   Internet, obtaining IP addresses, domain names, and setting things up.
  39.   This guide is intended for the intermediate user in mind, although
  40.   intelligent newbies shouldn't have any problems.
  41.  
  42.  
  43.  
  44.   1.1.  New versions of this document
  45.  
  46.   New versions of this document will be periodically posted to
  47.   comp.os.linux.answers.  They will also be added to the various
  48.   anonymous FTP sites who archive such information, including:
  49.  
  50.   ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO
  51.  
  52.   In addition, you should generally be able to find this document on the
  53.   Linux Documentation Project page via:
  54.  
  55.   http://sunsite.unc.edu/LDP/
  56.  
  57.  
  58.   1.2.  Feedback
  59.  
  60.   I certaintly welcome any feedback about this HOWTO, spelling mistakes,
  61.   how it all worked out, thankyou notes and critisisms. I hope I helped
  62.   a few people with this HOWTO, and if I did, I'd be really happy to
  63.   hear from you.
  64.  
  65.   mstrates@croftj.net
  66.  
  67.   http://linloft.home.ml.org/
  68.  
  69.  
  70.   1.3.  Standard Disclaimer
  71.  
  72.   No liability for the contents of this documents can be accepted.  Use
  73.   the concepts, examples and other content at your own risk.  As this is
  74.   a new edition of this document, there may be errors and inaccuracies,
  75.   that may of course be damaging to your system.  Proceed with caution,
  76.   and although this is highly unlikely, I don't take any responsibility
  77.   for that.
  78.  
  79.   Naturally, there are probably better and easier ways to do things in
  80.   this document. There will always be another way in the Linux World.
  81.   This is the way I've done things, and that's the way I'll be
  82.   presenting them in this HOWTO.
  83.  
  84.  
  85.  
  86.   1.4.  Copyright Information
  87.  
  88.   This document is copyrighted (c)1997 Michael Strates and distributed
  89.   under the following terms:
  90.  
  91.  
  92.  
  93.   o  Linux HOWTO documents may be reproduced and distributed in whole or
  94.      in part, in any medium physical or electronic, as long as this
  95.      copyright notice is retained on all copies. Commercial
  96.      redistribution is allowed and encouraged; however, the author would
  97.      like to be notified of any such distributions.
  98.  
  99.   o  All translations, derivative works, or aggregate works
  100.      incorporating any Linux HOWTO documents must be covered under this
  101.      copyright notice.  That is, you may not produce a derivative work
  102.      from a HOWTO and impose additional restrictions on its
  103.      distribution. Exceptions to these rules may be granted under
  104.      certain conditions; please contact the Linux HOWTO coordinator at
  105.      the address given below.
  106.  
  107.   o  If you have questions, please contact Tim Bynum, the Linux HOWTO
  108.      coordinator, at
  109.  
  110.   linux-howto@sunsite.unc.edu Finger for phone number and snail mail
  111.   address.
  112.  
  113.  
  114.   2.  Connecting to the Outside World
  115.  
  116.   In this document, we'll explain how to do this using PPP (Point to
  117.   Point Protocol), a popular protocol nearly always used over the
  118.   Internet. It allows your modem to speak to the outside world. This is
  119.   what applications like Trumpet Winsock in Windows 3.x did, and many
  120.   other programs that you've probably have never seen.
  121.  
  122.   In Linux, we use a thing called chat to do the dialing up to the ISP
  123.   and then use a utility called pppd to 'use' the connection. In a
  124.   sense, chat is your dialer, and pppd is your protocol. We'll describe
  125.   how to setup both below.
  126.  
  127.   2.1.  Talking and Communicating with pppd and chat
  128.  
  129.   Probably the easiest way to go about things is to make a shell script
  130.   in root's home directory called ppp-connect and involke the script
  131.   whenever you wish to make your connection. We'll discuss this method.
  132.  
  133.   Open up your favourite editor as root on  /ppp-connect. You'll then
  134.   have to decide on your parameters.
  135.  
  136.   pppd connect 'chat -v "" "your_init_string" "" ATDTisp_number CONNECT
  137.   "" ogin: your_username word: your_passwd' /dev/tty(0/1/2) speed modem
  138.  
  139.   pppd involkes /usr/sbin/pppd on my system, then loads up chat to do
  140.   the dialing. Chat sends your_init_string to the modem, then dials
  141.   isp_number. It then waits for CONNECT, then waits for ogin: (l removed
  142.   as the first character is sometimes lost), sends your_passwd, chat
  143.   then terminates and hands the show over to pppd.
  144.  
  145.   The last of the command specifies your modem port (mine's /dev/ttyS1).
  146.   In most cases it will be ttyS1 (COM2: in DOS), ttyS0 (COM1: in DOS),
  147.   or if your using Slackware, cua1 or cua0. The speed is the speed of
  148.   the modem. I use 115200 for my modem (a 33.6k). If you have got a
  149.   fairly recent computer (one with a 16550 UART), then I wouldn't go any
  150.   lower than 57600.  Otherwise, for 14.4k 38400. Modem just tells pppd
  151.   that it's a serial/modem based connection. Remove the -v option if you
  152.   don't want verbose logging to your logfiles.
  153.  
  154.   The scenario below is one of a person who dials up an ISP that
  155.   automatically starts PPP for them, ie; they don't have a shell that
  156.   actually starts. This is his command in his  /ppp-connect:
  157.  
  158.   pppd connect 'chat "" "ATZ" "" ATDT555-1800 CONNECT "" ogin: johnny
  159.   word: blackjak' /dev/ttyS1 115200 modem
  160.  
  161.   But for some people, they're ISP starts up a shell and doesn't
  162.   automatically start PPP this may be a problem. Luckily, chat can deal
  163.   with that too. You just add another command to your chat script. For
  164.   example, below this johnny character is using an ISP that just dumps
  165.   him to a shell, requiring him to type ppp to get a ppp connection. His
  166.   shell prompt ends with a $.  pppd connect 'chat "" "ATZ" ""
  167.   ATDT555-1800 CONNECT "" ogin: johnny word: blackjak $ ppp' /dev/ttyS1
  168.   115200 modem
  169.  
  170.   If it's more than one word, ensure you quote it. I hope you can see
  171.   the drift of this, and are able to create your own script up to suit
  172.   your connection. Simply modify either the first johnny or the second
  173.   johnny script to suit your taste, port, server, etc and save the file.
  174.  
  175.   Now you've made your file, ensure that only root can execute, read or
  176.   write to it. This is extreemly important. Also make sure nobody can
  177.   read your logfiles, if you decide to leave the -v option in, as your
  178.   password is seen in cleartext in the logs (I don't see much need for
  179.   -v, if you don't know what I'm talking about, leave -v out).
  180.  
  181.   2.2.  IP's, Domain Names and Subnets
  182.  
  183.   For most people using the options above, a changing IP address won't
  184.   bother them. These people include basic, easy going users, that just
  185.   have dialup accounts, and aren't very technically minded. For those
  186.   people, skim read this section, I'll come to important things you need
  187.   to do to setup your system properly. Newbies, skip the sections
  188.   dealing with permanent IP, Domain Names, Subnets, and just read the
  189.   last bit of this section.
  190.  
  191.   Getting a permanent IP address might be free for your ISP, so if in
  192.   doubt ask them. Personally, I'd pay for a permanent IP address. It
  193.   lets you send e-mail to and from using a unique IP or domain, etc. If
  194.   you want to get yourself a permanent IP, write an e-mail to
  195.   root@yourisp.com, and ask him nicely if he can arrange a permanent IP
  196.   for you.
  197.  
  198.  
  199.   When you get your permanent IP address, grep through your /etc
  200.   directory to find where your old IP addresses are. I had to change
  201.   files in my sendmail directory and /etc/hosts. There are some other
  202.   key files that you will only discover with grepping. Open up
  203.   /etc/hosts, and add your new IP address in the standard format. Reboot
  204.   your computer, and you should be ready to go.
  205.  
  206.   You'll now need to change your chat script to reflect your new
  207.   settings.  If you are forced into PPP as soon as you start your
  208.   connection, you'll need to tell your System Administrator of your ISP
  209.   to ensure their PPP system recognises that you have a permanent IP
  210.   address and allocates you that instead of a changing one. If you get
  211.   dumped at a shell prompt, and you need to type ppp or something to
  212.   start the connection, instead of typing that, change your  /ppp-
  213.   connect script to send this instead of just ppp or whatever when it
  214.   sees $ or whatever your shell prompt is.
  215.  
  216.   /usr/sbin/pppd :Your_IP_Address
  217.  
  218.   Substitute your IP address for the IP address your ISP gave to you. Be
  219.   sure you encapsulate the thing in " " marks when you put it into your
  220.   chat script. If this doesn't work, consult your ISP where your PPP
  221.   daemon is located, and ask him for the command to give. You could just
  222.   try leaving it as is and seeing if the server will recognise you and
  223.   give you your rightful address.
  224.  
  225.   The next thing probably to do is to get yourself a domain name. I know
  226.   that in Australia, .asn.au and .org.au are free. In the United States,
  227.   you can get a .us domain for free, but they tend to be long. If your
  228.   in Australia, you must go to http://www.aunic.net/ to register your
  229.   domains. In the United States, it is http://www.internic.net/ .
  230.  
  231.   To register domains you need to be able to provide DNS services, and
  232.   gorey stuff like that. If your ISP can't provide these, throw out an
  233.   official .asn.au or whatever domain out the window, and get a Monolith
  234.   Internet Domain.
  235.  
  236.   Monolith offer free domains to anybody and anyone all around the
  237.   world.  Everything is done without human interaction, via a web forms
  238.   interface with your browser. Your domain comes in the form of
  239.   Your_Choice.ml.org.  Monolith will then host the DNS locally for you.
  240.   If you want to send and receive mail from that domain, ask your ISP to
  241.   become a mail exchanger for you.
  242.  
  243.   Go to http://www.ml.org/ and fill out an application, enter the NIC
  244.   with your username and password, and make a FREED domain. You'll need
  245.   to enter your IP address, so have that ready. Your domain will be in
  246.   the DNS in a couple of days.
  247.  
  248.   Okay now, we'll move onto the newbies section, or for those people who
  249.   can't get a permanent IP address or a domain name. All you have to do
  250.   is edit /etc/hosts as root, call your site something that won't clash,
  251.   give it a 10.10.10 or something for an IP address and reboot your
  252.   computer.
  253.  
  254.   There you go, you've just setup your computer with pppd and chat in
  255.   just ten minutes. Now let's move onto the next section, which deals
  256.   with Electronic Mail.
  257.  
  258.   3.  Electronic Mail on your Linux Box
  259.  
  260.   One of the most important aspects of the Internet, is it's fasinating
  261.   capaiblity to transfer mail to and from countries, or more locally
  262.   perhaps. Linux is extreemly strong in easy mail packages for the
  263.   console.  The one we're going to document today is called Pine
  264.   (Program for Internet Mail and News), made by the University of
  265.   Washington, and to download the mail, a program called Fetchmail, made
  266.   by Eric S. Raymond. Both should be included in your Linux
  267.   distribution.
  268.  
  269.   Fetchmail is a program that downloads your e-mail from your server
  270.   using POP, transfers the mail onto your computer and then deletes it
  271.   off the server, much like programs like Eudora or Microsoft Internet
  272.   Mail/Exchange do. To configure and automate fetchmail, you use a file
  273.   in your home directory called .fetchmailrc. Simply open up
  274.    /.fetchmailrc (Remember: your doing this bit as yourself, not as
  275.   root) with your favourite editor and observe the command lin eoptions
  276.   below:
  277.  
  278.   poll mail.yourisp.com proto pop3 user login_name password your_passwd
  279.  
  280.   user login_name with pass your_passwd is login_name here
  281.  
  282.   All you have to do is replace mail.yourisp.com with the name of the
  283.   mail server of your ISP, your_passwd with your password, and
  284.   login_name with your login name.
  285.  
  286.   An important thing to note. For Pine and this procedure to work
  287.   correctly, your login name must corrospond with the login name you use
  288.   on your ISP.  That is your local login name must match the one you use
  289.   on your server, and your e-mail address.
  290.  
  291.   Next, ensure that .fetchmailrc has the correct permissions (user
  292.   read/write only) and your laughing. Fetchmail can be started in two
  293.   ways, in standard mode (where it'll fetch messages from the server and
  294.   terminate), or in daemon mode (where it will stay active, and
  295.   check/download mail every X seconds). To use daemon mode, type
  296.   fetchmail -a -d(Seconds between Polls). -a ensures it downloads all
  297.   mail. To use the standard mode, just type fetchmail -a.
  298.  
  299.   Next, you need to setup Pine. Open up Pine, by typing pine at your
  300.   prompt, choose Setup - Configuration. Setup your userdomain as the
  301.   domain in your e-mail address, for example jack@linux.org, would be
  302.   linux.org. Next, setup smtp-server as your POP mail server (the same
  303.   you used in the fetchmail setup). So we enter www.linux.org. If you
  304.   want news, setup your nntp server to your ISP's news server.
  305.  
  306.   So there you have it folks, everything should be working now. To
  307.   connect up to your ISP, just run  /ppp-connect as root. Then, to get
  308.   your e-mail run fetchmail -a as yourself. To browse your e-mail and
  309.   news, use Pine. Install a text-based browser such as Lynx to browse
  310.   the web if you like.
  311.  
  312.   Send any comments questions and suggestions to mstrates@croftj.net
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.