Server OS: CentOS5.6 x86_64
Server Name: xen1
xen1:
eth0: 10.0.0.1
Gateway: 10.0.0.1
DNS:8.8.8.8
1. Install the dhcp package.
yum install dhcp
2. Configuration
vi /etc/dhcpd.conf, add following lines:
ddns-update-style interim;
ignore client-updates;
subnet 10.0.0.0 netmask 255.255.255.0 {
option routers 10.0.0.1;
option subnet-mask 255.255.255.0;
option nis-domain "domain.org";
option domain-name "domain.org";
option domain-name-servers 8.8.8.8;
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 10.0.0.100 10.0.0.120;
default-lease-time 21600;
max-lease-time 43200;
next-server 10.0.0.1;
filename "/pxelinux.0";
}
Sample file: /usr/share/doc/dhcp*/dhcpd.conf.sample
3. Start service
service dhcpd start
chkconfig dhcpd on //autostart when next booting
Ok, you have successfully builded the dhcp server, the client OS'network only need set dhcp mode, server will distribute ip for it dynamically.