Page 189 - DCAP106_OPERATING_SYSTEM_TOOLS
P. 189

Operating System Tools




                    Notes          modem and home network, your PC will most likely get its IP address at boot time from the
                                   home router instead.


                                     Did u know? You can choose to disable the DHCP server feature on your home router and
                                     set up a Linux box as the DHCP server.

                                   10.4.1 How to Get DHCP Started

                                   To get DHCP started:
                                   1.   Some older Fedora/RedHat versions of the DHCP server will fail unless there is an existing
                                       dhcpd.leases file. Use the command touch /var/lib/dhcp/dhcpd.leases to create the file if
                                       it does not exist.

                                       [root@bigboy tmp]# touch /var/lib/dhcp/dhcpd.leases
                                   2.   Use the chkconfig command to get DHCP configured to start at boot:

                                       [root@bigboy tmp]# chkconfig dhcpd on
                                       With Debian/Ubuntu the equivalent command for the dhcp3-server package would be:

                                       root@u-bigboy:/tmp# sysv-rc-conf dhcp3-server on
                                   3.    Use the service command to instruct the /etc/init.d/dhcpd script to start/stop/restart
                                       DHCP after booting
                                          [root@bigboy tmp]# service dhcpd start
                                          [root@bigboy tmp]# service dhcpd stop
                                          [root@bigboy tmp]# service dhcpd restart
                                       With Debian / Ubuntu the equivalent commands would be:
                                          root@u-bigboy:/tmp# /etc/init.d/dhcp*-server start
                                          root@u-bigboy:/tmp# /etc/init.d/dhcp*-server stop
                                          root@u-bigboy:/tmp# /etc/init.d/dhcp*-server restart
                                   4.   Keep in mind to restart the DHCP process every time you make a change to the conf file
                                       for the changes to take effect on the running process. You also can test whether the DHCP
                                       process is running with the following command; you should get a response of plain old
                                       process ID numbers:
                                          [root@bigboy tmp]# pgrep dhcpd
                                   5.   Lastly, always remember to set your PC to get its IP address via DHCP.

                                   10.4.2 Installing DHCP

                                   Once you have the source tarball or the RPM/DEB package for your distribution, install it. For
                                   RPM/DEB package users, this process is easy and straightforward. To install from the source
                                   code, untar the source code and enter the dhcp_2.0 subdirectory, then type:./configure make
                                   install.

                                   If you have a earlier version of DHCP installed on your system, be sure to remove it prior to
                                   running make install so that you do not mix man pages, configuration files, or binaries.

                                   Download and Install the DHCP Package

                                   Most RedHat and Fedora Linux software products are obtainable in the RPM format. Downloading
                                   and installing RPMs aren’t hard. When searching for the file, remember that the DHCP server




          182                              LOVELY PROFESSIONAL UNIVERSITY
   184   185   186   187   188   189   190   191   192   193   194