Thursday, January 10, 2008

Dynamic Host Configuration Protocol (DHCP)

The DHCP configuration file is /etc/dhcpd.conf.But this is not originally in the /etc,I had to copy it from /usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample.In most cases the DHCP installation doesn't create a "dhcpd.leases" file. Before you start the server, you must create an empty file(once DHCP starts this stores the assignment it makes):

touch /var/lib/dhcp/dhcpd.leases

To starts the DHCP server:

service dhcpd start
service dhcpd restart

Create and edit /etc/dhcpd.conf

ddns-update-style interim;
ignore client-updates;

subnet 192.168.10.0 netmask 255.255.255.0 {

# --- default gateway
option routers 192.168.10.1;
option subnet-mask 255.255.255.0;

#option nis-domain "whitebox";
#option domain-name "whitebox";


# If you specify a WINS server for your Windows clients,
# you need to include the following option in the dhcpd.conf file:
#option netbios-name-servers 192.168.123.104;

option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.123.104;
# --- 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 192.168.10.100 192.168.10.120;
default-lease-time 86400;
max-lease-time 86400;

# we want the nameserver to appear at a fixed address
host pubudu {
hardware ethernet 00:34:56:78:AB:CD;
fixed-address 192.168.10.104;
default-lease-time 86400;
}
}

The DHCP client

launch linuxconf and choose Config->Networking->Client Tasks->Basic Host Information.
Set the following options:
1. Enabled
2. Config Mode = DHCP

No comments: