TYPE=Ethernet
DEVICE=eth0
BOOTPROTO=
IPADDR=192.168.1.50
NETMASK=255.255.255.0
USERCTL=yes
IPV6INIT=no
PEERDNS=yes
ONBOOT=yes
Once finished you will need to restart the networking service: service networking restart
Now that you have static ip address setup you will need to install the dhcpd package which contains the DHCP server software. After this package is installed there are two important files which we will need to work with. The first is /etc/dhcpd.conf which is the configuration file for the DHCP server. This file may not exist in which case you will need to create it. You can find a sample to work off of (recommended) at /usr/share/doc/dhcp-/dhcp.
$ yum install dhcp.i386
$ cp /usr/share/doc/dhcp-3.0.5/
$ nano /etc/dhcpd.conf
# Sample DHCP Config File
ddns-update-style interim;
authoritative;
subnet 192.168.1.0 netmask 255.255.255.0 { # Parameters for the local subnet option routers 192.168.1.254; option subnet-mask 255.255.255.0; option domain-name "testbed.edu"; option domain-name-servers 192.168.1.50; default-lease-time 21600; max-lease-time 43200; range dynamic-bootp 192.168.1.100 192.168.1.200; } $ service dhcpd restart
As we can see above looking through the configuration file, there is only one subnet for this network. The gateway has been defined by the "option routers" paramters, the DNS information by the "option domain-name" parameters, and the leases for the client by the "range" parameter. Restarting the DHCP service will allow the configuration file to be loaded into the server and it will begin to lease ip addresses to clients. One other configuration parameter that you should know if how to setup reserved ip addresses.
# In the configuration file host client01 { option host-name “client01.example.com”; hardware ethernet 02:B4:7C:43:DD:FF; fixed-address 192.168.1.109; }This basically reserves this ip address for the client01 host with the specified MAC address. This can be usefu for printers or particular addresses that you wish to reserve. You can now watch as clients should begin leasing their ip addresses from the server as they connect to the network. Some other ideas you might want to consider implementing with a DHCP server is a failover server, relay servers, and backing up the configuration file and/or the lease database. As a tip, instead of editing the dhcpd.conf file and then restarting the server to make changes you can use the omshell command which will allow you to connect to, query, and change the configuration while the server is running.