Installing and Administering PPP

42 Chapter 2
Setting Up PPP Connections
Additional Information
IP Addresses on the pppd Command Line
Soft Addresses
If an IP address is input on the pppd command line, the address is
offered during IPCP negotiations. However, at connection time, some
terminal servers and other peers wish to assign an address for the host
running PPP to use for the duration of the connection. To direct PPP to
allow assignment of an address that is different from the one on the
pppd command line, use a tilde (~) after the local IP address. For
example:
pppd ‘hostname‘˜:192.0.2.5 auto idle 300
Because SLIP does not perform any IPCP negotiations, the tilde option
will not function if the SLIP option is specified. See Chapter 4 for more
information.
Dynamic Address Assignment
When an answering pppd is invoked in the Login script, it is told a pair
of IP addresses on the command line. In the Login script, use one of the
following means to decide what IP addresses are put on the command
line:
look up the addresses in a file or a database
calculate the addresses algorithmically based on the incoming
connection's user name or other distinguishing feature
invoke a program to ask a BOOTP server
The pppd command line arguments provide the mechanism; your Login
script provides the policy.
Address Selected From a Small List
The following is an example Login script that uses the tty name to
guarantee uniqueness of the addresses it assigns. This works fine for a
small installation with few modem server serial ports and a fairly static
configuration.
#!/bin/sh
TTY=‘tty‘
case $TTY in
/dev/tty1)
IP=192.0.2.1
;;
/dev/tty2)