Previous Next Contents

7. Configuring your Linux Kernel

In order to use PPP, your Linux kernel must be compiled to include PPP support. Obtain the Linux source code for your kernel if you do not already have this - it belongs in /usr/src/linux on Linux's standard file system.

Check out this directory - many Linux distributions install the source tree (the files and subdirectories) as part of their installation process.

At bootup, your Linux kernel prints out a great deal of information. Amongst this is information about PPP support if the kernel includes this. To view this information, look at your syslog file or use dmesg | less to display the information to the screen. If your kernel includes PPP support, you will see lines like

PPP Dynamic channel allocation code copyright 1995 Caldera, Inc.
PPP line discipline registered.

(this is for the Linux 2.0.x kernel series).

Linux kernel sources can be obtained by ftp from or its mirror sites.

7.1 Installing the Linux Kernel source

The following are brief instructions for obtaining and installing the Linux kernel sources. Full information can be obtained from The Linux Kernel HOWTO.

In order to install and compile the Linux kernel, you need to be logged in as root.

  1. Change directory to the /usr/src directory
    cd /usr/src
  2. Check in /usr/src/linux to see if you already have the sources installed.
  3. If you don't have the sources, get them from Linux kernel source directory or your nearest mirror.
    If you are looking for earlier versions of the kernel (such as 1.2.X), these are kept in Old Linux kernel source directory.
  4. Choose the appropriate kernel - usually the most recent one available is what you are looking for. Retrieve this and put the source tar file in /usr/src.
    Note: a 'tar' file is an archive - possibly compressed (as are the Linux kernel source tar files) containing many files in a number of directories. It is the Linux equivalent of a DOS multi-directory zip file.
  5. If you already have the Linux sources installed but are upgrading to a new kernel, you must remove the old sources. Use the command
    rm -rf /usr/src/linux
  6. Now uncompress and extract the sources using the command
    tar xzf linux-2.0.XX.tar.gz
  7. Now, cd /usr/src/linux and read the README file. This contains an excellent explanation of how to go about configuring and compiling a new kernel. Read this file (it's a good idea to print it out and have a copy handy whilst you are compiling until you have done this enough times to know your way around).

7.2 Knowing your hardware

You MUST know what cards/devices you have inside your PC if you are going to recompile your kernel!!! For some devices (such as sound cards) you will also need to know various settings (such as IRQ's, I/O addresses and such).

7.3 Kernel compilation - the Linux 1.2.13 kernel

To start the configuration process, follow the instructions in the README file to properly install the sources. You start the kernel configuration process with

make config

In order to use PPP, you must configure the kernel to include PPP support (PPP requires BOTH pppd AND kernel support for PPP).

  PPP (point-to-point) support (CONFIG_PPP) [n] y

Answer the other make config questions according to the hardware in your PC and the features of the Linux operating system you want. Then continue to follow the README to compile and install your new kernel.

The 1.2.13 kernel creates only 4 PPP devices. For multi- port serial cards, you will need to edit the kernel PPP sources to obtain more ports. (See the README.linux file that comes as part of the PPP-2.1.2 distribution for full details of the simple edits you need to make).

Note: the 1.2.13 configuration dialogue does NOT allow you to go backwards - so if you make a mistake in answering one of the questions in the make config dialogue, exit by typing CTRL C and start again.

7.4 Kernel compilation - the Linux 1.3.x and 2.0.x kernels

For Linux 1.3.x and 2.0.x, you can use a similar process as for Linux 1.2.13. Again, follow the instructions in the README file to properly install the sources. You start the kernel configuration process with

make config

However, you also have the choice of

make menuconfig

This provides a menu based configuration system with online help that allows you to move backwards and forwards in the configuration process.

There is also a highly recommended X windows based configuration interface

make xconfig

You can compile PPP support directly into your kernel or as a loadable module.

If you only use PPP some of the time that your Linux machine is operating, then compiling PPP support as a loadable module is recommended. Using 'kerneld', your kernel will automatically load the module(s) required to provide PPP support when you start your PPP link process. This saves valuable memory space: no part of the kernel can be swapped out of memory, but loadable modules are automatically removed if they are not in use.

To do this, you need to enable loadable module support:-

        Enable loadable module support (CONFIG_MODULES) [Y/n/?] y

To add PPP kernel support, answer the following question:-

        PPP (point-to-point) support (CONFIG_PPP) [M/n/y/?]  

For a PPP loadable module, answer M, otherwise for PPP compiled in as part of the kernel, answer Y.

Unlike kernel 1.2.13, kernel 2.0.x creates PPP devices on the fly as needed and it is not necessary to hack the sources to increase available PPP device numbers at all.

7.5 Note on PPP-2.2 and /proc/net/dev

If you are using PPP-2.2, you will find that a side effect of the 'on the fly' creation of the PPP devices is that no devices show up if you look in the /proc/net file system until a device is created by starting up pppd:-

[hartr@archenland hartr]$ cat /proc/net/dev
Inter-|   Receive                  |  Transmit
 face |packets errs drop fifo frame|packets errs drop fifo colls carrier
    lo:  92792    0    0    0    0    92792    0    0    0     0    0
  eth0: 621737   13   13    0   23   501621    0    0    0  1309    0

Once you have one (or more) ppp services started, you will see entries such as this (from a ppp server):-

[root@kepler /root]# cat /proc/net/dev
Inter-|   Receive                  |  Transmit
 face |packets errs drop fifo frame|packets errs drop fifo colls carrier
    lo: 428021    0    0    0    0   428021    0    0    0     0    0
  eth0:4788257  648  648  319  650  1423836    0    0    0  4623    5
  ppp0:   2103    3    3    0    0     2017    0    0    0     0    0
  ppp1:  10008    0    0    0    0     8782    0    0    0     0    0
  ppp2:    305    0    0    0    0      297    0    0    0     0    0
  ppp3:   6720    7    7    0    0     7498    0    0    0     0    0
  ppp4: 118231  725  725    0    0   117791    0    0    0     0    0
  ppp5:  38915    5    5    0    0    28309    0    0    0     0    0

7.6 General kernel config considerations for PPP

If you are setting up your Linux PC as a PPP server, you must compile in IP forwarding support. This is also necessary if you want to use Linux to link to LANs together or your LAN to the Internet.

If you are linking a LAN to the Internet (or linking together two LANs), you should be concerned about security. Adding support for IP fire walls to the kernel is probably a MUST!

You will also need this if you want to use IP masquerade to connect a LAN that uses any of the above mentioned 'unconnected' IP network numbers.

To enable IP Masquerade and IP fire walling, you MUST answer yes to the first question in the make config process:-

Prompt for development and/or incomplete code/drivers (CONFIG_EXPERIMENTAL)?

Whilst this may sound a bit off-putting to new users, many users are actively using the IP Masquerade and IP fire walling features of the Linux 2.0.XX kernel with no problems.

Once you have installed and rebooted your new kernel, you can start configuring and testing your PPP link(s).

Previous Next Contents