
|
RHCE Information on DHCP from RHCE2B.COMWhere to find information on DHCP
DHCP DefinedDHCP is the Dynamic Host Configuration Protocol. It is used to dynamically assign hosts an ip address on the network. There are really two things you could do with DHCP under Linux. You could configure your Linux machine to be a DHCP client. Or you could configure your Linux machine to be a DHCP server. The DHCP server is called dhcpd. The DHCP client is called "dhcpcd ".How To Install DHCPHow to install a DHCP Server% mount /dev/cdrom % cd /mnt/cdrom/RedHat/RPMS % rpm -ivh dhcp*.rpm
How to install a DHCP Client% mount /dev/cdrom % cd /mnt/cdrom/RedHat/RPMS % rpm -ivh pump*.rpm
How To Configure DHCPHow to configure a DHCP serverIf you are going to support Microsoft Windows clients, then you must do a:% route add -host 255.255.255.255 dev eth0
Configure your /etc/dhcpd.conf file Here is an example configuration. Theis configuration will give out IP addessesfrom 10.0.0.10-10.0.0.100 or 10.0.0.150-10.0.0.200. If the client doesn't ask for a specific time frame, it will lease the ip address for 600 seconds. If the client asks for a time frame, the maximum it will allow is 7200 seconds. It also sets up the default gateway of 10.0.0.1, the subnet mask of 255.255.255.0, the broadcast address of 10.0.0.255, and 10.0.0.2, and 10.0.0.3 as DNS servers. # Sample /etc/dhcpd.conf Make sure there is a dhcpd.leases file:
% touch /var/state/dhcpd/dhcpd.leases
Run dhcpd in debugging mode to ensure it is working properly:
% /usr/sbin/dhcpd -d -f
How To Configure a DHCP clientRun the netcfg command % netcfg Under Interfaces, edit the appropriate entry for your ethernet card choosing dhcp as the protocol. Also make sure you enable the "Activate interface at boot time option". Then click "Save" and the "Done". This should immeadiately activate your changes. However, if it does not, then you can force the changes to take affect by doing:
% /sbin/ifup eth0 Note: You can manually run /sbin/dhcpcd in order to get an ip address via dhcp for a particular interface. For example, (from Steve's RHCE Study Guide) /sbin/dhcpcd -n -H eth0
-H = Force dhcpcd to set the hostname of the host to the hostname option
supplied by the DHCP server.
-n = If dhcpcd is already running send it an ALRM signal to cause it to
attempt to renew it's lease.
eth0 = Interface to configure
Debugging Exam Note: If you are not running X-Windows, you can use
the "netconf" command instead of the "netcfg" command!
RHCE2B.COM Home Page RHCE2B.COM Practice Test for the RHCE exam This site is not authorized or reviewed by Red Hat, Inc. Legal stuff |
|