20. DHCP
20.1 Overview
1. Provides dynamic configuration and network information to hosts.
o IP address.
o DNS servers.
o Netbios name servers.
o Gateways.
o Domain name.
2. Only one DHCP server per network segment.
3. Uses broadcast packets to retrieve information.
4. Superset of bootp.
5. Can answer requests from bootp clients.
6. Packages
o Server – dhcpd.
o Client – dhcpcd or pump.
7. Ports
o Server – UDP 67 (bootps)
o Client – UDP 68 (bootpc)
20.2 Server Configuration
1. /etc/dhcpd.conf
Don’t forget the trailing semi-colons.
# Global Options (can also be specified for a specific subnet)
option nis-domain “secret_nis_domain”; # Set NIS domain
option domain-name “somedomain.com”; # Domain name assigned to client
option domain-name-servers,; # DNS servers for domain
option netbios-name-servers; # WINS server

# Specifies host that the initial boot file should be loaded from
next-server boot-server;

default-lease-time 600; # Lease time used unless client requests otherwise.
max-lease-time 7200; # Maximum lease time that will be given

# At least one subnet block is required.
# It must correspond with a configured interface.
subnet netmask
# Definitions in block only apply to this subnet

# Default gateway
option routers;

# Range of IPs to use for dynamic configuration

# Static configuration – The host with the stated MAC address will
# always receive the IP address stated below.
host enterprise
hardware ethernet 00:0a:cc:3a:1c:42;
fixed address

An example dhcpd.conf file is available at/usr/share/doc/dhcp-2.0p15/dhcpd.conf.sample
2. /var/lib/dhcp/dhcpd.leases
Stores information about leased IP addresses. It must exist in order for dhcp to start! If it doesn’t exist, type:
touch /var/lib/dhcp/dhcpd.leases
20.3 Client Configuration
1. dhcpcd
o Default client.
o Used by “ifup” to configure interface.
o Stores information in /etc/dhcpc.
o Common usage:
o /sbin/dhcpcd -n -H eth0
o -H = Force dhcpcd to set the hostname of the host to the hostname option
o supplied by the DHCP server.
o -n = If dhcpcd is already running send it an ALRM signal to cause it to
o attempt to renew it’s lease.
o eth0 = Interface to configure.
2. pump
o Only used if dhcpcd isn’t found.
o Used by “ifup” to configure interface.
o Common usage:
o /sbin/pump –lookup-hostname -i eth0
o –lookup-hostname = Get hostname and domain name from DNS
o -i = Specifies interface to configure

Download the Ensurepass Latest 2013 RHCE EX300 Practise Test PDF to pass RHCE EX300 exam.

Comments are closed.