                             ASSIGNING IP ADDRESSES
                              PORTSLAVE 2001.10.28

                                    Sections
                                    ========

Below are the sections of this document:

	- Compiling
	- Overview
	- IP Assignment
	- PPPD Settings
	- Radius Settings
	- Portslave Settings
	- Client IP Assignment
	- Common Configurations
	- NOTES

                                    Compiling
                                    =========

This is not a standard feature of Portslave (yet).  You have to give
"./configure" the parameter "--enable-assignment", this will result in the
C macros PORTSLAVE_CLIENT_IP_RULES and ALLOW_NO_LOCAL_IP being defined.
PORTSLAVE_CLIENT_IP_RULES enables the client IP address selection and
ALLOW_NO_LOCAL_IP allows the use of no local IP address.


                                    Overview
                                    ========

There are several sources used to assign IP addresses with portslave pppd:

	1. PPPD Command line
	2. File, /etc/ppp/options
	3. File, /etc/ppp/options.<ttyname>
	4. File, ~/.ppprc
	5. Radius server
	6. Portslave configuration file, /etc/portslave/pslave.conf
	7. Client selection

Each of these sources has its own method of setting the IP addresses and
indicating when the address is not assigned.  In addition, there are rules
which determine from which source an IP address will be assigned.

This file describes these rules and gives examples of common configurations.


                                 IP Assignment
                                 =============

The order of precedence for the assignment of IP addresses is shown below.  The
first of these locations that contains an IP address assignment sets the IP
address.  Note that the local and remote IP addresses can be assigned
independent of each other even though both use the same rules.

	1. Client selection *
	2. Radius server
	3. /etc/portslave/pslave.conf
	4. Command line
	5. ~/.ppprc
	6. /etc/ppp/options
	7. /etc/ppp/options.<ttyname>

* This has not been fully verified but has been seen in testing.


                                 PPPD Settings
                                 =============

For the command line, options, options.<ttyname>, and .ppprc locations, the
IP addresses can be assigned using the <local-address>:<remote-address> format.
In order to indicate that either address is not assigned, simply exclude it
from the argument.  If neither is assigned, the entire address specifier can be
excluded.

Note that excluding the address from the specifier will not undo a previous
assignment nor prevent a future assignment.  So, for example, if the value
"192.168.1.1:" resides in the options file, an entry of "10.3.0.1:10.4.0.2"
on the command line will still set the remote IP address to 10.4.0.2.
Likewise, with the entry of "192.168.1.1:" in the options file and an entry of
"10.3.0.1:10.4.0.2" in the options.<ttyname> file will yield a remote IP
address of 10.4.0.2.


                                Radius Settings
                                ===============

There are different radius implementations, each of which has its own method
of setting the various attributes.  Here are the attributes which may be used
to assign IP addresses:

	ATTRIBUTE		MEANING
	----------------------	---------------------------------------------
	 8 Framed IP Address	Remote IP Address
	 9 Framed IP Netmask	Remote IP Netmask
	14 Login IP Host	Remote IP Address

Any attribute which is not supplied by the radius server to the portslave
radius client is left unassigned.  In addition, setting an IP Address to
255.255.255.255 will also indicate that it is unassigned.


                               Portslave Settings
                               ==================

Below are the settings in the pslave.conf file which affect the IP Address
assignment.

	all.loc_host	- Sets the local IP Address of the server.  Set to
			  255.255.255.255 in order to indicate that the local
			  IP Address is unassigned.
	all.rem_host	- Sets the remote IP Address of all ports.  Set to
			  255.255.255.255 in order to indicate that the remote
			  IP Address is unassigned.
	s<port>.rem_host -Sets the remote IP Address of the specified port.
	                  Set to 255.255.255.255 in order to indicate that the
			  remote IP Address is unassigned.

NOTE: if both all.rem_host and s<port>.rem_host reside in the configuration
      file, the s<port>.rem_host setting is the one that will be used.


                              Client IP Assignment
                              ====================

Allowing the client to assign the IP address even when the raduis server is
used involves the following additional settings in pslave.conf:

	all.valid_ip	- A list of strings which indicate the valid IP
			  addresses which can be selected by a client.  The
			  format of the strings matches the IP address field
			  of the pap-secrets file.

	s<port>.valid_ip
			- Same as all.valid_ip but only affects one port.


                             Common Configurations
                             =====================

Below are some common configurations for remote IP address assignment and
settings that will support each configuration.

	1. Assign remote IP address on the radius server
	2. Assign remote IP address in options file
	3. Assign remote IP address in pslave.conf file
	4. Assign remote IP address in options.<ttyname> file
	5. Allow client to select the remote IP address

Here are the sample settings for each configuration:

	1. Assign remote IP address on the radius server:

		/etc/ppp/options
			- Exclude entry.
		/etc/ppp/options.<ttyname>
			- Exclude entry.
		~/.ppprc
			- Exclude entry.
		/etc/portslave/pslave.conf
			- Include entry "all.rem_host 255.255.255.255", or the
			  s<port>.rem_host equivalent; for example:
			  "s0.rem_host 255.255.255.255".
		Command Line
			- Exclude setting.
		Radius Server
			- Assign IP address.
		Client
			- Exclude setting.

	2. Assign remote IP address in options file:

		/etc/ppp/options
			- Include entry such as ":192.168.1.1"
		/etc/ppp/options.<ttyname>
			- Exclude entry.
		~/.ppprc
			- Exclude entry.
		/etc/portslave/pslave.conf
			- Include entry "all.rem_host 255.255.255.255", or the
			  s<port>.rem_host equivalent; for example:
			  "s0.rem_host 255.255.255.255".
		Command Line
			- Exclude setting.
		Radius Server
			- Exclude setting or assign "255.255.255.255".
		Client
			- Exclude setting.


	3. Assign remote IP address in pslave.conf file:

		/etc/ppp/options
			- Exclude entry.
		/etc/ppp/options.<ttyname>
			- Exclude entry.
		~/.ppprc
			- Exclude entry.
		/etc/portslave/pslave.conf
			- Include entry "all.rem_host 192.168.2.1", or the
			  s<port>.rem_host equivalent; for example:
			  "s0.rem_host 192.168.2.1".
		Command Line
			- Exclude setting.
		Radius Server
			- Exclude setting or assign "0.0.0.0".
		Client
			- Exclude setting.

	4. Assign remote IP address in options.<ttyname> file:

		/etc/ppp/options
			- Exclude entry.
		/etc/ppp/options.<ttyname>
			- Include entry such as ":192.168.1.1"
		~/.ppprc
			- Exclude entry.
		/etc/portslave/pslave.conf
			- Include entry "all.rem_host 255.255.255.255", or the
			  s<port>.rem_host equivalent; for example:
			  "s0.rem_host 255.255.255.255".
		Command Line
			- Exclude setting.
		Radius Server
			- Exclude setting or assign "255.255.255.255".
		Client
			- Exclude setting.

	5. Allow client to assign remote IP address:

		/etc/ppp/options
			- Exclude entry.
		/etc/ppp/options.<ttyname>
			- Exclude entry.
		~/.ppprc
			- Exclude entry.
		/etc/portslave/pslave.conf
			- Include entry "all.rem_host 255.255.255.255", or the
			  s<port>.rem_host equivalent; for example:
			  "s0.rem_host 255.255.255.255".  Also, include the
			  entry "all.valid_ip <ipno>" or the s<port>.valid_ip
			  equivalent.  Note that <ipno> in this case is any
			  string accepted in the IP address field of the
			  pap-secrets file.
		Command Line
			- Exclude setting.
		Radius Server
			- Exclude setting or assign "255.255.255.255".
		Client
			- Exclude setting.


                                     NOTES
                                     =====

- This file is based on Portslave distribution 2001.10.28.

- Modifications were made to the base distribution to enable some of the
  functionality described in this file.

- A large number of combinations of configurations exists because of the
  number of locations that can be used to hold settings.  Putting most of the
  settings into a single location, such as the pslave.conf file, helps to
  reduce the complexity and confusion.  In addition, because of the number of
  combinations is large, it is difficult to verify that each one operates as
  expected.
