Download presentation
Presentation is loading. Please wait.
Published byRuth Fitzgerald Modified over 9 years ago
1
DHCP ITL
2
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman2 Dynamic Host Configuration RFC 2131 – DHCP RFC 2132 – DHCP Options RFC 951 - BOOTP
3
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman3 Overview How to Configure Hosts that –Should not store this information (for manageability) –Cannot store configuration info locally RARP – limited usefulness BOOTP – designed for diskless workstations DHCP – update of BOOTP (more options)
4
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman4 DHCP Process Flow Client –broadcast dhcpdiscover –send dhcprequest –send dhcprelease Server(s) –send dhcpoffer –send dhcpack
5
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman5 DHCP Process Flow, cont. Client renews –broadcast dhcprequest –send dhcprelease Server(s) –send dhcpack
6
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman6 DHCP Process Flow, cont. Client moved –send dhcprequest –broadcast dhcpdiscover –send dhcprequest –send dhcprelease Server(s) –send dhcpnack –send dhcpoffer –send dhcpack
7
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman7 DHCP Message Structure 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | op (1) | htype (1) | hlen (1) | hops (1) | +---------------+---------------+---------------+---------------+ | xid (4) | +-------------------------------+-------------------------------+ | secs (2) | flags (2) | +-------------------------------+-------------------------------+ | ciaddr (4) | +---------------------------------------------------------------+ | yiaddr (4) | +---------------------------------------------------------------+ | siaddr (4) | +---------------------------------------------------------------+ | giaddr (4) | +---------------------------------------------------------------+ | | | chaddr (16) | | | +---------------------------------------------------------------+ | | | sname (64) | +---------------------------------------------------------------+ | | | file (128) | +---------------------------------------------------------------+ | | | options (variable) | +---------------------------------------------------------------+ in UDP:
8
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman8 Protocol Fields from RFC2131 op: Message op code / message type 1 = BOOTREQUEST, 2 = BOOTREPLY htype: Hardware address type '1' = 10mb ethernet. hlen: Hardware address length ‘6’ for 10mb ethernet hops: Client sets to zero, optionally used by relay agents when booting via a relay agent. xid Transaction ID, a random number chosen by the client
9
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman9 Fields cont. secs: Filled in by client, seconds elapsed since client began address acquisition or renewal process. flags: Used to request broadcast reply ciaddr: Client IP address; only filled in if client is in BOUND, RENEW or REBINDING state and can respond to ARP requests. yiaddr: 'your' (client) IP address. siaddr: IP address of next server to use in bootstrap; returned by server.
10
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman10 Fields cont. giaddr: Relay agent IP address chaddr: Client hardware address. sname: Optional server host name file: Boot file name Options: Optional parameters field
11
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman11 DHCP Options Message Format comes from BOOTP –Boot-request and Boot-reply op codes DHCP commands sent as options Many other pieces of information can be sent in optional fields
12
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman12 Option Field Structure Tag (1 octet) –0 – pad, 255 – end of options Option Length (1 octet), except for 0 & 255 Option Data Tags 128-254 are reserved for “site specific” options, all others are registered
13
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman13 Option Examples Tag 1 (Length 4) –Subnet Mask Tag 3 (Length 4n) –n Router Addresses Tag 53 (Length 1) –DHCP Message Type
14
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman14 Windows 2000/XP/2003 Windows 2000 IP Configuration Host Name............ : hans-laptop1 Primary DNS Suffix....... : Node Type............ : Hybrid IP Routing Enabled........ : No WINS Proxy Enabled........ : No Ethernet adapter Local Area Connection: Connection-specific DNS Suffix. : Description........... : Intel(R) PRO/100+ MiniPCI Physical Address......... : 00-10-A4-8C-18-7F DHCP Enabled........... : Yes Autoconfiguration Enabled.... : Yes IP Address............ : 132.235.74.219 Subnet Mask........... : 255.255.255.0 Default Gateway......... : 132.235.74.254 DHCP Server........... : 132.235.250.15 DNS Servers........... : 132.235.64.1 132.235.64.2 Primary WINS Server....... : 132.235.234.235 Secondary WINS Server...... : 123.235.197.38 Lease Obtained.......... : Friday, April 20, 2001 08:50:49 Lease Expires.......... : Friday, April 20, 2001 20:50:49
15
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman15 Ipconfig USAGE: ipconfig [/? | /all | /release [adapter] | /renew [adapter] | /flushdns | /registerdns | /showclassid adapter | /setclassid adapter [classidtoset] ] adapter Full name or pattern with '*' and '?' to 'match', * matches any character, ? matches one character. Options /? Display this help message. /all Display full configuration information. /release Release the IP address for the specified adapter. /renew Renew the IP address for the specified adapter. /flushdns Purges the DNS Resolver cache. /registerdns Refreshes all DHCP leases and re-registers DNS names /displaydns Display the contents of the DNS Resolver Cache. /showclassid Displays all the dhcp class IDs allowed for adapter. /setclassid Modifies the dhcp class id.
16
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman16 FreeBSD /sbin/dhclient (see man dhclient) –dhclient -r Release address and exit –dhclient normally starts at boot and uses dhclient.conf to determine which interfaces to request addresses on.
17
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman17 Mac OS X GUI –Turn interface off and back on Reinitializes loadable kernel module and renews DHCP /usr/sbin/ipconfig (???…) –ipconfig set interface mode switches interface settings (e.g. from DHCP to MANUAL and back)
18
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman18 Solaris Two methods –Set up to use DHCP at boot-up –Do it by hand
19
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman19 Make Solaris reboot into DHCP Unix likes to use file-based mechanisms For Solaris –create a file /etc/dhcp.le0 (or whatever the interface is called) usually by touch /etc/dhcp.le0 note: the file /etc/hostname.le0 must exist –Reboot –Note: this is not how we do it in the lab
20
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman20 Set up Solaris/DHCP by hand Create the interface –ifconfig le0 plumb Start the DHCP client (Solaris calls it agent) –/sbin/dhcpagent & see next page for debug options Put the interface under DHCP control –ifconfig le0 dhcp start
21
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman21 Other Controls ifconfig le0 dhcp extend ‘extend the lease ifconfig le0 dhcp release ‘release the address and down the interface ifconfig le0 dhcp status ‘get information /sbin/dhcpagent -d1 -f /sbin/dhcpagent -f -v –both run the DHCP agent in the foreground and request diagnostic information. The latter form is most useful to watch the DHCP process.
22
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman22 DHCP Server on BSD NAME dhcpd - Dynamic Host Configuration Protocol Server SYNOPSIS dhcpd [ -p port ] [ -f ] [ -d ] [ -q ] [ -cf config-file ] [ -lf lease-file ] [ if0 [...ifN ] ] See “man dhcpd” and “man dhcpd.conf”
23
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman23 simple dhcpd.conf file subnet 239.252.197.0 netmask 255.255.255.0 { range 239.252.197.10 239.252.197.250; } See “man dhcpd.conf”
24
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman24 More Complete subnet 239.252.197.0 netmask 255.255.255.0 { range 239.252.197.10 239.252.197.250; default-lease-time 600; max-lease-time 7200; option subnet-mask 255.255.255.0; option broadcast-address 239.252.197.255; option routers 239.252.197.1; option domain-name-servers 239.252.197.2, 239.252.197.3; option domain-name "isc.org"; } # Note: there is a typo in the man page
25
ITL: ©2000-2005 Hans Kruse, Shawn Ostermann, Carl Bruggeman25 The Relay buell(if-config)#ip helper-address ? A.B.C.D IP destination address Router DHCP Server Client
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.