dhcp mike o’connor eric tallman matt yasiejko. overview dhcp defined dhcp defined how it works how...

21
DHCP DHCP Mike O’Connor Mike O’Connor Eric Tallman Eric Tallman Matt Yasiejko Matt Yasiejko

Upload: roger-preston

Post on 04-Jan-2016

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

DHCPDHCP

Mike O’ConnorMike O’Connor

Eric TallmanEric Tallman

Matt YasiejkoMatt Yasiejko

Page 2: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

OverviewOverview

DHCP definedDHCP defined How it worksHow it works InstallationInstallation dhcpd.confdhcpd.conf rc.confrc.conf

Page 3: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

DHCP definedDHCP defined DHCP – Dynamic Host Configuration DHCP – Dynamic Host Configuration

ProtocolProtocol Uses UDP (User Datagram Protocol)Uses UDP (User Datagram Protocol)

Broadcasts without error correctionBroadcasts without error correction

Allows systems to connect to a Allows systems to connect to a network and be assigned necessary network and be assigned necessary network informationnetwork information IP address, subnet, lease periodIP address, subnet, lease period

Page 4: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

DHCP definedDHCP defined Simplifies network administrationSimplifies network administration

Automatically assigns and keeps track of IP Automatically assigns and keeps track of IP Addresses on the networkAddresses on the network

Eliminates the necessity of assigning static IP Eliminates the necessity of assigning static IP AddressesAddresses

Static IP can be assigned using DHCP in configurationStatic IP can be assigned using DHCP in configuration Developed from BOOTPDeveloped from BOOTP

Introduced the idea of a lease and IP bindingIntroduced the idea of a lease and IP binding Purposes:Purposes:

Provide persistent storage of network Provide persistent storage of network parameters for network clientsparameters for network clients

Allocation of temporary or permanent network Allocation of temporary or permanent network (IP) addresses to clients(IP) addresses to clients

Page 5: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

DHCP – How it worksDHCP – How it works

http://www.tarunz.org/~vassilii/TAU/protocols/dhcp/timeline.htm

Page 6: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

DHCPDISCOVERDHCPDISCOVER

Client finds out which machines out there Client finds out which machines out there are providing a DHCP serverare providing a DHCP server

Page 7: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

DHCPOFFERDHCPOFFER

Server responds to DHCPDISCOVER with Server responds to DHCPDISCOVER with possible configuration parameters for the possible configuration parameters for the networknetwork

The client collects various DHCPOFFER The client collects various DHCPOFFER responsesresponses

Page 8: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

DHCPREQUESTDHCPREQUEST Chooses possible actionChooses possible action

Gets parameters from one server and declines all othersGets parameters from one server and declines all others Missing use defaults; get all; get only requestedMissing use defaults; get all; get only requested

Verifies correctness of parameters of previous Verifies correctness of parameters of previous allocationallocation

Negotiates extended lease of a network addressNegotiates extended lease of a network address

Page 9: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

DHCPACK / DHCPNAKDHCPACK / DHCPNAK

Server responds with an ACK or NAKServer responds with an ACK or NAK ACK – initialization of client completeACK – initialization of client complete NAK – client has invalid network informationNAK – client has invalid network information

Page 10: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

Use a previous allocationUse a previous allocation Old configuration Old configuration

locatedlocated Server sends Server sends

DHCPACK to clientDHCPACK to client Other DHCPACKs Other DHCPACKs

ignoredignored

IP-subnet-number, IP-subnet-number, hardware-address hardware-address key to find old key to find old configuration configuration parametersparameters

Page 11: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

DHCP Message FormatDHCP Message Format

http://www.tarunz.org/~vassilii/TAU/http://www.tarunz.org/~vassilii/TAU/protocols/dhcp/frame.htmprotocols/dhcp/frame.htm

Format used in the handshake Format used in the handshake between client and server to pass between client and server to pass network informationnetwork information

DHCPINFORMDHCPINFORM

Page 12: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

DHCP – IP AllocationDHCP – IP Allocation

Automatic allocation – DHCP assigns Automatic allocation – DHCP assigns a permanent address, no human a permanent address, no human interferenceinterference

Dynamic allocation – DHCP assigns Dynamic allocation – DHCP assigns an IP for a lease periodan IP for a lease period

Manual allocation – Network Manual allocation – Network administrator assigns an IPadministrator assigns an IP

Page 13: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

DHCP Lease DatabaseDHCP Lease Database

/var/lib/dhcp/dhcpd.leases stores the /var/lib/dhcp/dhcpd.leases stores the DHCP client lease database DHCP client lease database

Lease lengthLease length To whom the IP is assignedTo whom the IP is assigned MAC addressMAC address

Page 14: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

DHCP Lease DatabaseDHCP Lease Databaselease 134.198.161.99 {lease 134.198.161.99 { starts 2 2005/03/01 18:45:39;starts 2 2005/03/01 18:45:39; ends 2 2005/03/01 18:55:39;ends 2 2005/03/01 18:55:39; tstp 2 2005/03/01 18:55:39;tstp 2 2005/03/01 18:55:39; binding state free;binding state free; hardware ethernet 00:c0:f0:30:d7:11;hardware ethernet 00:c0:f0:30:d7:11; uid "\001\000\300\3600\327\021";uid "\001\000\300\3600\327\021";}}lease 134.198.161.98 {lease 134.198.161.98 { starts 4 2005/03/03 03:01:59;starts 4 2005/03/03 03:01:59; ends 4 2005/03/03 03:11:59;ends 4 2005/03/03 03:11:59; binding state active;binding state active; next binding state free;next binding state free; hardware ethernet 00:e0:4c:96:f3:95;hardware ethernet 00:e0:4c:96:f3:95; client-hostname "lab112.research.cs.uofs.edu";client-hostname "lab112.research.cs.uofs.edu";}}*courtesy of Robert Huylo and Ana Chanaba *courtesy of Robert Huylo and Ana Chanaba

http://www.cs.uofs.edu/%7Eplishka/cmps354/DHCP1.ppthttp://www.cs.uofs.edu/%7Eplishka/cmps354/DHCP1.ppt

Page 15: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

Defining the subnetDefining the subnet

10000110.11000110.10100001.01101100 (134.198.161.106) BITWISE AND11111111.11111111.11111000.00000000 (255.255.248.0)--------------------------------------------------------------------------10000110.11000110.10100000.00000000 (134.198.160.0)

Subnet

Page 16: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

Installing DHCP ServerInstalling DHCP Server

Ensure that the Ensure that the bpfbpf device is device is compiled in the kernelcompiled in the kernel Berkeley Packet Filter Berkeley Packet Filter Provides a raw interface to data link Provides a raw interface to data link

layers in a protocol independent fashionlayers in a protocol independent fashion Install the net/isc-dhcp3-server portInstall the net/isc-dhcp3-server port

Make install cleanMake install clean

Page 17: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

Installing DHCP ServerInstalling DHCP Server

cp cp /usr/local/etc/dhcpd.conf.sample /usr/local/etc/dhcpd.conf.sample /usr/local/etc/dhcpd.conf/usr/local/etc/dhcpd.conf Modify dhcpd.confModify dhcpd.conf

Page 18: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

dhcpd.confdhcpd.conf

dhcpd.confdhcpd.conf file file Domain Name System (DNS)Domain Name System (DNS)

ddns-update-style none; ddns-update-style none;

host mailhost {host mailhost {

hardware ethernet 02:03:04:05:06:07;hardware ethernet 02:03:04:05:06:07;

fixed-address mailhost.example.com; }fixed-address mailhost.example.com; } Assign IP Addresses based on MAC Assign IP Addresses based on MAC

AddressesAddresses

Page 19: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

Installing DHCP ServerInstalling DHCP Server

Start the serverStart the server /usr/local/etc/rc.d/isc-dhcpd.sh start /usr/local/etc/rc.d/isc-dhcpd.sh start

Modify rc.conf to make the daemon Modify rc.conf to make the daemon run on startuprun on startup

Page 20: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

rc.confrc.conf

hostname=“lab6.research.cs.uofs.edu”hostname=“lab6.research.cs.uofs.edu”ifconfig_dc0=“inet 134.198.161.106 ifconfig_dc0=“inet 134.198.161.106

netmask 255.255.248.0”netmask 255.255.248.0”defaultrouter=“134.198.161.254”defaultrouter=“134.198.161.254”hostname=“lab6.research.cs.uofs.edu”hostname=“lab6.research.cs.uofs.edu”dhcpd_enable=“YES”dhcpd_enable=“YES”dhcpd_conf=“/usr/local/etc/dhcpd_conf=“/usr/local/etc/

dhcpd.conf”dhcpd.conf”sshd_enable=“YES”sshd_enable=“YES”

Page 21: DHCP Mike O’Connor Eric Tallman Matt Yasiejko. Overview DHCP defined DHCP defined How it works How it works Installation Installation dhcpd.conf dhcpd.conf

ResourcesResources

http://www.freebsd.org/doc/en_US.Ihttp://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-SO8859-1/books/handbook/network-dhcp.htmldhcp.html

http://www.tarunz.org/~vassilii/TAU/http://www.tarunz.org/~vassilii/TAU/protocols/dhcp/toc.htmprotocols/dhcp/toc.htm

RFC 2131RFC 2131