Configuring the kernel.

# 7 Configuring the kernel.

Contents of this section

Before you can use any of the network tools, or configure any network devices, you must ensure that your kernel has the necessary network support built into it. The best way of doing this is to compile your own, selecting which options you want and which you don't.

Assuming you have obtained and untarred the kernel source already, and applied any patches that you might need to have applied to get any nonstandard or developmental software installed, all you have to do is edit `/usr/src/linux/drivers/net/CONFIG`. This file has many comments to guide you in editing it,and in general you will need to edit very little, as it has sensible defaults. In my case I don't need to edit it at all. This file is really necesary if your ethernet card is an unusual one, or is one that isn't automatically detected by the ethernet driver. It allows you to hard code some of the elements of your ethernet hardware. For example, if your ethernet card is a close, but not exact clone of a WD-8013, then you might have to configure the shared memory address to ensure the driver detects and drives the card properly. Please check the Ethernet-HOWTO for more definitive information on this file and its effect on ethernet cards. This file also contains configurable parameters for PLIP, though the defaults should again be ok unless you have a particularly slow machine.

When you are happy that the CONFIG file is suitable for your purposes, then you can proceed to build the kernel. Your first step will be to edit the top level Makefile to ensure the kernel will be built with the appropriate VGA settings, and then you must run the kernel configuration program:

> `

>     # cd /usr/src/linux
>     # make config

> `

You will be asked a series of questions. There are four sections relevant to the networking code. They are the `General setup`, `Networking options`, `Network device support`, and the `Filesystems` sections. The most difficult to configure is the `Network device support` section, as it is where you select what types of physical devices you want configured. On the whole you can just use the default values for the other sections fairly safely. The following will give you an idea of how to proceed:

> `

>     *
>     * General setup
>     *
>      ...
>      ...
>     Networking support (CONFIG_NET) [y] y
>      ...
>      ...

> `

In the `General setup` section you simply select whether you want network support or not. Naturally you must answer yes.

> `

>     *
>     * Networking options
>     *
>     TCP/IP networking (CONFIG_INET) [y] y
>     IP forwarding/gatewaying (CONFIG_IP_FORWARD) [y] y
>     *
>     * (it is safe to leave these untouched)
>     *
>     PC/TCP compatibility mode (CONFIG_INET_PCTCP) [n] n
>     Reverse ARP (CONFIG_INET_RARP) [n] n
>     Assume subnets are local (CONFIG_INET_SNARL) [y] y
>     Disable NAGLE algorithm (normally enabled) (CONFIG_TCP_NAGLE_OFF) [n] n
>     The IPX protocol (CONFIG_IPX) [n] n

> `

The second half of the `Networking options` section allows you to enable or disable some funky features that you can safely accept the defaults on until you have some idea why you want to change them.

> `

>     *
>     * Network device support
>     *
>     Network device support? (CONFIG_NETDEVICES) [y]
>     Dummy net driver support (CONFIG_DUMMY) [n]
>     SLIP (serial line) support (CONFIG_SLIP) [y] y
>      CSLIP compressed headers (SL_COMPRESSED) [y] y
>     PPP (point-to-point) support (CONFIG_PPP) [y] y
>     Load balancing support (experimental) (CONFIG_SLAVE_BALANCING) [n] n
>     Do you want to be offered ALPHA test drivers (CONFIG_NET_ALPHA) [n] n
>     Western Digital/SMC cards (CONFIG_NET_VENDOR_SMC) [y] y
>     WD80*3 support (CONFIG_WD80x3) [y] y
>     SMC Ultra support (CONFIG_ULTRA) [n] n
>     3COM cards (CONFIG_NET_VENDOR_3COM) [n] n
>     Other ISA cards (CONFIG_NET_ISA) [n] n
>     PLIP (parallel port) support (CONFIG_PLIP) [n] n
>     EISA and on board controllers (CONFIG_NET_EISA) [n] n
>     Apricot Xen-II on board ethernet (CONFIG_APRICOT) [n] n
>     Pocket and portable adaptors (CONFIG_NET_POCKET) [n] n
>     *

> `

This section is the most important, and the most involved. It is where you select what hardware devices you want to support. You can see that I have selected SLIP support with header compression, PPP, the WD80*3 driver, and nothing else. Simply answer ``y'` to whatever you want to play with, and ``n'` to that you don't.

> `

>     *
>     * Filesystems
>     *
>      ...
>      ...
>     /proc filesystem support (CONFIG_PROC_FS) [y]
>     NFS filesystem support (CONFIG_NFS_FS) [y]
>      ...
>      ...

> `

If you wish to run an NFS client then you will want to include the NFS filesystem type. You will need to include the `/proc` filesystem because a number of the network utilities use it.

After you have completed the configuration, all that remains is to actually compile the kernel:

> `

>     # make dep
>     # make

> `

Don't forget to `make zlilo` if the new kernel compiles and tests ok.

Next Chapter, Previous Chapter

Table of contents of this chapter, General table of contents

Top of the document, Beginning of this Chapter