FAQ: DHCP for IPv4

These are some questions you may have had about DHCP but were afraid to ask. I have a ranking of 1-10 regarding knowledge level someone has that might prompt them to ask a particular question. It is a parenthetical number proceeding each question.

There is a brief answer just below each question, but click for details.

Q: What is the purpose of DHCP? (1)

A: Give clients critical information about participating on the network.

I would break this into two sections:

  • Critical information: IP address, subnet mask, default gateway, DNS servers
  • Additional information: Tons of optional details that clients might need to be successful

Q: What are the phases of DHCP? (2)

A: Remember DORA – Discovery, Offer, Request, Acknowledgement
  • Discovery – client sends a broadcast to search for a DHCP server
  • Offer – all servers that receive the request respond with relevant network information, meaning the list of options it gives generally correspond to the client’s specified list of options it is interested in receving.
  • Request – client officially requests an address and other information from a particular server
  • Acknowledgement – server acknowledges that client now owns a particular IP address and accompanying options

Q: What are DHCP options and what are the most common ones? (3)

A: DHCP options are just that: optional. Although some of them are pretty critical…

Subnet mask (1), gateway (3), DNS servers (6), domain name (15), lease time (51)

The official list of options is maintained by IANA and can be accessed here.

Q: How do I know what options a client will get during a Discovery & Request (D/R)? (4)

A: The server (typically) only hands out the options the client asks for, specified by Option 55 in the D/R

Q: What is DHCP option 43 and why is it special? Does it have to do with Option 60? (6)

It’s for “vendor-specific” attributes… see details and examples below.

Explanation

Option 43 is for “vendor specific” attributes. It also has “sub-options,” and is often tied to the “vendor class identifier” defined in Option 60 of the D/R packets.

For example, Vendor “ABC” (identified by Option 60 in the request packet), if it asks for an Option 43, and the server is configured to hand a particular Option 43 to that vendor, it will. Servers can usually have multiple vendor/Option 43 definitions, so if Vendor A requests Option 43, it will get one answer, and if Vendor B request Option 43, it will get a different answer, depending on the configuration.

Specific Example 1

Calix GigaSpire u10xe RG needs to find its Auto Configuration Server (ACS). Its Option 60 specified in the request might be GS4237.ONT.dslforum.org. If the DHCP server is aware of that Vendor Class ID, it may respond with DHCP option 43 with sub-option 0x01, which specifies the ACS.

Specific Example 2

Cisco APs can locate a WLAN Controller (WLC) in this manner. In this case, it’s looking for Option 43 sub-option 0xF1 (241 in decimal), which specifies the IP address(es) of the WLC(s).

Another Note

Configuring the server to pay attention to the client’s Option 60 in the D/R is completely optional. If you don’t care if all your clients get the same option 43 information, don’t bother to match on option 60 stuff, as it can just cause a headache (for example, I now have a Calix GS5237 in my network, but I’m only sending ACS information for GS4237).

Q: What is DHCP option 82 and why is it special? (7)

Option 82 allows intermediate devices to inject information into the DHCP request, so that the server can make decisions or at minimum log information about the intermediate device(s).

Like option 43, option 82 has sub-options:

  • Sub-option 1 specifies the Agent Circuit ID
  • Sub-option 2 specifies the Agent Remote ID

These are somewhat arbitrary and depending on use cases, some vendors will prefer you treat them in particular ways. You can also use D/R option 60 to tailor the responses, as you can with Option 43.

Q: What are important DHCP RFCs? (8)

A: This list is below with a brief description of each
  • DHCP itself: RFC2131
  • DHCP options: RFC2132
  • Option 82-related:
    • Relay agent information (Circuit ID and Remote ID): RFC3046
    • Relay agent information (Subscriber ID): RFC3993

Q: How do lease times work? (5)

A: There are various options that define it:
  • The server offer/ack indicates:
    • Option 51 – Lease time
    • Option 58 – Renewal time (usually ½ of lease time)
    • Option 59 – Rebinding time (usually â…ž of lease time)
  • This means that halfway through the lease, the client will verify with the server if it’s good to keep its address for another period of time
  • Rebinding time will only happen if renewal failed
  • If the lease time limit is reached, client has to surrender its IP address

Q: If I make an update to the DHCP server configuration, will it reach out to the clients to inform them about it? (5)

A: No, the server has to wait for the client to check in again. A client can do that via…
  • Lease time reaching half its value (usually)
  • Manual renewal
  • Client reboot
  • Disconnecting client cable or Wi-Fi disassociation/reassociation (usually)

Q: What is a static DHCP lease? (3)

A: First of all, I don’t like the term “static” when applied to DHCP…

To me, “static” means you have typed the IP address directly into a device on the network. In DHCP, if you want to guarantee a particular device always gets the same IP address, please please please use the term “reservation.” You configure it by manually entering a MAC address and saying, “This MAC will always get this IP.” You can do more with reservations, though–you can assign specific options in your server’s response. For example, let’s say I want MAC 01:02:03:04:05:06 to use DNS server 9.9.9.9 instead of 8.8.8.8, which is what all my other clients get. If your DHCP server is full-featured, you can do that. Simple DHCP server interfaces often don’t allow such things, though, even if their underlying server allows it.

OpenWrt’s web GUI is a good (bad) example of both of these assertions: It uses the phrase “static lease” and it doesn’t offer additional options for reserved clients, even though the underlying daemon (dnsmasq) does. I hate to pick on OpenWrt here, since I generally think it’s a gift to home routers everywhere.