Configuring the Systems


Configuring the Systems

kudzu

Once the hardware is in place, you need to configure each system so that it knows about the NIC that connects it to the network. Normally kudzu, the Red Hat utility that detects and configures new hardware, gives the system the information it needs about the NIC. The kudzu utility probes the NIC when you install CentOS Linux or the first time you boot the system after you install a NIC.

You can use system-config-network (discussed in the next section) to augment the information kudzu collects and to activate the NIC. When it prompts you for information, kudzu allows you to specify only one nameserver. It is a good idea to specify at least two or three nameservers; you can use system-config-network to add additional nameservers.

System information

In addition to information about the NIC, each system needs the following information:

  • The system's IP address

  • The netmask (subnet mask) for the system's address (pages and )

  • The IP address of the gateway

  • The IP addresses of the nameservers (DNS addresses)

  • The system's hostname (set when you install CentOS Linux)

If you set up a DHCP server (page ) to distribute network configuration information to systems on the LAN, you do not need to specify the preceding information on each system; you just specify that the system is using DHCP to obtain this information. You need to specify this information when you set up the DHCP server.

Private address space

When you set up a LAN, the IP addresses of the systems on the LAN are generally not made public on the Internet. Some special IP addresses, part of the defined by (page ), are reserved for private use and are appropriate to use on a LAN (). Unless you have been assigned IP addresses for the systems on the LAN, choose addresses from the private address space.

Table 17-1. Private IP ranges (defined in RFC 1918)

Range of IP addresses

From IP address

To IP address

10.0.0.0/8

10.0.0.1

10.255.255.254

172.16.0.0/12

172.16.0.1

172.31.255.254

192.168.0.0/16

192.168.0.1

192.168.255.254


system-config-network: Configures the Hardware

The system-config-network utility configures network hardware. To display the Network Configuration window (), enter system-config-network on a command line. From KDE select Main menu: System Administration Network or from GNOME select System: Administration Network. The Network Configuration window has tabs to specify hosts (/etc/hosts, page ) and DNS servers (/etc/resolv.conf, page ), as well as to configure network hardware and logical devices associated with the hardware.

Figure 17-2. The Network Configuration window, Devices tab


Adding a device

Normally kudzu identifies and adds new hardware to the system. You can then use system-config-network to edit the configuration information. If you need to add a NIC to the system manually, click the Devices tab; then click New on the toolbar. The utility displays the Select Device Type window ().

Figure 17-3. The Select Device Type window


The Select Device Type window can set up six types of connections (most of which do not pertain to setting up a LAN): Ethernet (page ), (page ), modem, (page ), wireless, and xDSL (page ). ISDN, modem, wireless, and xDSL are PPP (Point-to-Point Protocol) connections. PPP is a serial line protocol that establishes a connection between two systems, putting them on the same network. It is capable of handling several protocols, the most common of which is TCP/IP, which provides compression for increased efficiency. The two systems can then run ssh, X, or any other network application between them. Ethernet and token ring are used to connect to LANs.

Choose the type of connection you want to establish and click Forward. Some selections probe for information at this point. You can accept entries in the text boxes that are filled in in the following window. Fill in blank text boxes as appropriate. When you have finished setting up the device, click Apply. The Select Device Type window closes, and the Network Configuration window displays the device you just added. Follow the instructions in the next paragraph to edit the configuration information. If you are finished, click the Devices tab, highlight the new device, click Menubar: File Save, and click Activate to bring the new device on line.

Editing a device

The Network Configuration window () has four tabs, two of which pertain to hardware devices and two of which relate to the system. The Hosts tab modifies the /etc/hosts file (page ) and the DNS tab modifies the system's hostname and the /etc/resolv.conf file (page ). Make changes in these tabs as necessary.

To modify the configuration of network hardware, such as a NIC, click the Hardware tab, highlight the description of the hardware, and click Edit on the toolbar. The utility displays the Network Adapters Configuration window. In this window, you can change the name of the device (eth0, eth1, and so on) and the resources it uses. Typically you will change only the name. Click OK to accept the changes and close the window.

To modify the device represented by a piece of hardware, click the Devices tab, highlight the device, and click Edit on the toolbar. The utility displays a window appropriate to the device you are editing. For example, if you are working with an Ethernet NIC, system-config-network displays the Ethernet Device window ().

Figure 17-4. The Ethernet Device window

From this window, you can set up the device to use DHCP or manually specify the necessary IP addresses. The Hardware Device tab allows you to associate the device with a piece of hardware and specify a MAC address (page ). When you are finished making changes, click OK, click the Devices tab, highlight the new device, and click Menubar: File Save. Activate the device if necessary.

iwconfig: Configures a Wireless NIC

You can configure a wireless NIC using either system-config-network (page ) or iwconfig. The iwconfig utility is based on ifconfig and configures elements of a wireless NIC not supported by ifconfig, such as setting up Master mode and binding a card to a WAP.

The most common parameters you will change with iwconfig are the encryption key, the mode, and the name of the network. Most devices support a minimum of 40-bit Wired Equivalent Privacy (WEP) encryption. The encryption key is defined by a string of 10 hexadecimal digits. The contents of the string are arbitrary, but must be the same on all nodes:

# iwconfig eth1 key 19FEB47A5B

The algorithm used by WEP is known to be flawed; using it does not give much protection. If you require privacy, use an encrypted protocol, such as SSH or HTTPS. If you have difficulty connecting, disable encryption on all nodes:

# iwconfig eth1 key off

The mode defines whether you are connecting to an ad hoc or an infrastructure network. Normally you can set mode to Auto, which selects the correct mode automatically:

# iwconfig eth1 mode Auto

The exception is if you want to use the NIC as a WAP, in which case you need to set mode to Master:

# iwconfig eth1 mode Master

Not all wireless NICs are capable of acting as masters.

The network name is defined by the ESSID (Extended Service Set ID), an arbitrary string. With the ESSID set (it must be the same on every node, including the WAP), you should be able to roam between any set of nodes with the same network name:

# iwconfig eth1 essid "My Wireless Network"

See the iwconfig man page for more information.