Sunday 20 July 2014

How to enable DHCP RELAY option 82 on Cisco DHCP Server ?


Option 82 is defined in RFC : 3046 (https://tools.ietf.org/rfc/rfc3046.txt) . It is DHCP Relay Agent Information Option, which includes sub-options "Agent Circuit ID Sub-option" and "Agent Remote ID Sub-option" .

How DHCP Relay works


DHCP Server -----DHCP Relay -------DHCP Client

1) DHCP Client send DHCPOFFER as broadcast packet to DHCP Relay.

2) DHCP Relay knows DHCP Server Ip address, it increments HOP=1, and add DHCP Relay agent address ( its own LAN side IP) and send Unicast packet to DHCP Server

3) DHCP Server understands that its a packet from Relay , sends DHCPOFFER back to Relay agent as unicast packet.

4) DHCP OFFER is forwarded to DHCP Client by Relay.

5) DHCPREQUEST from Client and DHCP-ACK from Server follows the same path as above.

6) DHCP Client is not aware of any DHCP-RELAY in between and the relay acts as if it is DHCP Server.

7) DHCP-Relay is in routing mode , so the interfaces ip address are different.


Option 82

Option 82 is required if there are multiple DHCP Relay in between and each relay is to be assigned from a different pool of IP address. The IP address will be assigned based on Agent id and Circuit id which is to be defined properly in Server.

How to enable option 82 in Cisco DHCP Server

192.168.7.1 192.168.7.2 10.0.0.1
Cisco DHCP Server -----Fedora 11 Linux DHCP Relay -----Windows XP DHCP Client

In this setup we will see how we can enable option 82 in both Linux DHCP Relay agent and CISCO DHCP Server.

Linux DHCP Relay Configuration

1) Download and install latest dhcrelay rpm, I have used isc-dhcrelay-4.2.2rc1

2) Start dhcrelay be giving below command

dhcrelay -a -d -i eth1 -i eth2 192.168.7.1

The -a option enable option 82 in Linux DHCPRelay, open Wireshark and note down the value of Option 82.

Cisco DHCP Server Configuration for option 82

configure t
ip dhcp use class

ip dhcp class relay1
  relay agent information
     relay-information hex 01060240234*

ip dhcp pool pool1
  network 10.0.0.0 255.0.0.0
  default-gateway 10.0.0.1
  class relay1

     address range 10.0.0.10 10.0.0.20

ip route 10.0.0.0 255.0.0.0 192.168.7.2


The hex "01060240234*" information is the Value seen in option 82 of Client DHCPDISCOVER , bootp options. if you have multiple dhcp-relay in network you can add the  class, pool and static route to reach the specific relay and the DHCP server will assign the IP address range as per the RELAY agent configured range.

DHCP Client

ipconfig /release

ipconfig /renew

Client should get IP address 10.0.0.10


In Windows 2012 Server the option 82 can be matched against the option 82 value or with sub-options 
Agent id or Remote Circuit id.

Keep Learning , Keep Sharing!