Configuring your network requires a ton of tedious work, unless you take advantage of the Dynamic Host Configuration Protocol.
One of the host specific definitions is hardware, which describes the specific hardware. Right now, only the ethernet and token-ring hardware types are supported. The syntax here is to list the type of hardware, followed by the physical address of the card (i.e., the MAC address). For example, you might have something like this:
host saturn hardware ethernet 00:50:04:53:F8:D2; fixed-address 192.168.42.3:
This example says that the machine saturn has an Ethernet card with the MAC address 00:50:04:53:F8:D2, and it is to be assigned the fixed address 192.168.42.3.
Sometimes you need to specify options for a number of machines on your network without having to treat them as a separate subnet. For example, you could define a subnet for a group of machines and then apply specific options to just that subnet. However, this means that you will generally have to specify all of the necessary configuration options; plus, these special nodes obviously cannot have IP addresses in the same subnet as the others.
To overcome this limitation, you can group machines together using the group keyword. This way, all the options included within the group definition apply to that group. As with subnets, this keyword can also specify individual hosts with the group. For example:
group default-lease-time 300000; option routers 192.168.42.1; host jupiter hardware ethernet 00:50:04:53:D5:57; default-lease-time 500000; host saturn hardware ethernet 00:50:04:53:F8:D2; host uranus hardware ethernet 00:50:04:53:32:8F;
In this example, we set the default lease time (how long the lease is valid) for the group to 300000 seconds (almost four days) and the router to be the machine 192.168.42.1. This definition will apply to all three of the hosts that we list (jupiter, saturn, and uranus). However, with jupiter, we set the default lease time to a higher value 500000, but the router definition (192.168. 42.1) still applies.
Sometimes you may need to configure multiple networks on the same physical network segment. There are several reasons for doing this, such as restricting certain device types to specific segments or preparing to move the machines to a different network segment. DHCP lets you configure your system this way by declaring a shared-network.
A shared-network is basically a container for a group of machines. It is different from a group declaration in that it can contain subnets as well as groups or individual hosts. It has the following general syntax:
shared-network network-name shared-network-specific parameters subnet subnet-specific parameters group group-specific parameters
Note that within either the group or subnet declarations, you can specify parameters for individual hosts, just as when they are not part of a shared network.
Webmin – the User Friendly Approach
|Figure One: How to create a subnet with Webmin.
Although the configuration of the DHCP server is pretty straightforward, having to administer a large number of systems by editing files can become tedious. One rather useful way around this problem is Webmin (http://www.webmin.com).
Webmin provides a graphical, Web-based interface to a large number of system functions (including DHCP). If you look at Step 1 in the Making it Work sidebar (pg. 66), you can see the primary DHCP configuration page. At the top you see three subnets that this machine manages. Here, too, you would also see any shared networks that are configured.
Creating a new subnet with Webmin (Figure One) is a very straightforward process. All you need to do is type in the network address and the netmask. Although other values can be included — I’ve entered the default lease time, for example in Figure One — only the network address and netmask are required.
Underneath are any machines that are specifically configured, as well as groups of machines. When you select each individual object, you can configure the same options as you can by editing the files. The screen shot next to Step 3 in the sidebar shows you the configuration for a host named jupiter.
Making it Work: Defining a Static IP Address for a client with Webmin
STEP 1 START WEBMIN
Start up Webmin and click on the icon “DHCP Server,” which brings you to the screen at right.
STEP 2 ADD NEW HOST
Click on the link “Add new host.”
STEP 3 INPUT INFORMATION
Enter the machine name (here jupiter), the hardware address (here ethernet 00:50:04:53:D5:57), and the static IP address (here 192.168.42.6).
STEP 4 CREATE NEW ENTRY
Click on the “Create” button to create the new entry and save the changes.