| ||
DHCP (Dynamic Host Configuration Protocol) DHCP, the Dynamic Host Configuration Protocol, describes the means by which a system can connect to a network and obtain the necessary information for communication upon that network In this article i will briefly explain howto setup DHCP Server and client on various Operating Systems, such as FreeBSD,OpenBSD,NetBSD and Linux. We will use the ISC (Internet Software Consortium) DHCP implementation. You can get latest versions of this document from http://www.enderunix.org/documents/eng/dhcp.html Ismail YENIGUL | ||
DHCP Installation | ||
FreeBSD : OpenBSD
and NetBSD : Linux: #rpm -ivh dhcpd-version.rpm dhclient-version.rpm | ||
DHCP Configuration | ||
We will set up the configuration file
called "dhcpd.conf" The file path is /usr/local/etc/dhcpd.conf on FreeBSD and /etc/dhcpd.conf on OpenBSD & NetBSD & Linux --------------------- sample dhcpd.conf file----------------------- # option definitions common to all supported networks... options domain-name-servers 192.168.1.2 , ns2.enderunix.com ; #options definations for one subnet subnet 192.168.1.0 255.255.255.0 { host freefall { -------------------dhpcd.conf end------------------------- subnet 192.168.1.0 255.255.255.0: the subnet and it's subnet
mask that dhcpd will serve default-lease-time TIME: TIME should be length in seconds that will be assigned to a lease; if the client requesting the lease does not ask for a specific expiration time max-lease-time TIME; Time should be the maximum length in seconds that will be assigned to a lease; if the client requesting the lease asks for a specific expiration time host freefall { you can assing static IP's to some clients. above we assigned
192.168.1.10 IP address to Note: As you see freefall's IP address is out of range! and freefall's domain is enderunix.net not enderunix.com (because general domain name is enderunix.net) | ||
Running DHCP | ||
Before running dhcpd be sure dhat /var/db/dhcpd.leases
file exists. if not create it:
#touch /var/db/dhcpd.leases dhcpd.leases contains information on leased IPs when you make changes on dhcpd.conf file you must at kill and restart
dhcpd daemon. | ||
Configuring Clients | ||
FreeBSD: OpenBSD & NetBSD: echo dhcp >/etc/hostname.fxp0 Linux: on Redhat & Mandrake write BOOTPROTO=dhcp on All UNIX and UNIX like OS you can run dhcpclient manually to get an
IP Windows: Start->Settings -> Control Panel ->Network ->TCP/IP -> Obtain an IP address automatically
| ||
DHCP Server Startup Configuration | ||
FreeBSD: create dhcp.sh and write it ##################### #!/bin/sh /usr/local/sbin/dhcpd fxp0 -q ##################### OpenBSD & NetBSD : add following value to /etc/rc.conf Linux: add following value to /etc/rc.d/rc.local | ||
Resources: | ||
man dhcpd
|