I just added a link to the tar file containing all the required files at ftp://ftp.mindspring.com/users/caffeine1/ppplinux.tar as well as fixed up a www link at the bottom of the page. Hopefully Dan will put this page onto his web site soon. - Johann, 1997/11/20.

Configuring PPP for Linux - A Quick, Dirty, Perl-Driven Approach

Hi!  This is the documentation of what I know about configuring PPP for Linux. Now, I fully assume that this knowledge base is incomplete. If you find a gap anywhere, feel free to write me about it. I'll update it as soon as possible.

Before We Begin..

Let's make sure you have the requisite  information for this task. You will need:
    Your ISP's phone number;
    Your POP server ID and password;
    The addresses of your ISP's domain name servers (DNSs);
    and  an idea of which line speed to use (28800, 57600, 115200, 230400)

About PPP on Linux

These are the necessary files to edit in order to get your PPP setup up and running:
/etc/chap -- for use with the CHAP authentication protocol
/etc/pap    -- for use with the PAP authentication protocol
/etc/resolv.conf -- standard *nix file for host name resolution configuration
/etc/ppp/chap-secrets -- items used in CHAP that you don't want others knowing
/etc/ppp/chat  -- modem configuration data: what's expected, what's sent, on each line
/etc/ppp/options -- options to supply to the PPP daemon
/etc/ppp/pap-secrets -- items used in PAP that you don't want others knowing
/etc/ppp/ppprc -- a resource file you can use to supplant some of the options
You can see what exactly goes in these files by perusing the other files in this archive.  Yes, things look a bit different from what I've described above. So let me explain the rest..

Why This Funny Directory Tree?

Chances are pretty good that you have more than one ISP, like I do: I like to dial in to work as well as to a private service provider. As you can probably guess, editing eight files to dial in can be a royal pain. So I created the enclosed script, pppto,  which can switch your Linux box automatically among various ISPs and dial the target. Pppto is a simple Perl script that twiddles soft links (no mystery here, really), but even simple (simplistic?) Perl can be productive Perl.


How to Prepare Your Directory Tree For Using Pppto

Simple, really.  Okay, it's so simple that I should have hacked together an installer. Sorry. Besides, you may feel more comfortable doing this on your own anyway.
 


Other Useful Things To Know

In order to see how the dialin procedure is going, (or not going), execute tail -f /var/log/messages -- you should see something like this if all goes well:


Nov  9 08:26:05 lemieux pppd[15709]: pppd 2.2.0 started by root, uid 0
Nov  9 08:26:04 lemieux kernel: registered device ppp0
Nov  9 08:26:22 lemieux pppd[15709]: Serial connection established.
Nov  9 08:26:23 lemieux pppd[15709]: Using interface ppp0
Nov  9 08:26:23 lemieux pppd[15709]: Connect: ppp0 <--> /dev/cua1
Nov  9 08:26:30 lemieux pppd[15709]: Remote message: Packet mode enabled:
Nov  9 08:26:30 lemieux pppd[15709]: local  IP address 209.86.20.193
Nov  9 08:26:30 lemieux pppd[15709]: remote IP address 168.121.1.1

From this, we can see the PPP daemon (pppd) running on my host (named "lemieux", after another legendary penguin), and that it has a process ID of 15709.  (This is important.) Also, lemieux has been assigned a dynamic IP address of  209.86.20.193 ; this is incredibly useful for dialing into Unix hosts, and redirecting their X Windows traffic (such as, well, windows) to your dailed-in desktop.

To terminate your dial-in session, execute the following command as root: kill -1 ppp_pid,    where ppp_pid is the PPP daemon's process ID.
(Hey, I said that would be important.) What's with the -1?  Well, the 1 stands for the Unix "hangup" signal (also known as SIGHUP). By sending this signal to the PPP daemon via the kill command, you are notifying the daemon that something out there has occurred that demands that the serial connection be taken down, cleaned up, etc. etc.  (What occurred exactly? You chose to do so, silly, by executing the command.)

Whatever you do, do not leave out the -1, or (even worse) replace it with anything else, particularly a -9.  The 9 stands for the "terminate with extreme prejudice" signal (or SIGKILL -- this is the most popular use of the kill command, surprise, surprise), and it may very well cause the pppd daemon to die without cleaning up after itself.  This is probably not a major problem -- you can always turn the modem off, then on, and try pppto again -- but it's always a good idea to do things the right way, if only to get in the practice of respecting system integrity.



Well, that's it. Please bear in mind that I created all of this (words and scripts) with the barest minimum of knowledge - merely what I was able to glean from various  scattered  pieces of documentation here and there. (Yeah, I know, RTFM. But admit it: man pages were never meant to be tutorials, but to be references. Hopefully  I can use them as such after all this.) Be sure to look at the example templates. And, if anything on this page is incorrect or incomplete, tell me about it!  I'll edit it as soon as I can..

Hope this helps,
-- Dan Caugherty
Email: caffeine1@mindspring.com
Web: http://www.mindspring.com/~caffeine1/cork.html File last modified: 19 November 1997