DHCP (Dynamic Host Configuration Protocol) is used to assign IP addresses to clients on the network. We can use the server package to assign the IP addresses of valid DNS servers, WINS name servers, TFTP boot servers etc.
Installation of DHCP is fairly straight forward. Simply install the DHCP server from your nearest repository.
# yum install dhcp
After the installation script has finished running, the configuration file will need to be edited to suit the needs of your enviroment.
# vi /etc/dhcpd.conf
An example of standard DHCP configuration file follows.
ddns-update-style none;
deny bootp;
authoritstive;
subnet 192.168.0.0 netmask 255.255.255.0
{
option subnet-mask 255.255.255.0;
option domain-name "example.com";
option routers 192.168.0.1;
option domain-name-servers 192.168.0.1, 192.168.0.10;
option netbios-name-servers 192.168.0.2;
range dynamic-bootp 192.168.0.60 192.168.0.120;
default-lease-time 31200;
max-lease-time 62400;
}
OK lets explain the above DHCP configuration. Any machine that connects to the server will recive a dynamic IP address between 192.168.0.60 and 192.168.0.120 and a subnet mask of 255.255.255.0.
The server will dish out the default DNS servers for the client of 192.168.0.1 and 192.168.0.10 along with the default domain name suffix of example.com. The configuration also specifies a default WINS server of 192.168.0.2. This is useful if there are Microsoft Windows clients connecting to a Samba Server on the network.
The default lease time is 520 minutes (counted in seconds) and the maximum lease time is set to 1040 minutes (again, counted in seconds).
Once the DHCP server has been configured, and the file saved, it can be started by executing:
# /etc/init.d/dhcp start
Make sure that once everything is working correctly, and you are satisfied with the configuration, you make sure the dhcpd init script is set to start on system reboot.
# chkconfig dhcpd on

0 Responses to “DHCP Installation & Setup on Centos 4”
Leave a Reply