PPP - Pedantic PPP Primer : Configuring the PPP Dial-Out Connection : Create your own PPP configuration files : The '/etc/ppp/ppp.linkup' file
Previous: The '/etc/ppp/ppp.conf' file
Next: IP Aliasing

4.2.2. The '/etc/ppp/ppp.linkup' file

The other file needed to complete the PPP configuration is found in '/etc/ppp/ppp.linkup'. This file contains instructions for the PPP program on what actions to take after a dial-up link is established.

In the case of dial-on-demand configurations the PPP program will need to delete the default route that was created to the fake IP address of the remote side (127.2.2.2 in our example in the previous section) and install a new default route that points the actual IP address of the remote end (discovered during the dial-up connection setup).

A representative '/etc/ppp/ppp.linkup' file: <hr>

#########################################################################
# PPP Link Up File ('/etc/ppp/ppp.linkup')
#
#  This file is checked after PPP establishes a network connection.
# 
#  This file is searched in the following order.
#
#  1) First, the IP address assigned to us is searched and
#     the associated command(s) are executed.
#
#  2) If the IP Address is not found, then the label name specified at 
#     PPP startup time is searched and the associated command(s) 
#     are executed.
#
#  3) If neither of the above are found then commands under the label
#     'MYADDR:' are executed.
#
#########################################################################
#
# This section is used for the "demand" configuration in
#   /etc/ppp/ppp.conf:
demand:
 delete ALL
 add 0 0 HISADDR
#
# All other configurations in /etc/ppp/ppp.conf use this:
#
MYADDR:
 add 0 0 HISADDR
########################################################################
# End of /etc/ppp/ppp.linkup
<hr> Notice that there is a section in this file named "demand:", identical to the configuration name used in the '/etc/ppp/ppp.conf' file. This section instructs the PPP program that once a link is established using this configuration, it must:
  1. Remove any IP routing information that the PPP program has created
  2. Add a default route the remote end's actual address.

It's critical that those configurations in '/etc/ppp/ppp.conf' which include the 'set ifaddr' and 'add 0 0' statements (i.e.: those configurations used for Dial-on-Demand configurations) execute the "delete ALL" and "add 0 0 HISADDR" commands in /etc/ppp/ppp.linkup.

This is the mechanism that controls the actual on-demand configuration of the link.

All configurations not explicitly named in /etc/ppp/ppp.linkup will use whatever commands are in the "MYADDR:" section of the file. This is where non-Demand-Dial configurations (such as our "interactive:" sample) will fall through to. This section simply adds a default route to the ISP's IP address (at the remote end).


PPP - Pedantic PPP Primer : Configuring the PPP Dial-Out Connection : Create your own PPP configuration files : The '/etc/ppp/ppp.linkup' file
Previous: The '/etc/ppp/ppp.conf' file
Next: IP Aliasing