Title: DHCP Dynamic host configuration protocol
1DHCP (Dynamic host configuration protocol)
DHCP Server - computer running the dhcp service
. . .
DHCP Clients hosts depending on the dhcp service
2DHCP
What do we mean by dynamic?
Would a DHCP client that received exactly the
same settings each time it turned on qualify as
using dhcp?
3DHCP
What do we mean by configuration?
4DHCP
Why use DHCP?
Any modification in network configuration can be
made by
New machines on a LAN can be integrated by
5DHCP - server
1. As root, make sure /etc/sysconfig/network/ifcf
g-eth0 specifies a static IP address (dont want
dhcp server to act as a dhcp client)
6DHCP - server
The d is for daemon or server
2. As root, in /etc create a file called
dhcpd.conf
Suse Linux needs this
dhcpd.confddns-update-style noneoption
domain-name "CIS373.net"default-lease-time
1800max-lease-time 7200subnet 192.168.10.0
netmask 255.255.255.0 range 192.168.10.150
192.168.10.200host Computer4 hardware
ethernet 000347F6CF0A fixed-address
192.168.10.222
Other options would be?
Default lease time is 30 minutes max is two
hours.
These are the IP addresses the server is leasing
What is this?
7DHCP - server
3. Remove all traces of any previous dhcp
services
in /var/lib/dhcp, remove dhcpd.leases and
dhcpd.leases rm dhcpd.leases rm dhcpd.leases
4. Create an empty dhcpd.leases file
Still in /var/lib/dhcp touch dhcpd.leases
8DHCP dhcpd.leases example pg 1 of 2
All times in this file are in UTC (GMT), not
your local timezone. This is not a bug, so
please don't ask about it. There is no portable
way to store leases in the local timezone, so
please don't request this as a feature. If
this is inconvenient or confusing to you, we
sincerely apologize. Seriously, though -
don't ask. The format of this file is
documented in the dhcpd.leases(5) manual page.
This lease file was written by isc-dhcp-V3.0.1rc6
What is UTC? http//setiathome.ssl.berkeley.ed
u/utc.html http//en.wikipedia.org/wiki/UTC
9DHCP dhcpd.leases example pg 2 of 2
lease 192.168.10.200 starts 2 2004/11/23
171047 ends 2 2004/11/23 191047 binding
state active next binding state free
hardware ethernet 000347f6c580 uid
"\001\000\003G\366\305\200" client-hostname
"itl06i" lease 192.168.10.199 starts 2
2004/11/23 171121 ends 2 2004/11/23
191121 binding state active next binding
state free hardware ethernet
000347f6dacb uid "\001\000\003G\366\332\31
3" client-hostname "itl07i"
Why is this dhcp server handing out these
particular IP addresses?
10DHCP - server
5. Start the service
In /etc/init.d, enter this command ./dhcpd start
Reminder what does ./ mean???
Once you have removed all syntax errors from
dhcpd.conf, you will see
11DHCP - server
6. Confirm the service
As root, issue this command ps ef grep dhcp
12DHCP - client
1. Configure client to use dhcp
In /etc/sysconfig/network, be sure ifcfg-eth0
sets the interface up to use dhcp
13DHCP - client
2. Remove all traces of previous dhcp leases
In /var/lib/dhcpcd, remove dhcpcd-eth0.info and
dhcpcd-eth0.cache But dont remove dhcpcd-eth0.
timestamp
14DHCP - client
dhcpcd-eth0.info
IPADDR192.168.10.200NETMASK255.255.255.0NETWOR
K192.168.10.0BROADCAST192.168.10.255DOMAINCI
S373.netDNS192.168.10.1DHCPSID192.168.10.1DHC
PGIADDR0.0.0.0DHCPSIADDR192.168.10.1DHCPCHADDR
000347F6C580DHCPSHADDR000347F6DB49DH
CPSNAMELEASETIME7200RENEWALTIME3600REBINDTIM
E6300INTERFACEeth0CLASSID"Linux
2.4.18-64GB-SMP i686"CLIENTID000347F6C580
15DHCP - client
3. Now when the computer boots, it will look to
find a dhcp server
You can simulate the boot process as far as the
dhcp client is concerned by these commands In
/etc/init.d ./network stop ./network start
16DHCP - client