32.4. Adding and Editing Subnets

In the simplest DHCP server configuration, all you need is a single subnet entry to hand out IP addresses within particular range to clients on a single LAN. The server allows you to do much more than that, but for many networks this is all that is needed. Unless, of course, you want to assign fixed addresses to some hosts or have multiple IP networks on the same LAN.

To add a new subnet entry, follow these steps:

1.
On the module's main page, click on the Add a new subnet link in the Subnets and Shared Networks section. This will take you to the page shown in Figure 32.3.

Figure 32.3. The subnet creation form.


2.
In the Network address field, enter the address of your local LAN, such as 192.168.1.0. This must be a network to which your system is directly connected.

3.
In the Netmask field, enter the mask for the local LAN, such as 255.255.255.0. The best way to find the correct network address and netmask is to use the Network Configuration module to look at the settings for your Ethernet interface.

4.
The Address ranges section is actually a table for entering multiple ranges, but only one blank row is displayed at a time. In the first field, enter the starting address for the range of IPs that you want assigned to clients, such as 192.168.1.100. In the second, enter the ending address for the range, such as 192.168.1.150. Both addresses must be within the network, and the first must be lower than the second.

To add more than one range, you will need to reedit this subnet after saving so that a new blank row appears in the table. The server will always assign addresses from the start of the first range up to the end, then go on to the second and any subsequent ranges. Because each client must have a unique IP, make sure that your ranges are big enough to support all the client hosts that may be connected to the network at any one time.

5.
If you want this subnet to be part of a shared network (explained in Section 32.8 “Adding and Editing Shared Networks”), select it from the Shared network menu. Otherwise, choose <None> to have the subnet created outside of any shared nets.

6.
To set the lease length for clients on this network, change the Default lease time from Default to the number of seconds by adding that number into the field next to it. This will be the length of the lease for hosts that do not explicitly request one.

You should also set the Maximum lease time field, so that clients cannot request a lease longer than the specified number of seconds. If not set, there is no upper limit on lease length.

7.
Unless the client systems on your LAN will be network-booting from another server, the Boot filename and Boot file server fields can be left set to Default. Only diskless workstations need to do this.

8.
The Server name field is for entering the network hostname of your DHCP server system. Usually this can be left set to Default, in which case the server will work it out automatically.

9.
Click the Create button at the bottom of the page. An new entry for the subnet will be added to the server's configuration, and you will be returned to the module's main page.

10.
Click on the new icon for the subnet, which will take you to an editing form that is almost identical to the creation page.

11.
Click on the Edit Client Options button to go to a page listing information that will be sent to clients, as shown in Figure 32.4. All of the fields have a Default radio button, which, if selected, typically indicates that no information related to that option will be sent to clients.

Figure 32.4. The subnet client options page.


12.
Fill in the Default routers field with the IP address of the default gateway on your network, such as 192.168.1.1. This will be used by clients that have their address assigned by DHCP to communicate with systems outside the network.

13.
Fill in the Subnet mask field with the netmask for your network, such as 255.255.255.0.

14.
Enter the broadcast address for your network into the Broadcast address field, such as 192.168.1.255.

15.
Fill in the Domain name field with the DNS domain name such as example.com that clients should append to partial hostnames.

16.
In the DNS servers field, enter a space-separated list of DNS server IP addresses that clients can use, such as 192.168.1.104 1.2.3.4.

17.
If you are running NIS (covered in Chapter 17) and want clients to connect to an NIS server at boot time, fill in the NIS domain field with the name of your NIS domain, and fill in the NIS servers field with the IP address of your NIS master or slave server. This is only useful if the client hosts are capable of getting their NIS settings from DHCP.

18.
If you have Windows clients and are running a Samba or Windows server, fill in the NetBIOS name servers field with the IP address of a system that can do NetBIOS name resolution for clients. Any UNIX system running Samba will be able to perform this role.

19.
Click the Save button at the bottom of the page to go back to the subnet form.

20.
If this is your first subnet, you will need to make sure that the server is configured to use the right network interface for your system. Return to the module's main page and click on the Edit Network Interface button at the bottom of the page.

Then, select the interface for the new subnet from the Listen on interfaces list and click Save. If you have multiple network interfaces and have created subnet configurations for each of them, then all the interfaces must be selected for the server to work properly.

21.
If you are running version 3 of the ISC DHCP server (shown on the main page) and this is your first subnet, you may need to set the DDNS update style before the server can be started. Even if you are not using DDNS, some versions insist on an entry existing in the configuration file for it. Click on the Edit Client Options button on the main page and scroll down to the Dynamic DNS update style field. Select None and click Save to return to the module index.

22.
Back on the main page, click on the Start Server or Apply Changes button. If something goes wrong, the error message generated by the DHCP server will be displayed. The most common problem is a mismatch between the network interface settings and the network address for the subnet. Another that often shows up is related to the ddns-update-style directive, which Step 21 explains how to set.

Once your first subnet has been created and the server started, you can test it by configuring a client system to use DHCP. When the client boots up, it should contact the server and be assigned an address, DNS, and routing information. You should also be able to see the client on the leases page, covered in Section 32.5 “Viewing and Deleting Leases”.

An existing subnet can be edited by clicking on its icon on the main page, changing fields, and hitting the Save button. If you want to edit options for clients in the subnet, you will need to click on Edit Client Options as in the instructions above, make your changes, and then click Save on that page. After any modifications, the Apply Changes button must be used to make them active.

A subnet can be deleted using the Delete button on its editing form. Any hosts, groups, or address pools that it contains will be removed as well—so be careful. After deleting, use the network interfaces page to deselect the interface for the subnet. Failure to do so will cause the DHCP server to display an error message when Apply Changes is clicked, which must be done to make the deletion active.

If the subnet contains any hosts or groups, a confirmation page will be displayed when Delete is clicked that lists all the groups and hosts that will be deleted as well. Only when the Yes button is hit will the subnet (and all it contains) actually be removed.

Another way to create a subnet inside a shared network is to click on the Add a new subnet link on the shared network's page. This will bring up the same subnet creation form shown in Figure 32.3, but without the Shared network field. Instead, the shared network is shown at the top of the page under the title. The rest of the creation process is identical.

A subnet configuration entry must be created for each IP network on which you want to allocate addresses. Typically, there will be one for each LAN connected to your system via an Ethernet, Tolken Ring, or 802.11b network card. If two IP networks are actually on the same LAN, then both their subnets must be inside a shared network, as explained in Section 32.8 “Adding and Editing Shared Networks”.

You must also make sure that every network interface that is connected to a network on which your DHCP server is assigning addresses is selected on the network interface page. If not, an error will be reported when the server is started or when changes are applied. For most system administrators, this is not a big issue though as they have only a single LAN in their organization.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.237.77