This document is released under the GNU General Public License.
Most Linux kernels are compiled with PPP support, so this usually isn't a problem. However, if your kernel doesn't have PPP support, and you have never compiled a Linux kernel, you must be careful to do it correctly. There are two easy ways to figure out if your Linux kernel already has PPP support. When booting up, report lines of kernel device drivers and system messages are displayed. The kernel PPP driver will print the line:
PPP: version 2.2.0 (dynamic channel allocation)
If this scrolls by too fast to read, the file /var/log/messages contains the contents of these messages, and MUCH more. Look in it to find the above message.
You can also use the command: dmesg
to get a listing of all
kernel messages sent to /var/log/messages since boot-up. This will be much
easier to read, espically if you use: dmesg | more
To compile the kernel with PPP support, you must have the kernel source installed. Under most distributions (Slackware, Readhat, and almost all others) the kernel source is in /usr/src/linux. The README file in that directory will get you started. Plan on spending 2-3 hours the first time you do this. If you don't have the kernel source, you can ftp it from ftp.cs.helsinki.fi/pub/Software/Linux/Kernel.
There were changes in the kernel PPP from Linux version 1.2.x to 2.0.x which forced the programming of a new pppd daemon. In most distributions, the pppd daemon can be found in /usr/sbin. For kernel versions 1.2.x, the correct version of the pppd daemon is 2.1; for kernel versions 2.0.x, the correct version is 2.2. If you don't know what version of the pppd daemon your system has, you can type:
pppd --version
None of the pppd daemons actually has a --version option, but putting the option in will cause the pppd daemon to error out from a unrecognized option and print out a list of options, which includes the version of the pppd daemon. If you don't have the right version for your kernel, you can find it at the SunSite ftp site at:
sunsite.unc.edu /pub/Linux/system/Network/serial/ppp/
The file you will want will be either ppp-2.1.2d.tar.gz or ppp-2.2.0f.tar.gz, depending on your kernel version. The pppd daemons come as source, and you will have to compile them yourself.
Serial port names are different in Linux than in DOS. In DOS, the serial ports are called COM1, COM2, COM3, and COM4. In Linux all devices are represented as special files in the /dev directory. The table below matches Linux serial devices with the DOS labels.
DOS | Linux |
---|---|
COM1 | /dev/cua0 |
COM2 | /dev/cua1 |
COM3 | /dev/cua2 |
COM4 | /dev/cua3 |
You may have already dealt with configuring your serial mouse or modem during your Linux installation. All the configuration really does is creates the link /dev/mouse or /dev/modem, which points to the appropriate /dev/cuaX serial device. If you have a modem or mouse configured, do an ls -l of the device and you'll see what I mean.
On x86 computers (Intel and clones) the choice of what serial port you put your modem and mouse on can be important. You can really start running into problems when you have a internal modem and you have to configure it before putting it into your system. This situation is common, and can cause major problems for those who don't understand how x86 serial ports work. Because serial ports COM1 and COM3 share a interrupt, only one of the serial ports can be active in high-speed communication at a time. The same is true for COM2 and COM4. If your mouse is on COM1 (/dev/cua0), and you install the card modem on COM3, you will find that your mouse cuts out as soon as you start using your modem. The solution is to move your mouse to COM2, and keep your modem on COM3. The table below describes the setup.
Device | DOS Serial Port Name | Linux Serial Port Name |
---|---|---|
Nothing | COM1 | /dev/cua0 |
Mouse | COM2 | /dev/cua1 |
Internal Modem | COM3 | /dev/cua2 |
To complete the setup, the old links for modem and mouse must be removed, and new links created. The following commands will work to complete the setup in the table above:
cd /dev rm mouse rm modem ln -s cua1 mouse ln -s cua2 modem
EzPPP comes in one of two GNU-ziped tar files:
ezppp-1.0BX-i386.tar.gz ezppp-1.0BX-i386-static.tar.gz
Where the 'X' is the Beta number, and will disappear when the final 1.0
release is ready. After downloading the file, move it to your home directory,
or some other place that makes sense to you. I usually put it in
/usr/src
. Let's say we've downloaded
ezppp-1.0BX-i386.tar.gz
. First unzip the the file with:
gunzip ezppp-1.0BX-i386.tar.gz
This leaves just the tar file: ezppp-1.0BX-i386.tar
. Extract
the tar archive with the command:
tar xvf ezppp-1.0BX-i386.tar
This will extract the directory ezppp-1.0BX
, and all its
contents.
Since EzPPP comes with pre-compiled binaries for i386 machines, installation is
a simple copy of the binary to your desired location. I would suggest
/usr/X11R6/bin
. In the directory
ezppp/bin/i386-ELF-static
you will find the staticly linked version
of EzPPP. I suggest using the staticly linked version unless you know how to
deal with shared libraries.
EzPPP will connect just fine when run as root, but if you want to run EzPPP as a non-root user, there are several files and programs to make permissions changes to. There is actually more than one way to do this, so don't be surprised if you can think of another way.
EzPPP needs access to the device file your modem is on. If you use COM3,
then the modem device file you use is /dev/cua2
. To change the
permissions so that it is world read/writable:
chmod 666 /dev/cua2
The pppd daemon also makes calls to the kernel which require root permissions. The pppd daemon must be owned by root, and then have it's set-user-id bit turned on. Then the pppd daemon will always run as root. To do this, you must first find the pppd daemon (see 'Finding the pppd Daemon'). Then:
chown root.root pppd chmod +s pppd
EzPPP can add and remove entries from the /etc/resolv.conf
file
if you give it permission. If you don't, then any DNS information you enter
into EzPPP won't be used. Again, there are many ways to do this. The simplest
is to make /etc/resolv.conf
world read/writeable by:
chmod 666 /etc/resolv.conf
The pppd daemon will read options from the file /etc/ppp/options
by default. Sometimes these options can cause EzPPP to fail, because EzPPP
supplies its own options. Since there is no way of overriding the
/etc/ppp/options
file, it's best to edit it and leave it empty, but
DO NOT REMOVE IT!. If it's not there, pppd will fail!
EzPPP needs the pppd daemon to establish a PPP connection. The standard path
for the pppd daemon is /usr/sbin/pppd
. This is EzPPP's default,
and works for both the Debian and Red Hat Linux distributions. However, if you
are running Slackware96, the file /usr/sbin/pppd
is acutally a
script which executes /usr/sbin/pppd-2.1
or
/usr/sbin/pppd-2.2
depending on your kernel version. With
Slackware96, you must go to Config->General and change the path to one or the
other, depending on your kernel version. If you don't, EzPPP won't hang up
correctly.
To create a script with EzPPP, you must begin by creating a new account. Clicking on the "Login Script" tab gets you to the script editing window, pictured below.
The script above is for a simple (and very common) standard UNIX login where the PPP session begins as soon as the password is verified.
A line in a script is entered by first selecting the type of script entry from the popup box at the top of the window ("Send" in the picture above). The text entry box to the right is then used to enter the string, and the Add or Insert buttons can then be used to add to the script list.
There are five different types of script entries:
Expect: Wait until the string specified is received, then proceed to the next script entry.
Send: Send the specified string followed by a carrage-return linefeed. You can simulate hitting the Enter key by sending a blank string.
Pause: Pause for the number of seconds specified. Anything received during a pause is buffered and searched by the next "Expect" later in the script. BUG WARNING! If you type a non-numeric charactor terrible things could happen.
Hangup: Hangs up the modem.
Answer: Waits for the phone to ring, answers the phone, and waits for the modem to connect.
So let's make a simple login script. Login first by using EzPPP's terminal. Do this by depressing the 'Use Terminal Instead of Script to Connect' button above the script box. Close out the Edit and Configure windows and then connect. When the modem has connected, a terminal box will appear. You will have to click in it first before you can type. Go through your normal login sequence. When you are done, hit the 'Start PPP' to start the PPP connection. Although the terminal window will disappear, you can bring it back up by depressing the 'Debug' button on EzPPP's main screen. You can use the information in the terminal window to help you create your login script.
Let's say your ppp username is 'bob-ppp' and your password is *ugh* 'gandalf'. You see:Welcome to InternetConnect! You are caller #38472374 hal9000 login: bob-ppp password: ~^{{{{{}}~
The garbage on the last line is the PPP starting up. Hangup now.
Your script will want to first wait for the last letters you see before you type in your username, in this case "hal9000 login:". To do this you use the "Expect" type of script entry. It's best to use only one word in a Expect, and try to avoid using the first letter in a line, because some fool at the ISP might come along and decide to capitalize it. I personally use the smallest expect string I can get away with without causing a match too early. The string "ogin:"(don't type the quotes!)is a good choice for this situation. Type it in the text box and hit the add button.
Next, you must send you user name. Select "Send" from the popup box and type "bob-ppp" for the string. Hit the add button.
We now Expect the text "assword:", or "word:" would work fine.
Now Send your password "gandalf". This is the end of your script.
EzPPP then waits for for two seconds, and starts up the pppd daemon.
If you mess up and add something to the script you don't want, just highlight it and hit the "Remove" button.
Keith Brown has succeeded in establishing a PAP connection with EzPPP. This is how he did it.
I have used EzPPP to connect to a server using PAP authentication, and I would like to assure you that it is quite simple to do. In the following paragraphs, I will briefly explain the nuts and bolts of this method, and then give a step-by-step example of setting up an EzPPP connection to a PPP server using PAP.
PAP seems a lot more complicated at first glance than it really is. The server (the machine you are connecting to) basically tells the client (your machine) to authenticate using PAP. The client (pppd) looks in a specific file for an entry that contains a matching server name and client's name for this connection, and then sends the password it finds there. That's about it! Now, here's how to make that happen. I am assuming a pppd version of 2.2.0 and a standard installation of configuration files under /etc/ppp.
For the purposes of illustration, pretend that I have an Internet account with 'glob.net', under the user name 'booger', and a password of 'foobar'. First, I need to add all this to the file /etc/ppp/pap-secrets. The format of an entry for our purposes, is:
USERNAME SERVERNAME PASSWORD
so I add the line:
booger glob foobar
to the file and save it. Note: I can use any name for the server I wish as long as I use the same name in the pppd arguments, as we'll see shortly. I have shortened it to 'glob'. This name is just used to locate the correct password.
Now, I need to set up my connection in EzPPP. The basics are the same as any other connection, and I won't go into details here, except to say that you probably want to make sure that the /etc/ppp/options is empty, and you probably don't want any login script either. Now, in the settings dialog, at the bottom, is the pppd arguments button. This brings up a dialog similar to the one used for editing the login script. Here we enter values that will be sent to pppd as command line arguments, and in the case of multiple-value arguments, we need to enter each value as a separate entry in the listbox, in the correct order.
We can put any other arguments in here we want first. In addition to the default '-detach' and 'defaultroute', you might want to add 'lock'. Now we need to add arguments that pppd needs to handle PAP authentication. In this example I am going to add 'user', 'booger', 'remotename', 'glob', in that order. The user argument tells pppd what user name to look for in pap-secrets, and send to the server. The remotename is only used by pppd to match the entry in the pap-secrets file, and is not sent to the server, so once again, it can be anything I want as long as it is consistent with the entry in the pap-secrets file.
That's all there is to it. You should now be able to set up your own connection to a server with PAP authentication. CHAP should not be much different. See the Linux Network Adminstrators' Guide for chap-secrets file format and pppd arguments used. The rest should be gravy, but...your mileage, ah you know the rest.
Keith Brown ZHU ATCS, ERAU BAPA, LSMFT kbrown@pdq.net
You can customize pppd options on a account-by-account basis using the Edit default pppd Arguments button in the Edit Account window. But.... *DANGER* Every line you add is an equivalent to one, non-spaced argument which is passed to pppd. Here is an example: to set the Maximum Transmission Unit you would enter "mtu" as one argument and "296" as the NEXT argument, not "mtu 296" as one argument. If you did, the pppd daemon wouldn't recognize it and would fail.
EzPPP will give you this error message if the pppd daemon dies on its own without pressing the Disconnect button, but it can actually mean two different things. If you are connected successfully for some time, and this message pops up, then your pppd connection died, most likely a timeout from you ISP after some period of inactivity.
However, if this message comes up right away after the connection sequence, it means that your PPP connection failed to establish. Why? It could be many reasons, here are some listed below.
/etc/ppp/options
I am going to try to gather as many problems/solutions here as possible. If you have one (with solution) please send it in! It may help others.
If you can't move some windows in EzPPP, then you need to configure your
window manager to 'Decorate Transients'. Every window manager has a
configuration file. For example, if you are using FVWM 1.24 or AfterStep,
then you have to
edit your .fvwmrc or .steprc file and add the line: DecorateTransients
.
If you are running FVWM95, or FVWM2, then you add the line
DecorateTransient
to your .fvwm2rc95, or .fvwm2 file. If you don't
have any of those files in your home directory, then you are using the system
default. You will have to find the system default configuration file,
and either edit it, or copy it to your home
directory and edit it there.
I have had many problems with Netscape. Although I'm grateful that Netscape
provides a Linux binary for us, it does some things which make no sense at all,
and in this case make it harder to use with the way EzPPP creates and removes
DNS servers from /etc/resolv.conf
. Netscape has it's own DNS
resolver, which is initalized upon startup with the DNS servers found in
/etc/resolv.conf
. So, if you use EzPPP's automatic DNS server
adding/removal, you will have to start Netscape AFTER you've connected with
EzPPP, or else Netscape won't be able to find anything! So why does Netscape
have its own resolver when UNIX has a good one? It was ported from Windows
3.1!
Last modified April 29, 1997
Jay
Painter