![]() | Warning |
|---|---|
Don't set up a DHCP server on someone else's network - if the network already has clients set to use a DHCP server to get networking information, they may use your DHCP server instead of the server they should be using, interfering with the proper operation of the network. | |
DHCP must be configured on the command line:
Open a terminal and do the following:
Install the dhcp package. At the prompt, then switch to the root user: su -l root
Install the package: rpm -Uvh /path/to/files/dhcp*.rpm
Set up the DHCP server configuration file. There's a sample configuration file in the documentation from the package, which can be used as basis for editing: cp /usr/share/doc/dhcp-*/dhcp.conf.sample /etc/dhcpd.conf
The format is as follows:
Begin a section containing options for broadcast requests coming from the 192.168.5.0/255.255.255.0 network.
subnet 192.168.5.0 netmask 255.255.255.0 {
The range of IP addresses and subnet mask clients will use:
range dynamic-bootp 192.168.5.1 192.168.5.99;
option subnet-mask 255.255.255.0;
The default route (sometimes called the default gateway)
option routers 192.168.5.100;
The DNS domain name:
option domain-name "example.com";
The DNS servers PCs should use:
option domain-name-servers 192.168.5.100;
The time when clients will attempt to renew their lease (6 hours), and the time when those credentials will expire if not renewed (12 hours).
default-lease-time 21600;
max-lease-time 43200;
The end of options for the subnet
}
Start the dhcpd service and set it to start by default by typing: service dhcpd start chkconfig dhcpd on
Confirm your DHCP server is working by attempting to get an IP address.