Wednesday, April 30, 2008

Configure the DHCP Server

In this exercise, you install and configure a DHCP server for the domain digitalairlines.com. The IP addresses your DHCP server manages are 10.0.0.101 to 10.0.0.120. Your DHCP server should inform the clients about the DNS information and routers (both services on 10.0.0.254). The computers of two of your neighbors should get the IP addresses 10.0.0.151 and 10.0.0.152. The defaul lease time is one day the maximum lease time two days. Do the following:

■ Part I - Install the DHCP Server Software
■ Part II: Edit the /etc/sysconfig/dhcpd File
■ Part III - Edit the /etc/dhcpd.conf File
■ Part IV - Test the Configuration

Part I - Install the DHCP Server Software

To install the DHCP server software, do the following:

1. Start YaST from the main menu.
2. When you are prompted for the root password, enter novell.
3. Select Software Management.
4. Select the Filter pull-down menu; then select Search.
5. Enter dhcp in the Search text box and click Search.
6. Select the check boxes in front of the following packages:
dhcp
dhcp-server
dhcp-tools
7. Select Accept.
8. When the installation is finished, close all YaST windows.

Part II: Edit the /etc/sysconfig/dhcpd File

To edit the /etc/sysconfig/dhcpd file, do the following:

1. Start a terminal emulation from the main menu.
2. Switch to user root by entering su -.
3. When you are prompted for the root password, enter novell.
4. Start your favorite text editor and open the file
/etc/sysconfig/dhcpd.
5. Change the line
DHCPD_INTERFACE=””
to
DHCPD_INTERFACE=”eth0”
6. Save the file.

Part III - Edit the /etc/dhcpd.conf File

To edit the /etc/dhcpd.conf file, do the following:

1. Start a terminal emulation from the main menu.
2. Switch to user root by entering su -.
3. When you are prompted for the root password, enter novell.
4. Enter ip address show to get the MAC address of your network card.
5. Record your MAC address in the space below:
6. Record the MAC address of your two neighbors in the table below:
Hostname: IP: MAC:
Hostname: IP: MAC:
7. Rename the file /etc/dhcpd.conf to /etc/dhcp.conf.orig by entering
mv /etc/dhcpd.conf /etc/dhcpd.conf.orig
8. Open a new file /etc/dhcp.conf with your favorite text editor.
9. To switch off dynamic DNS updates, enter
ddns-update-style none;
10. To set the default lease time to one day, enter
default-lease-time 86400;
11. To set the maximum lease time to two days, enter
max-lease-time 172800;
12. To define the domain name, enter
option domain-name “digitalairlines.com”;
13. To specify the domain name servers, enter
option domain-name-servers 10.0.0.254;
14. To specify the default gateway, enter
option routers 10.0.0.254;
15. To specify the range of IP addresses to be provided by your DHCP server, enter
subnet 10.0.0.0 netmask 255.255.255.0
{
range 10.0.0.101 10.0.0.120;
}
16. To assign fixed IP addresses to the hosts of two of your neighbors, add
host hostname1.digitalairlines.com
{
hardware ethernet mac1;
fixed-address 10.0.0.151;
}
host hostname2.digitalairlines.com
{
hardware ethernet mac2;
fixed-address 10.0.0.152;
}

Instead of hostname1 and hostname2, enter the hostname of
your neighbor’s computer. Instead of mac1 and mac2, enter the
MAC address of your neighbor’s computer.
17. Save the file.

Part IV - Test the Configuration

To test the configuration, do the following:

1. Enter rcdhcpd syntax-check to test your configuration.

You should get an error message that the lease database could
not be opened. That happens because the dhcpd is not started.
There should be no syntax error in the output of rcdhcpd
syntax-check.

No comments: