Click here for an update. (Jul 24/2000)
Before we begin, I would like to have a chance to introduce a software that in my opinion, is superior to the ppp scripts that I describe below, and that is kppp. kppp normally runs in the K-Desktop Environment (KDE) that currently distributes with Caldera, by default. However, be assured that it also runs under other desktops like GNOME/Enlightenment and fvwm (I've tried both). The kppp package encapsulates the configuration and login session in a graphical user interface that makes internet connections both secure and easy. Unlike the ppp scripts below, your password is encrypted. Though configuration is "brain-dead" (meaning that you don't need to use yours), you still need to know some information in advance: 1) the phone number of your ISP; 2) the port number of your modem (where COM1 is /dev/ttyS0 in Linux; COM2 is /dev/ttyS1; COM3 is /dev/ttyS2; and COM4 is /dev/ttyS3 -- Pick the one that is correct for your computer). 3) the IP numbers for your a) gateway, and b) nameserver(s). For those subscribing to Internet Direct, the IP numbers can be found on their website (currently: www.idirect.com). Click on "Support", then on "Settings" on the sidebar).
I maintain these pages despite my new-found use of kppp, for those who do not use windows, and prefer to stick to a tty-based login session. ppp-on and ppp-off are scripts that are GUI-less and therefore work well in a tty-based login.
Users are advised to debug these scripts as they have been optimised for Internet Direct. This is especially true for the chat scripts. Other users can see the chat script as a "worst-case scenario" in terms of encountering duplicate strings in the host's output, for example. Explanations will be given throughout, to show at least some kind of rationale as to how the scripts work. This is offered to you as just that: a rationale, not an air-tight theoretical foundation.Please read the LINUX PPP-HOWTO before reading this document. Also recommended but not required (I did OK without it) is the book Running Linux by Welsh and Kaufman (now in its third edition).
The kernel I have been using is version 2.0.33, and more recently 2.0.35. For whatever reason, I did not get consistent behaviour with version 2.0.30, and I recommend you compile any Linux kernel version 2.0.33 or greater. I am not sure as to what happens with the 2.2.x kernels, since I have been mostly using kppp. My own superficial testing has shown that the scripts do not seem to work the way it is expected. But that may be because I hadn't fiddled with it enough.
|
|
Also, once a user has dialed that modem, the same user has to hang it up. The only other user who can hang it up is root. Conversely, if root does the dialing, no one else can hang it up.
Check out the following sources. These source files come with blow-by-blow descriptions of how they were made, when applicable.
/etc/scripts/ppp-on-dialer /etc/scripts/ppp-on /etc/scripts/ppp-off /etc/scripts/options
Let's regard chat scripts in the same way as a script for some minimalist play (like say Happy Days, by Samuel Beckett or Waiting For Godot). In a minimalist play, you probably have two "talking heads" on stage, saying their lines without much else in the way of setting or anything else embellishing it. One person says his line, then the other responds. And then you repeat this several times, until the play is over. (So much for an appreciation of modern drama!)
But that is how chat scripts work. Your script dials the number, then when it gets a string from the remote host, it issues the appropriate responses on-cue. In fact, it is an automated login. You need to know how your host is going to respond so that you know what strings to expect. What are your host's prompts for your login name? Your password? At what point do you let your host know that you intend to make a ppp connection? Once you have given the ISP word of your intention that you want to hook up via ppp, you are essentially done. Before that, however, you need to know what strings to expect so that you know what to respond with. They have, in fact, been given the ingenious name "expect strings".
PPP scripts these days tend to work straight out of the box in most Linux distributions. Just about the only thing you need to do nowadays - especially with dedicated PPP lines that most ISPs have - is to edit ppp-on for your username, password, and phone number for the ISP of your choice.
Click here to see
how to write your own 'ppp-on-dialer' script.
You might need to do something like this if your login process has a lot of
intervening text apart from the usual "login:" and "Password:" prompts. This
must be sorted out, since a poorly written PPP script will respond off-cue,
and as a result you will not get logged on. This script was written as a result
of my first experiences with PPP, before my ISP had dedicated PPP phone numbers
to dial into.
Click here to see the script. This script in particular works on my current system, and will be different from the 'write-your-own' version described above.
The version on the following link works for dialups where the ISP has PPP in mind. That is, the ISP does not issue any more text than simply the Username and Password (and probably the FQDN of the machine you are logging on to and thus the script described here is very straightforward.lock
since Apr 1 2007