What Is DHCP Option 82? Relay Agent Information Explained

Published · Updated · Networking

cover image for article

DHCP Option 82 is the DHCP Relay Agent Information Option. It lets the network infrastructure attach context to a client’s DHCP request before that request reaches the server. The DHCP server can then make an address or configuration decision based on where the request entered the network, not just on a MAC address or client-supplied identifier.

That distinction matters. A client’s MAC address, hostname, and DHCP client ID are useful inputs, but they originate on an endpoint you may not fully trust. Option 82 is supplied by a relay agent or access device you deliberately trust. It is a policy input, an audit trail, and sometimes a control against address exhaustion and spoofing. It is not, however, magic DHCP authentication.

Why ordinary DHCP context is not always enough

Basic DHCPv4 gives a server enough information to select a subnet through the relay address (giaddr) and enough client identity to maintain a lease. That is fine for a conventional VLAN where one pool serves one broadcast domain.

It becomes limiting when one centralized DHCP service needs to distinguish between many attachment points: switch ports, access circuits, subscriber lines, building floors, or isolated tenant networks. The server may need to answer questions such as:

  • Did this request arrive from the expected access port?
  • Should this device receive an address from a special pool or an ordinary user pool?
  • How many leases should a particular access circuit receive?
  • Which physical attachment point held this address when an incident occurred?

Using a MAC address alone is a weak answer to several of those questions. It can change, be randomized, or be spoofed. DHCP Option 82 gives the server a value inserted by the network path, assuming that path is genuinely trustworthy.

What the relay agent adds

Option 82 is DHCP option code 82 and acts as a container for relay-supplied sub-options. The two foundational sub-options from RFC 3046 are:

  • Circuit ID (sub-option 1): an identifier local to the relay agent for the circuit or attachment point on which it received the client request. Depending on the platform, that might represent a switch port, an interface, or another access-circuit identifier. It is not necessarily a MAC address or the relay’s own IP address.
  • Remote ID (sub-option 2): an identifier for the remote end of the access circuit. The standard requires it to be globally unique. In practice, its meaning and representation are vendor- and deployment-specific.

Treat both values as opaque strings. Do not build a policy that tries to parse a vendor’s encoded Circuit ID into a VLAN or port number with clever string arithmetic. Exact matching against documented values is far more durable, and it is what the RFC recommends.

The names can be a little misleading. Circuit ID is usually the best practical answer to “where did this request enter this relay?” Remote ID is a separate, globally unique identity for the far end. Neither field is automatically meaningful until you inspect what your relay actually emits.

The packet lifecycle: add, echo, remove

Option 82 belongs in the client-to-server leg of a relayed DHCP exchange. The normal flow is:

  1. A client broadcasts a DHCPDISCOVER or DHCPREQUEST on its local segment.
  2. A configured relay agent receives it, sets relay context, and appends Option 82 before forwarding it toward the DHCP server.
  3. The server uses the relay context and Option 82, if it supports the option, to select policy and returns its reply with Option 82 echoed unchanged.
  4. The relay agent removes Option 82 before sending the reply to the client.

The client normally never needs to see the relay metadata. That echo-and-strip behavior is important: the relay needs the information to return a broadcast reply on the correct access circuit, while the server sees the trusted context on both sides of the transaction.

There are two operational consequences worth remembering. First, a server that does not understand Option 82 can ignore it, so merely enabling insertion does not prove that policy is being applied. Second, clients can renew leases by unicast. Relays are not required to inspect or modify every direct unicast DHCP message, so server policy must not assume Option 82 is present on every packet.

What Option 82 is good for

The strongest use cases involve a central DHCP service and a trustworthy access layer.

Location-aware address and option policy

The server can map a relay and Circuit ID to a pool, address reservation, DNS option set, PXE behavior, or other DHCP configuration. This is useful when a single routed domain contains distinct access policies that are too granular for the relay address alone.

Better operational evidence

Lease records that include the relay address plus Circuit ID make an incident much easier to investigate. An IP address can then lead back to a particular network attachment point, not merely to whatever MAC address the client offered. Because Circuit ID is relay-local, include the relay identity in reports and logs; the same Circuit ID value can mean something different on another relay.

Lease limits and anti-spoofing policy

In an access-network design, the server can restrict how many addresses a trusted Remote ID may receive. Combined with access-layer enforcement, this can reduce straightforward DHCP exhaustion attacks and make MAC or client-ID spoofing less useful. It is a policy system, though—not proof that every client is legitimate.

The trust boundary is the whole point

Option 82 is valuable only when the relay agent, the path to the DHCP server, and the way Option 82 enters that path are controlled. The RFC explicitly relies on a trusted relay-to-server relationship; it does not add cryptographic client authentication.

That leads to a rule that is easy to miss: a first-hop relay receiving a packet from an untrusted access circuit that already contains Option 82 should drop it rather than trust client-injected relay information. A downstream trusted network element can be an exception, but it must be an intentional one.

In practical switch networks, pair Option 82 with DHCP snooping and a clear trusted-port design. Access ports should not be able to impersonate an upstream DHCP server or relay. Uplinks, relay-facing ports, and any downstream device permitted to insert Option 82 need an explicit, reviewed trust relationship. A casual “trust all” configuration defeats the useful part of the design.

Read Demystifying DHCP: A Network Engineer’s Guide for the broader DHCP relay and snooping model before treating Option 82 as an isolated feature.

A safe rollout sequence

Do not enable Option 82 globally and discover its policy effects during a busy morning. Start with one controlled VLAN or access segment.

  1. Capture a known-good relay exchange. Record the relay address, current DHCP options, and the client’s existing lease behavior.
  2. Enable insertion in the smallest safe scope. Confirm the relay emits the expected Circuit ID and Remote ID values. Write down the literal values before designing server rules around them.
  3. Make the server echo and log the option. Verify that its lease records show the relay context and that the response reaches the client. If the server silently ignores the option, stop there; a policy rollout would be theater.
  4. Add one narrow policy. For example, choose a known pool based on one exact relay-plus-Circuit-ID match. Test both the intended client and an adjacent port.
  5. Test failure behavior. Check a malformed or unexpected option, an untrusted port, a full pool, a client renewal, and the rollback path. Decide whether the safe failure is a generic lease, no lease, or an alert.
  6. Roll out with observability. Track DHCPNAKs, relay errors, snooping drops, lease utilization, and new unknown Circuit IDs. A change that only works in the happy-path packet capture is not complete.

Where the Cisco examples fit

The rest of this article is deliberately vendor-neutral. If your deployment uses older Cisco Catalyst switching and Cisco IOS relays, the configuration follow-ons remain useful context:

Those posts should be read as platform-era configuration starting points, not copy-and-paste authority for a current IOS or IOS XE deployment. Confirm exact commands, supported Option 82 behavior, and default trust handling against the release and hardware you operate.

Option 82 turns topology into policy

DHCP Option 82 is most useful when you need centralized address management without losing the context of the access network. It gives the DHCP server a trusted statement about where a request entered the network, which supports better lease policy, better records, and better security controls.

The caveat is just as important: the information is only trustworthy if the infrastructure that supplied it is trustworthy. Design and test that boundary first. Then let the server use Option 82 to make a narrow, explainable policy decision—not a sprawling pile of assumptions about strings in a DHCP packet.

For more networking and systems notes, visit Slaptijack.

Slaptijack's Koding Kraken