In DHCPv4, how does a printer reservation differ from a static address set on the printer, and which should be the source of truth?
answer
- who holds the record
- the device still runs DHCP
- RFC 2131 manual allocation
- the server cannot see host settings
- static addresses stay out of the pool
basics
~20 sA reservation keeps the printer on DHCP: the server always gives its identifier the same address, with current options. A static address lives only on the printer, invisible to the server, so it must stay out of the pool.
solid answer
~40 sA reservation is what RFC 2131 calls *manual allocation*: the administrator binds an address to the client's identifier (the client identifier option if the client sends one, otherwise its hardware address in `chaddr`) and DHCP simply delivers it. The printer still runs the DHCP exchange, so it receives the address together with today's gateway, DNS servers and lease, and the address plan lives in one place, the server. A static address is configured on the host; the server never learns about it, so that address must sit outside the pool or be excluded from it, or the server will eventually offer it to another client. Use reservations for anything that can run DHCP, and keep static addresses for what DHCP itself depends on: the gateway, the DHCP server and the relay path.
go deeper
Know that a reservation is configured on the server and the device still uses DHCP, while a static address is set on the device and the server cannot see it.
Explain how the server matches a reservation (client identifier first, chaddr otherwise) and why a static address must be excluded from the pool.
Show the conflicts you meet after migrations: duplicate records, idle reserved addresses, and static addresses inside the pool that probes do not reliably catch.
Argue where the address plan's source of truth should live and which few addresses must stay static because DHCP itself depends on them.
## Two ways to pin an address A **dynamic host configuration** server hands out addresses from a **pool**: the range of addresses it may give away. Most devices are fine with whatever address they get. A printer, a badge reader or a file server is not: other machines reach it by address, so it needs the same one every time. There are two ways to get that. | | Reservation | Static address | |---|---|---| | Where it is configured | On the DHCP server | On the device itself | | Does the device run DHCP? | Yes, every boot and every renewal | No | | Does the server know the address is in use? | Yes, it is bound to that client | No | | Who updates gateway or DNS values? | The server, at the next renewal | Someone editing the device | | What can go wrong | The identifier changes, so the reservation stops matching | The address collides with a pool address | ## What RFC 2131 actually defines RFC 2131 describes **three allocation mechanisms**. In *automatic allocation* the server assigns a permanent address; in *dynamic allocation* it assigns an address for a limited time (a **lease**); in *manual allocation* "a client's IP address is assigned by the network administrator, and DHCP is used simply to convey the assigned address to the client". A **reservation** is the everyday name for manual allocation. The words *scope*, *reservation* and *exclusion* are server vocabulary, not RFC terms; the RFC talks about the server's "pool of available addresses". The server recognises the client by an identifier. RFC 2131 says that if the client sends a `client identifier` option the server **MUST** use it, and otherwise it **MUST** use the hardware address in the `chaddr` field. So a reservation is really a binding from *that identifier* to *that address*. ## Why the reservation is usually the better source of truth - **One record.** The address plan lives on the server, where anyone can read it. A static address lives in the device's own settings, invisible from the network. - **Options travel with it.** When the DNS servers move, a reserved printer picks up the new values at its next renewal; a static printer keeps the old ones until someone edits it. - **No double-booking.** The server will not offer a reserved address to anyone else, because the binding is in its own table. - **It is still auditable.** The lease shows when the device last renewed, which a static address never does. ## When a static address is still right 1. **The things DHCP depends on**: the default gateway, the DHCP server itself, and any relay interface between clients and the server. None of them can wait for DHCP to answer. 2. **Devices with no DHCP client**, or devices that must come up when the DHCP service is down. 3. Even then, the address goes **outside the pool range, or into an exclusion**, so the server never offers it. ## When both exist: the conflicts A device that has a reservation *and* a static address is a common mess after a migration. 1. **Same address both ways.** It works, but there are now two records of the truth, and the next change will update only one of them. 2. **Different addresses.** The device uses its static address; the reserved one sits idle and blocks a pool slot, while monitoring and DNS may point at the wrong one. 3. **A static address inside the pool with no exclusion.** The server believes the address is free and will eventually offer it. RFC 2131 has two safety nets: the server **SHOULD** probe an address before reusing it (an ICMP echo is its example), and the client **SHOULD** check the address it receives (ARP is its example) and **MUST** send `DHCPDECLINE` if it finds it in use, after which the server marks the address unavailable. Both are checks at allocation time. A host that drops echo requests defeats the first, and a static address typed in *after* the lease was granted is caught by neither. ## On a 600-device office floor With the gateway at 10.20.0.1 and servers and printers needing fixed addresses, a clean plan keeps the gateway and the DHCP and relay infrastructure static and excluded from the range, gives printers and badge readers reservations, and lets desks and phones draw from the dynamic pool. The server's configuration then answers "who has 10.20.0.37?" on its own.
- The office moves to new DNS servers. What happens to a reserved printer and to a statically addressed one?The reserved printer still runs DHCP, so it receives the new DNS server values from the server at its next renewal, by default at half the lease. The static printer keeps the old values until someone edits it by hand, which is why static devices are the ones that break after a renumbering or a DNS migration.
- A reserved printer is unplugged for a month. Can the server give its address to another client meanwhile?Not under the reservation. Manual allocation binds the address to that identifier by the administrator's decision, and RFC 2131 says dynamic allocation is the only mechanism that reuses an address automatically. That is the cost: a reserved address is spent whether the device is present or not, so reservations for retired devices should be removed.
A reservation is a seat booked through the theatre's box office; a static address is someone simply sitting in a seat. The box office can only avoid selling a seat it knows is taken.
saying these in an interview costs you the question
- A reservation and a static address are the same thing, just configured in two places.
- A reserved device skips the DHCP exchange and simply knows its address.
- A static address inside the pool is safe because the server always pings before offering.
- The DHCP server learns about statically configured hosts from their traffic and avoids them.
- Reserved devices never need lease renewals, so their gateway values cannot change.