%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                               %
%                       Legal Notice                            %
%                                                               %
% This document is copyright (C) Olaf Kirch, okir@monad.swb.de  %
%                                                               %
% For copying conditions, please refer to the file COPYING.	%
%                                                               %
% The author is not liable for any damages, direct or indirect, %
% resulting from the use of information provided in this        %
% document.                                                     %
%                                                               %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% When viewing this document with vi on an 80-columns screen,   %
% do a ':se nonumber' first.                                    %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                               %
%               S T A R T   O F   C H A P T E R                 %
%                                                               %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Serial Line IP}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\label{slip}
\index{IP!dial-up}
\index{IP!serial line}
\index{dial-up IP}
\index{telephone, sending data over}
\index{Internet!connecting to}
\index{configuring!SLIP|(}

The serial line protocols, SLIP and PPP, provide the Internet
connectivity for the poor. Apart from a modem and a serial board
equipped with a FIFO~buffer, no hardware is needed. Using it is not much
more complicated than a mailbox, and an increasing number of private
organizations offer dial-up IP at an affordable cost to everyone.


There are both SLIP and PPP drivers available for \linux. SLIP
has been there for quite a while, and works fairly reliable.
A PPP driver has been developed recently by Michael Callahan and 
Al Longyear.  It will be described in the next chapter.


\section{General Requirements}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\label{slip.general}
\index{SLIP|(}
\index{PPP}

To use SLIP or PPP, you have to configure some basic networking features
as described in the previous chapters, of course. At the least, you have
to set up the looback interface, and provide for name resolution. When
connecting to the Internet, you will of course want to use DNS.  The
simplest option is to put the address of some name server into your
\file{resolv.conf} file; this server will be queried as soon as the SLIP
link is activated. The closer this name server is to the point where you
dial in, the better.


\index{configuring!caching-only name server}
\index{configuring!DNS over SLIP/PPP}
\index{caching-only name server}
\index{name server!caching-only}
However, this solution is not optimal, because all name lookups will
still go through your SLIP/PPP link. If you worry about the bandwidth this
consumes, you can also set up a \emph{caching-only} name server.  It
doesn't really serve a domain, but only acts as a relay for all DNS
queries produced on your host. The advantage of this scheme is that it
builds up a cache, so that most queries have to be sent over the serial
line only once. A \file{named.boot} file for a caching-only server looks
like this:


\begin{tscreen}
\begin{verbatim}
; named.boot file for caching-only server
directory                            /var/named

primary       0.0.127.in-addr.arpa   db.127.0.0 ; loopback net
cache         .                      db.cache   ; root servers
\end{verbatim}
\end{tscreen}


In addition to this \file{name.boot} file, you also have to set up
the \file{db.cache} file with a valid list of root name servers.
This is described toward the end of the Resolver Configuration
chapter.


\section{SLIP Operation}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\label{slip.operation}
\index{SLIPDISC}
\index{tty!line discipline}
\index{line discipline}

Dial-up IP~servers frequently offer SLIP service through special user
accounts. After logging into such an account, you are not dropped into
the common shell; instead a program or shell script is executed that
enables the server's SLIP driver for the serial line and configures the
appropriate network interface. Then you have to do the same at your end
of the link.


On some operating systems, the SLIP driver is a user-space program;
under \linux, it is part of the kernel, which makes it a lot faster.
This requires, however, that the serial line be converted to SLIP mode
explicitly. This is done by means of a special tty line discipline,
SLIPDISC. While the tty is in normal line discipline (DISC0), it will
exchange data only with user processes, using the normal \func{read(2)}
and \func{write(2)} calls, and the SLIP driver is unable to write to or
read from the tty. In SLIPDISC, the roles are reversed: now any
user-space processes are blocked from writing to or reading from the
tty, while all data coming in on the serial port will be passed directly
to the SLIP driver.


\index{Van Jacobson header compression}
\index{compressing TCP/IP packets}
\index{Compressed Serial Line IP}
\index{CSLIP}
The SLIP driver itself understands a number of variations on the SLIP
protocol. Apart from ordinary SLIP, it also understands CSLIP, which
performs the so-called Van Jacobson header compression on outgoing
IP~packets.\footnote{
  Van Jacobson header compression is described in RFC~1441.
} This improves throughput for interactive sessions noticeably.
Additionally, there are six-bit versions for each of these protocols.


\index{slattach@\prog{slattach}}
A simple way to convert a serial line to SLIP mode is by using the
\prog{slattach} tool. Assume you have your modem on \file{/dev/cua3},
and have logged into the SLIP server successfully. You will then
execute:


\begin{tscreen}
 \# slattach /dev/cua3 \&
\end{tscreen}


This will switch the line discipline of \file{cua3} to SLIPDISC, and
attach it to one of the SLIP network interfaces. If this is your first
active SLIP link, the line will be attached to \file{sl0}; the second
would be attached to \file{sl1}, and so on. The current kernels support
up to eight simultaneous SLIP links.


\index{CSLIP}
The default encapsulation chosen by \prog{slattach} is CSLIP.  You may
choose any other mode using the \option{-p} switch.  To use normal SLIP
(no compression), you would use


\begin{tscreen}
 \# slattach -p slip /dev/cua3 \&
\end{tscreen}


Other modes are \option{cslip}, \option{slip6}, \option{cslip6} (for the
six-bit version of SLIP), and \option{adaptive} for adaptive SLIP.  The
latter leaves it to the kernel to find out which type of SLIP
encapsulation the remote end uses.


Note that you must use the same encapsulation as your peer does.  For
example, if \host{cowslip} uses CSLIP, you have to do so, too.  The
symptoms of a mismatch will be that a \prog{ping} to the remote host
will not receive any packets back.  If the other host \prog{ping}s you,
you may also see messages like ``\term{Can't build ICMP header}'' on
your console. One way to avoid these difficulties is to use 
adaptive SLIP.


In fact, \prog{slattach} does not only allow you to enable
SLIP, but other protocols that use the serial line as well,
like PPP or KISS (another protocol used by ham radio people).
For details, please refer to the \file{slattach(8)} manual page.


After turning over the line to the SLIP driver, you have to configure
the network interface. Again, we do this using the standard
\prog{ifconfig} and \prog{route} commands. Assume that from
\host{vlager}, we have dialed up a server named \host{cowslip}. You
would then execute


\begin{tscreen}
\begin{verbatim}
# ifconfig sl0 vlager pointopoint cowslip
# route add cowslip
# route add default gw cowslip
\end{verbatim}
\end{tscreen}


The first command configures the interface as a point-to-point link to
\host{cowslip}, while the second and third add the route to
\host{cowslip} and the default route using \host{cowslip} as a gateway.


When taking down the SLIP link, you first have to remove all routes
through \host{cowslip} using \prog{route} with the \option{del} option,
take the interface down, and send \prog{slattach} the hangup signal.
Afterwards you have to hang up the modem using your terminal program
again:


\begin{tscreen}
\begin{verbatim}
# route del default
# route del cowslip
# ifconfig sl0 down
# kill -HUP 516
\end{verbatim}
\end{tscreen}



\section{Using \prog{dip}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\label{slip.dip}
\def\dipvar#1{\keyword{\${#1}}}
\index{configuring!dip@\prog{dip}}
\index{dip@\prog{dip}|(}

Now, that was rather simple. Nevertheless, you might want to automate
the above steps so that you only have to invoke a simple command that
performs all steps shown above. This is what \prog{dip} is
for.\footnote{
  \prog{dip} means \emph{Dialup IP}. It was written by Fred van~Kempen.
} The current release as of this writing is version~3.3.7. It has been
patched very heavily by a number of people, so that you can't speak of
\emph{the} \prog{dip} program anymore. These different strains of
development will hopefully be merged in a future release.


\prog{dip} provides an interpreter for a simple scripting language that
can handle the modem for you, convert the line to SLIP mode, and
configure the interfaces.  This is rather primitive and restrictive, but
sufficient for most cases. A new release of \prog{dip} may feature a
more versatile language one day.


\index{SLIP!let users initiate}
\index{access!granting}
\index{security!SLIP}
To be able to configure the SLIP interface, \prog{dip} requires root
privilege. It would now be tempting to make \prog{dip} setuid to
\user{root}, so that all users can dial up some SLIP server without
having to give them root access. This is very dangerous, because setting
up bogus interfaces and default routes with \prog{dip} may disrupt
routing on your network badly.  Even worse, this will give your users
the power to connect to \emph{any} SLIP server, and launch dangerous
attacks on your network. So if you want to allow your users to fire up a
SLIP connection, write small wrapper programs for each prospective SLIP
server, and have these wrappers invoke \prog{dip} with the specific
script that establishes the connection. These programs can then safely
be made setuid \user{root}.\footnote{
  \prog{diplogin} can (and must) be run setuid, too. See the section
  at the end of this chapter.
}


\subsection{A Sample Script}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\label{slip.dip.sample}

\begin{figure}[p]
\small
\begin{verbatim}
 # Sample dip script for dialing up cowslip

 # Set local and remote name and address
 get $local vlager
 get $remote cowslip

 port cua3                # choose a serial port
 speed 38400              # set speed to max
 modem HAYES              # set modem type
 reset                    # reset modem and tty
 flush                    # flush out modem response

 # Prepare for dialing.
 send ATQ0V1E1X1\r
 wait OK 2
 if $errlvl != 0 goto error
 dial 41988
 if $errlvl != 0 goto error
 wait CONNECT 60
 if $errlvl != 0 goto error

 # Okay, we're connected now
 sleep 3
 send \r\n\r\n
 wait ogin: 10
 if $errlvl != 0 goto error
 send Svlager\n
 wait ssword: 5
 if $errlvl != 0 goto error
 send hey-jude\n
 wait running 30
 if $errlvl != 0 goto error

 # We have logged in, and the remote side is firing up SLIP.
 print Connected to $remote with address $rmtip
 default                  # Make this link our default route
 mode SLIP                # We go to SLIP mode, too
 # fall through in case of error

error:
 print SLIP to $remote failed.
\end{verbatim}
\caption{
 \label{slip.fig.script}
 A sample \prog{dip} script
}
\end{figure}


A sample script is produced in figure~\ref{slip.fig.script}. It can be
used to connect to \host{cowslip} by invoking \prog{dip} with the script
name as argument:


\begin{tscreen}
\begin{verbatim}
# dip cowslip.dip
DIP: Dialup IP Protocol Driver version 3.3.7 (12/13/93)
Written by Fred N. van Kempen, MicroWalt Corporation.

connected to cowslip.moo.com with addr 193.174.7.129
#
\end{verbatim}
\end{tscreen}


After connecting to \host{cowslip} and enabling SLIP, \prog{dip} will
detach from the terminal and go to the background. You can then start
using the normal networking services on the SLIP link. To terminate the
connection, simply invoke \host{dip} with the \option{-k} option. This
sends a hangup signal to \prog{dip} process, using the process id
\prog{dip} records in \file{/etc/dip.pid}:\footnote{
 See the newsgroup \ngrp{alt.tla} for more palindromic fun with
 three-letter acronyms.
}


\begin{tscreen}
\begin{verbatim}
# kill -k
\end{verbatim}
\end{tscreen}


In \prog{dip}'s scripting language, keywords prefixed with a dollar
symbol denote variable names.  \prog{dip} has a predefined set of
variables which will be listed below.  \dipvar{remote} and
\dipvar{local}, for instance, contain the hostnames of the local and
remote host involved in the SLIP link.


The first two statements in the sample script are \prog{get} commands,
which is \prog{dip}'s way to set a variable. Here, the local and remote
hostname are set to \host{vlager} and \host{cowslip}, respectively.


\index{chat!SLIP}
The next five statements set up the terminal line and the modem.  The
\keyword{reset} sends a reset string to the modem; for Hayes-compatible
modems, this is the \keyword{ATZ} command.  The next statement flushes
out the modem response, so that the login chat in the next few lines
will work properly. This chat is pretty straight-forward: it simply
dials 41988, the phone number of \host{cowslip}, and logs into the
account \keyword{Svlager} using the password \keyword{hey-jude}. The
\keyword{wait} command makes \prog{dip} wait for the string given as its
first argument; the number given as second argument make the wait time
out after that many seconds if no such string is received.  The
\keyword{if} commands interspersed in the login procedure check that no
error has occurred while executing the command.


The final commands executed after logging in are \keyword{default},
which makes the SLIP link the default route to all hosts, and
\keyword{mode}, which enables SLIP mode on the line and configures the
interface and routing table for you.


\subsection{A \prog{dip} Reference}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\label{slip.dip.reference}
Although widely used, \prog{dip} hasn't been very well documented yet.
In this section, we will therefore give a reference for most of
\prog{dip}'s commands. You can get an overview of all commands it
provides by invoking \prog{dip} in test mode, and entering the
\prog{help} command. To find out about the syntax of a command, you may
enter it without any arguments; of course this does not work with
commands that take no arguments.


\begin{tscreen}
\begin{verbatim}
$ dip -t
DIP: Dialup IP Protocol Driver version 3.3.7 (12/13/93)
Written by Fred N. van Kempen, MicroWalt Corporation.

DIP> help
DIP knows about the following commands:

	databits default  dial     echo     flush    
	get      goto     help     if       init     
	mode     modem    parity   print    port     
	reset    send     sleep    speed    stopbits 
	term     wait     

DIP> echo
Usage: echo on|off
DIP> _
\end{verbatim}
\end{tscreen}


Throughout the following, examples that display the \term{DIP$>$}
prompt show how to enter a command in test mode, and what output
it produces. Examples lacking this prompt should be taken as
script excerpts.


\subsubsection{The Modem Commands}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
There is a number of commands \prog{dip} provides to configure your
serial line and modem. Some of these are obvious, such as
\keyword{port}, which selects a serial port, and \keyword{speed},
\keyword{databits}, \keyword{stopbits}, and \keyword{parity}, which set
the common line parameters.


The \keyword{modem} command selects a modem type. Currently, the
only type supported is \keyword{HAYES} (capitalization required).
You have to provide \prog{dip} with a modem type, else it will
refuse to execute the \keyword{dial} and \keyword{reset} commands.
The \keyword{reset} command sends a reset string to the modem;
the string used depends on the modem type selected. For
Hayes-compatible modems, this is \keyword{ATZ}.


The \keyword{flush} code can be used to flush out all responses
the modem has sent so far. Otherwise a chat script following the
\keyword{reset} might be confused, because it reads the \keyword{OK}
responses from earlier commands.


The \keyword{init} command selects an initialization string to be passed
to the modem before dialling. The default for Hayes modems is
``\keyword{ATE0 Q0 V1 X1}'', which turns on echoing of commands and long
result codes, and selects blind dialing (no checking of dial tone).


The \keyword{dial} command finally sends the initialization string to
the modem and dials up the remote system. The default dial command for
Hayes modems is \keyword{ATD}.


\subsubsection{\keyword{echo} and \keyword{term}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The \keyword{echo} command serves as a debugging aid, in that using
\keyword{echo on} makes \prog{dip} echo to the console everything sends
to the serial device. This can be turned off again by calling
\keyword{echo off}.


\prog{dip} also allows you to leave script mode temporarily and
enter terminal mode. In this mode, you can use \prog{dip} just
like any ordinary terminal program, writing to the serial line
and reading from it. To leave this mode, enter \key{Ctrl-]}.


\subsubsection{The \keyword{get} Command}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The \keyword{get} command is \prog{dip}'s way of setting a variable.
The simplest form is to set a variable to a constant, as used
throughout the above example. You may, however, also prompt the
user for input by specifying the keyword \keyword{ask} instead
of a value:


\begin{tscreen}
\begin{verbatim}
DIP> get $local ask
Enter the value for $local: _
\end{verbatim}
\end{tscreen}


A third method is to try to obtain the value from the remote host.
Bizarre as it seems first, this is very useful in some cases:
Some SLIP servers will not allow you to use your own IP~address on the
SLIP link, but will rather assign you one from a pool of addresses
whenever you dial in, printing some message that informs you about
the address you have been assigned. If the message looks something
like this ``\term{Your address: 193.174.7.202}'', then the following
piece of \prog{dip} code would let you pick up the address:


\begin{tscreen}
\begin{verbatim}
... login chat ....
wait address: 10
get $locip remote
\end{verbatim}
\end{tscreen}


\subsubsection{The \keyword{print} Command}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This is the command to echo text to the console \prog{dip}
was started from. Any of \prog{dip}'s variables may be used in
print commands, such as


\begin{tscreen}
\begin{verbatim}
DIP> print Using port $port at speed $speed
Using port cua3 at speed 38400
\end{verbatim}
\end{tscreen}


\subsubsection{Variable Names}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\prog{dip} only understands a predefined set of variables. A
variable name always begins with a dollar symbol and must be
written in lower-case letters.


The \dipvar{local} and \dipvar{locip} variables contain
the local host's name and IP~address. Setting the hostname makes
\prog{dip} store the canonical hostname in \dipvar{local},
at the same time assigning \dipvar{locip} the corresponding
IP~address. The analogous thing happens when setting the 
\dipvar{locip}.


The \dipvar{remote} and \dipvar{rmtip} variables do the same for
the remote host's name and address.  \dipvar{mtu} contains the MTU
value for the connection.


These five variables are the only ones that may be assigned values
directly using the \keyword{get} command. A host of other variables can
only be set through corresponding commands, but may be used
\keyword{print} statements; these are \dipvar{modem}, \dipvar{port},
and \dipvar{speed}.


\dipvar{errlvl} is the variable through which you can access the
result of the last command executed. An error level of 0 indicates
success, while a non-zero value denotes an error.



\subsubsection{The \keyword{if} and \keyword{goto} Commands}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The \keyword{if} command is rather a conditional branch than
what one usually calls an if. Its syntax is

\begin{tscreen}
 if \var{var} \var{op} \var{number} goto \var{label}
\end{tscreen}

\noindent
where the expression must be a simple comparison between one of the
variables \dipvar{errlvl}, \dipvar{locip}, and \dipvar{rmtip}.
The second operand must be an integer number; the operator \var{op} may
be one of \verb|==|, \verb|!=|, \verb|<|, \verb|>|, \verb|<=|, and
\verb|>=|.


The \keyword{goto} command makes the execution of the script continue at
the line following that bearing the label. A label must occur as the very
first token on the line, and must be followed immediately by a colon.



\subsubsection{\keyword{send}, \keyword{wait} and \keyword{sleep}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
These commands help implement simple chat scripts in \prog{dip}.
\keyword{send} outputs its arguments to the serial line. It does not
support variables, but understands all C-style backslash character
sequences such as \keyword{\bs n} and \keyword{\bs b}.  The tilde
character (\keyword{\tld}) is used as an abbreviation for carriage
return/newline.


\keyword{wait} takes a word as an argument, and scans all input
on the serial line until it recognizes this word. The word itself
may not contain any blanks. Optionally, you may give \keyword{wait}
a timeout value as second argument; if the expected word is not
received within that many seconds, the command will return
with an \dipvar{errlvl} value of one.


The \keyword{sleep} statement may be used to wait for a certain amount
of time, for instance to patiently wait for any login sequence
to complete. Again, the interval is specified in seconds.


\subsubsection{\keyword{mode} and \keyword{default}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
These commands are used to flip the serial line to SLIP mode
and configure the interface. 

The \keyword{mode} command is the last command executed by \prog{dip}
before gong into daemon mode. Unless an error occurs, the command
does not return.


\keyword{mode} takes a protocol name as argument. \prog{dip}
currently recognizes \keyword{SLIP} and \keyword{CSLIP} as
valid names. The current version of \prog{dip} does not understand
adaptive SLIP, however.

After enabling SLIP mode on the serial line, \prog{dip} executes
\prog{ifconfig} to configure the interface as a point-to-point link, and
invokes \prog{route} to set the route to the remote host.


If, in addition, the script executes the \keyword{default} command
before \keyword{mode}, \prog{dip} will also make the default
route point to the SLIP link.


\section{Running in Server Mode}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\label{slip.server}
\index{diplogin@\prog{diplogin}}
\index{configuring!SLIP server}

Setting up your SLIP client was the hard part. Doing the opposite,
namely configuring your host to act as a SLIP server, is much easier.


One way to do this is to to use \prog{dip} in server mode, which can
be achieved by invoking it as \prog{diplogin}. Its main configuration
file is \file{/etc/diphosts}, which associates login names with the
address this host is assigned.  Alternatively, you can also use
\prog{sliplogin}, a BSD-derived tool that features a more flexible
configuration scheme that lets you execute shell scripts whenever a
host connects and disconnects. It is currently at Beta.


\index{Dent, Arthur}
Both programs require that you set up one login account per SLIP
client. For instance, assume you provide SLIP service to Arthur Dent
at \host{dent.beta.com}, you might create an account named \user{dent}
by adding the following line to your \file{passwd} file:


\begin{tscreen}
\begin{verbatim}
dent:*:501:60:Arthur Dent's SLIP account:/tmp:/usr/sbin/diplogin
\end{verbatim}
\end{tscreen}


\noindent
Afterwards, you would set \user{dent}'s password using the
\prog{passwd} utility.


\index{diphosts@\file{diphosts}}
Now, when \user{dent} logs in, \prog{dip} will start up as a server.
To find out if he is indeed permitted to use SLIP, it will look
up the user name in \file{/etc/diphosts}. This file details the access
rights and connection parameter for each SLIP user. A sample entry for
\user{dent} could look like this:


\begin{tscreen}
 dent::dent.beta.com:Arthur Dent:SLIP,296
\end{tscreen}

\index{CSLIP}
The first of the colon-separated fields is the name the user
must log in as. The second field may contain an additional
password (see below). The third is the hostname or IP~address
of the calling host. Next comes an informational field without
any special meaning (yet). The last field describes the connection
parameters. This is a comma-separated list specifying the
protocol (currently one of \keyword{SLIP} or \keyword{CSLIP}),
followed by the MTU.


When \user{dent} logs in, \prog{diplogin} extracts the information on
him from the \file{diphosts} file, and, if the second field is not
empty, prompts for an ``external security password''. The string
entered by the user is compared to the (unencrypted) password from
\file{diphosts}. If they do not match, the login attempt is rejected.


Otherwise, \prog{diplogin} proceeds by flipping the serial line to CSLIP
or SLIP mode, and sets up the interface and route. This connection
remains established until the user disconnects and the modem drops the
line. \prog{diplogin} will then return the line to normal line
discipline, and exit.


\index{access!granting}
\index{security}
\prog{diplogin} requires super-user privilege.  If you don't have
\prog{dip} running setuid \user{root}, you should make \prog{diplogin} a
separate copy of \prog{dip} instead of a simple link. \prog{diplogin}
can then safely be made setuid, without affecting the status of
\prog{dip} itself.

\index{dip@\prog{dip}|)}
\index{configuring!SLIP|)}
\index{SLIP|)}
