top of page
chiecrafunexator

All About DHCP



DHCP is a client-server protocol in which servers manage a pool of unique IP addresses, as well as information about client configuration parameters. The servers then assign addresses out of those address pools. DHCP-enabled clients send a request to the DHCP server whenever they connect to a network.


An option exists to identify the vendor and functionality of a DHCP client. The information is a variable-length string of characters or octets which has a meaning specified by the vendor of the DHCP client. One method by which a DHCP client can communicate to the server that it is using a certain type of hardware or firmware is to set a value in its DHCP requests called the Vendor Class Identifier (VCI) (Option 60). This method allows a DHCP server to differentiate between the two kinds of client machines and process the requests from the two types of modems appropriately. Some types of set-top boxes also set the VCI (Option 60) to inform the DHCP server about the hardware type and functionality of the device. The value to which this option is set gives the DHCP server a hint about any required extra information that this client needs in a DHCP response.




All about DHCP




In order for rebinding to work, when the client successfully contacts a backup DHCP server, that server must have accurate information about the client's binding. Maintaining accurate binding information between two servers is a complicated problem; if both servers are able to update the same lease database, there must be a mechanism to avoid conflicts between updates on the independent servers. A proposal for implementing fault-tolerant DHCP servers was submitted to the Internet Engineering Task Force, but never formalized.[26][c]


Another extension, Authentication for DHCP Messages (RFC 3118), provides a mechanism for authenticating DHCP messages. As of 2002, RFC 3118 had not seen widespread adoption because of the problems of managing keys for large numbers of DHCP clients.[36] A 2007 book about DSL technologies remarked that:


Here is a sample configuration. R1 is the DHCP client to R3. The server has a DCHP pool for subnet 10.0.0.0/24 configured, with TFTP, DNS and WINS servers set. All servers belong to the Ethernet segment connected to R3. R1 imports those settings from R3. Notice the use of the Dialer interface in R1 - you cannot configure "ip address dhcp" on the physical interface, as this feature was intended for use with PPPoE/PPPoA interfaces. Also, pay attention to the "ip unnumbered" command on R3's PPP interface. It is important to have this command, so that incoming DHCP REQ packets are matched against R3's DHCP pool.


R3#show ip dhcp binding Bindings from all pools not associated with VRF: IP address Client-ID/ Lease expiration Type Hardware address/ User name 10.0.0.2 0063.6973.636f.2d30. May 04 2009 10:21 AM Automatic 3030.642e.6564.6338. 2e34.6636.302d.4469. 31


$ ipconfig getpacket en0dhcp_message_type (uint8): ACK 0x5server_identifier (ip): 192.168.0.1lease_time (uint32): 0xf20subnet_mask (ip): 255.255.255.0router (ip_mult): 192.168.0.1domain_name_server (ip_mult): 116.1.12.4, 116.1.12.5end (none):


Now you should know whether dhcp details are accurate, the DHCP lease needs to be renewed, or for relaying to another source for further information. The ipconfig command can also renew a DHCP lease if necessary.


To display the status of the DHCP service, use the show ip dhcp EXEC command. If you add the keyword binding, this command displays the current DHCP bindings, which include the assigned IP addresses, the associated client MAC addresses, and the lease expiration time:


This chapter describes what you need to do before setting up DHCP service on your network. The planning information is targeted for use with DHCP Manager, although you can also use the command-line utility dhcpconfig to set up DHCP service.


The DHCP configuration process can look up some network information from the server's system and network files. "Updating System Files and Netmask Tables" discusses these files. However, you might want to give clients other service information, which you must enter into the server's databases. As you examine yournetwork topology, record the IP addresses of any servers you want your clients to know about. The following are some examples of network services you may have on your network that the DHCP configuration does not find out about:


Configure the ports on your switches to assign devices to different physical LANs. This preserves the mapping of one LAN to one IP network required for Solaris DHCP. See the documentation for the switch for information about port configuration.


You must be sure the information in the system files is current before running DHCP Manager or dhcpconfig to configure your server. If you notice errors after configuring the server, manually change macros on the server to update the dhcptab configurationtable.


The following table lists some of the information gathered during DHCP server configuration, and the sources for the information. Be sure this information is set correctlyon the server before you configure DHCP on it. If you make changes to the system files after configuring the server, you should rerun DHCP Manager or dhcpconfig to pick up the changes.


DHCP server uses /etc/resolv.conf to look up DNS parameters such as DNS domain name and DNS server addresses. See (link to "Setting Up DNS Clients" section of the Solaris Naming Setup and Configuration Guide) for more information about resolv.conf.


This section discusses some of the decisions to make before configuring the first DHCP server on your network. The topics parallel the dialogs in the DHCP Manager's Configuration Wizard, but the information is also useful if you decide to use the dhcpconfig utility to configurethe server.


This section discusses the decisions you need to make when configuring IP addresses to be managed by DHCP. The topics parallel the dialogs of DHCP Manager's Address Wizard, but can also be used to makedecisions if you use the dhcpconfig utility.


The client names are not automatically added to the DNS domain, thus the client names are not known outside your name service (NIS/NIS+) domain. However, you can load them into DNS manually. See "Administering DNS"in Solaris Naming Administration Guide and the in.named(1M) manual page for more information about DNS.


Server macro, named using the server's host name, and containing information about the lease policy, time server, DNS domain, and DNS server, and possibly other information that the configuration program was able to obtain from system files. This macro includes the locale macro.


While configuring IP addresses for the first network, you must select a client configuration macro to be used for all DHCP clients using the addresses you are configuring. By default, the server macro is selected because it is contains information needed by all clients using this server. Clientsreceive the options contained in the network address macro before those in the server macro. See "Order of Macro Processing" for more information about macro processing order.


The lease type determines whether the lease policy (lease time and negotiation) is used for the addresses you are configuring. During initial server configuration, DHCP Manager allows you to select eitherdynamic or permanent leases for the addresses you are adding. The dhcpconfig utility allows only dynamic leases.


Set up the servers to scan the options and macros in the dhcptab file at specified intervals so they each are using the latest information. You can do this by using the -t option with in.dhcpd(1M).


After you have gathered information and made decisions, as outlined in the previous sections, you are ready to configure a DHCP server. You can use the graphical DHCP Manager or the command-line utility dhcpconfig to configure a server. Each tool lets you select options and typein data that is then used to create the dhcptab and network tables used by the DHCP server.


The dhcpconfig utility is a wrapper script for the dhtadm and pntadm commands. The dhcpconfig utility prompts you for server startupoptions such as the interval for reading the dhcptab, the timeout value for DHCP service offers, and so on. It obtains other information from the system files discussed in "Updating System Files and Netmask Tables". You cannot view the information it obtains from system files, so it is importantthat the system files be updated before running dhcpconfig.


Most of the answers above are partial. And to be honest there is no simple solution. 1) You can parse the dhcpd.leases database file and get information on active leases, but you will not get information on any FIXED addresses (assigned by a line like:


But what you should really do is to do BOTH. First parse the log file, and then update the file with information obtained from dhcpd.leases file with database for missing information like lease start-end etc.


The format of the leases files has changed, or at least it is different when using dhcpcd5. To view the lease you have on wlan0 for the WiFi network MyNetwork, you'd have to look at this file (or something like it): /var/lib/dhcpcd5/dhcpcd-wlan0-MyNetwork.lease.


That file is a binary file. (Why? I don't know. Maybe to save some precious CPU cycles in parsing it? Blech.) To view it, use the dhcpcd --dumplease, which parses the binary from STDIN and outputs a human-readable version:


We use cookies on our websites to deliver our online services. Details about how we use cookies and how you may disable them are set out in our Privacy Statement. By using this website you agree to our use of cookies.


Damon Garn owns Cogspinner Coaction, LLC, a technical writing, editing, and IT project company based in Colorado Springs, CO. Damon authored many CompTIA Official Instructor and Student Guides (Linux+, Cloud+, Cloud Essentials+, Server+) and developed a broad library of interactive, scored labs. He regularly contributes to Enable Sysadmin, SearchNetworking, and CompTIA article repositories. Damon has 20 years of experience as a technical trainer covering Linux, Windows Server, and security content. He is a former sysadmin for US Figure Skating. He lives in Colorado Springs with his family and is a writer, musician, and amateur genealogist. More about me 2ff7e9595c


1 view0 comments

Recent Posts

See All

Comments


!
Widget Didn’t Load
Check your internet and refresh this page.
If that doesn’t work, contact us.
bottom of page