Before configuring TCP/IP on your Linux system, you need to perform a few small steps to ensure that your filesystem is ready.
The first step is to make sure the networking software has been installed. You can install the network package through the setup program, as shown in the figure below. Selecting the networking option installs the applications you need to use TCP/IP under Linux.
After the network software has been installed, you might have to reboot your system.
Some versions of Linux (notably those that use the 2.0 kernel and many of the latest releases) require a /proc filesystem for networking to function properly. Most Linux kernels that inherently support networking automatically create the /proc
filesystem when the operating system is installed, so you should not have to do anything more than make sure it is properly mounted by the kernel.
(The /proc filesystem is a quick interface point for the kernel to obtain network information, as well as to help the kernel maintain tables usually kept in the subdirectory /proc/net.) You can verify that your Linux version uses the /proc filesystem by trying to do a "cd /proc" command to change to the /proc directoryt, as shown in the following figure.
Another step you should take before configuring TCP/IP is to set the system's hostname. To set the hostname, use this command:
hostname name
name is the system name you want for your local machine.
If you have a full domain name assigned to your network and your machine, you can use that name for your system.
For example, if your Linux machine is attached to the domain dispersednet.com and your machine's name is hal, you can set the full domain name using this command:
If you do not have a fully qualified domain name, you can make up your own domain name as long as you are not connected to the Internet.
(A made-up domain name does not have any meaning outside your local area network.) Alternatively, you do not have to assign a domain at all for your machine, but can simply enter this short name:
hostname hal
An entry is made in the
/etc/hosts
file to reflect your machine's name.
You should verify that your machine's name appears in that file. You also need to know the IP address assigned to your machine.
You should have a unique IP address ready for your Linux machine for use in the configuration process.
One file that you might need to work with if you plan to direct information across many networks is
/etc/networks
.
The /etc/networks file contains a list of all the network names your machine should know about, along with their IP addresses.
Applications use this file to determine target networks based on the network name. The /etc/networks file consists of two columns for the symbolic name of the remote network and its IP address. Most
/etc/networks
files have at least one entry for the loopback driver that should be on every Linux system
(the loopback driver is used as a default IP address by some Linux applications and is discussed in more detail later in this chapter). A sample /etc/networks file looks like this:
loopback 127.0.0.0
merlin-net 147.154.12.0
BNR 47.0.0.0
This sample file has two networks entered in it with their network IP addresses.
Only the network portion of the IP address is specified, leaving the host component of the IP addresses set to zeros