Linux « NTP server | HOME | VMware server - Virtualization »
To lease IP address to the PC which is non-fixed IP address,
Install
# yum -y install dhcp
# yum clean packages
Copy sample configuration file
# cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
# nano /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
not authoritative; (add this to delete the unnecessary warning in log file)
subnet 10.81.243.0 netmask 255.255.255.0 {
# --- default gateway
option routers 10.81.243.1;
option subnet-mask 255.255.255.0;
# option nis-domain "domain.org";
# option domain-name "domain.org";
option domain-name-servers 10.81.255.5,10.95.255.5; (DNS server)
option time-offset 32400; # Eastern Standard Time (second : now this is JP time)
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 10.81.243.101 10.81.243.200; (this is the range for leased IP)
default-lease-time 259200; (second : 3 days)
max-lease-time 259200; (second : 3days)
# we want the nameserver to appear at a fixed address
# host ns {
# next-server marvin.redhat.com;
# hardware ethernet 12:34:56:78:AB:CD;
# fixed-address 207.175.42.254;
# } (comment out till here)
}
# /etc/init.d/dhcpd start
# chkconfig dhcpd on
To check the leased status
# cat /var/lib/dhcpd/dhcpd.leases
If you would like to setup the fixed IP address for the particular NIC, add below line prior to the last "}" in dhcpd.conf.
host win-client1 { (host name)
hardware ethernet XX:XX:XX:XX:XX:XX; (MAC address)
fixed-address 192.168.1.10; (IP address : this has to be within the leased IP range)
}

