# Cisco IOS DHCP Relay Agent

**URL:** <https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121>\
**Category:** Lessons Discussion\
**Created:** [December 27, 2016, 4:01pm UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121 "2016-12-27T16:01:09Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![gaby.ochoa](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/g/f9ae1b/32.png) [@gaby.ochoa](https://forum.networklessons.com/u/gaby.ochoa)\
**Post date:** [June 27, 2019, 12:02am UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/41 "2019-06-27T00:02:05Z")

</div>

Hello guys,  
I wanted to ask if this “giaddress” is the same as the “Relay agent IP address” on a wireshark capture. I was unable to find the variable called “giaddress” in my discover packet that was relayed to the dhcp server. Thank you!

 ![Screenshot%20(16)_LI](https://cdn-forum.networklessons.com/uploads/default/original/2X/e/ebed03b41eb4237cc725994e4ec2030d435f581d.jpeg)

---

<div class="post-metadata">

**Author:** ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)\
**Post date:** [June 27, 2019, 3:49pm UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/42 "2019-06-27T15:49:25Z")

</div>

Hello Martha

Yes, the giaddr is the same as the Relay agent IP address as described in Wireshark. The official name of the field in the DHCP packet is indeed GIADDR as described in [RFC 2131](https://tools.ietf.org/html/rfc2131), but Wireshark simplifies this by describing what the field contains.

I hope this has been helpful!

Laz

---

<div class="post-metadata">

**Author:** ![kent2612](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kent2612](https://forum.networklessons.com/u/kent2612)\
**Post date:** [July 25, 2019, 1:32pm UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/43 "2019-07-25T13:32:10Z")

</div>

Hi Rene,

Please explain more on the DORA process that involves UDP 67 and UDP 68?  
Thanks,

---

<div class="post-metadata">

**Author:** ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)\
**Post date:** [July 26, 2019, 7:52am UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/44 "2019-07-26T07:52:42Z")

</div>

Hello Kenneth

During the exchange of DHCP Discovery, Offer, Request, and Acknowledgement (DORA) packets, the communication between the server and the client in this process takes place at various levels of the OSI model. Although DHCP assigned IP (Layer 3) addresses using, in part, MAC (Layer 2) addresses, DHCP is actually an Application layer protocol. The payload of these exchanged packets are found encapsulated within a UDP datagram.

This means that communication that takes place requires addressing at Layer 4, where UDP operates. For this purpose, UDP ports 67 and 68 are used as the server and client ports respectively. So for a Discovery or Request DHCP message, 67 will be the destination port and 68 will be the source port. For Offer and Acknowledgement messages, those ports will be reversed.

This can be more fully understood by examining Wireshark output of DHCP messages. The following is a capture of a DHCP discover message:

 ![image](https://cdn-forum.networklessons.com/uploads/default/original/2X/8/8104fad25b4b75e1986754f9bf6cbceb7e192381.png)  
Notice that we see Layer 3 IP information, Layer 4 UDP information (with the expected source and destination port numbers), and the Application Layer information found in the Bootstrap Protocol, which is DHCP. (Bootstrap was DHCP’s predecessor, and this name is still there for legacy purposes, whatever that means.)

I suggest you do a search for DHCP messages on cloudshark to further explore the structure of these messages.

I hope this has been helpful!

Laz

---

<div class="post-metadata">

**Author:** ![bvesel](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/bvesel/32/1967_2.png) [@bvesel](https://forum.networklessons.com/u/bvesel)\
**Post date:** [October 11, 2019, 4:32pm UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/45 "2019-10-11T16:32:36Z")

</div>

Hello NetworkLessons Team.

I’m studying DHCP and have got an unusual scenario…“_An engineer enables ip helper-address on interface. But the router isn’t forwarding the DHCP packets that it receives on this interface. How the engineer can resolve this issue_?”

Perhaps in this scenario any default option on the router is disabled. Any idea?

---

<div class="post-metadata">

**Author:** ![fugazz](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/fugazz/32/1330_2.png) [@fugazz](https://forum.networklessons.com/u/fugazz)\
**Post date:** [October 11, 2019, 11:11pm UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/46 "2019-10-11T23:11:48Z")

</div>

Hello Boris,  
the first thing I can think of is to enable the dhcp service using “service dhcp”.

- “service dhcp” is enabled by default
- “ip helper-address” needs dhcp service to be enabled in order to function

---

<div class="post-metadata">

**Author:** ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)\
**Post date:** [October 14, 2019, 5:22am UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/47 "2019-10-14T05:22:17Z")

</div>

Hello Boris

In addition to what @fugazz mentioned, some other things that may cause a DHCP relay agent to fail include:

1. There must be a route from the IP address of the interface to the DHCP server
2. The interface must be up and must be configured with an IP address
3. The `ip helper-address` address configured must be that of an active DHCP server

I hope this has been helpful!

Laz

---

<div class="post-metadata">

**Author:** ![bvesel](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/bvesel/32/1967_2.png) [@bvesel](https://forum.networklessons.com/u/bvesel)\
**Post date:** [October 14, 2019, 9:27am UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/48 "2019-10-14T09:27:11Z")

</div>

Thanks you very much.

---

<div class="post-metadata">

**Author:** ![bvesel](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/bvesel/32/1967_2.png) [@bvesel](https://forum.networklessons.com/u/bvesel)\
**Post date:** [October 14, 2019, 9:39am UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/49 "2019-10-14T09:39:51Z")

</div>

Hello Laz

Both explanations have been helpful. Thanks a lot.

---

<div class="post-metadata">

**Author:** ![maritdelange](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/maritdelange/32/2120_2.png) [@maritdelange](https://forum.networklessons.com/u/maritdelange)\
**Post date:** [December 20, 2019, 3:03am UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/50 "2019-12-20T03:03:22Z")

</div>

Is there a specific reason why a router forwards the offer and acknowledgement messages from the server as a broadcast?

---

<div class="post-metadata">

**Author:** ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)\
**Post date:** [December 20, 2019, 10:28am UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/51 "2019-12-20T10:28:40Z")

</div>

Hello Marit

All of the communication that takes place between the DHCP relay and the DHCP host occur based on the regular DHCP process as described in this lesson:

[https://networklessons.com/cisco/ccie-enterprise-infrastructureintroduction-to-dhcp/](https://networklessons.com/cisco/ccie-enterprise-infrastructureintroduction-to-dhcp/)

Based on this lesson, and on how DHCP functions, both the OFFER and the ACK messages of DHCP are broadcast using the 255.255.255.255 IP address. However, it is true that at least the MAC address of the requesting host is known by both the server and the relay agent after the initial DISCOVERY packet is sent. The reasons behind why both the OFFER and the ACK are broadcast rather than unicast is further explained in this post:

> [@Introduction to DHCP](https://forum.networklessons.com/t/introduction-to-dhcp/970/30):
>
> Hello Samit This is an excellent question and it shows that you’re thinking deeply about the subject. It is true that the DHCPOFFER when sent can technically be sent using a unicast MAC address since the MAC address of the host making the request, and thus the destination of the DHCPOFFER frame, is known. However, some operating systems and NIC drivers don’t always use this logic when operating DHCP. Some client implementations are unable to receive such unicast frames until the implementati…

I hope this has been helpful!

Laz

---

<div class="post-metadata">

**Author:** ![maritdelange](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/maritdelange/32/2120_2.png) [@maritdelange](https://forum.networklessons.com/u/maritdelange)\
**Post date:** [December 21, 2019, 12:58am UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/52 "2019-12-21T00:58:23Z")

</div>

Thanks, Laz, I missed that post.

---

<div class="post-metadata">

**Author:** ![shaan129](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/s/b4bc9f/32.png) [@shaan129](https://forum.networklessons.com/u/shaan129)\
**Post date:** [April 18, 2020, 7:37pm UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/53 "2020-04-18T19:37:41Z")

</div>

Hi ,

I am practicing same scenario like you have explained but instead i have configured sub interface on the router connecting to the LAN but i do not see machines in LAN fetching the ip from the DHCP Server , i have configured helper ip under the 0.10 & for this testing I have switch now between Router & switch and port between switch & router is trunk on switch end and on router encapsulation enabled  
Also i am able to reach 12.2 from the router where DHCP is defined

Regards  
shaan

---

<div class="post-metadata">

**Author:** ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)\
**Post date:** [April 21, 2020, 7:44am UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/54 "2020-04-21T07:44:37Z")

</div>

Hello Shaan

Based on your description of your topology, the setup should work correctly. I’m assuming that your subinterface of Fa0/0.10 is on VLAN 10. Based on your description, I’ve prepared the following diagram:

 ![image](https://cdn-forum.networklessons.com/uploads/default/original/2X/1/1442cb658fb5622061d394d8cfbbe75df016f6c8.png)

When troubleshooting, test the following:

1. Make sure that the correct VLAN is configured on the trunk interface of the switch, as well as on the subinterface of the router
2. Test the subinterface and trunk configuration by statically assigning an IP address to the PC, such as 192.168.12.55 255.255.255.0 and attempt to ping the Fa0/0.10 interface. If it is not successful, then there is a problem with the switch/trunk/router configuration.
3. If the above test is successful, then you should check the relay agent configuration for correctness, and the operation of the DHCP server.

If you need some additional information about the configuration of subinterfaces, take a look at the following lesson:

> **[How to configure Router on a Stick](https://networklessons.com/ip-routing/how-to-configure-router-on-a-stick)**
>
> This lesson explains how to configure a router on a stick scenario with Cisco IOS devices. This lets you route traffic over a trunk.

I hope this has been helpful!

Laz

---

<div class="post-metadata">

**Author:** ![shaan129](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/s/b4bc9f/32.png) [@shaan129](https://forum.networklessons.com/u/shaan129)\
**Post date:** [April 24, 2020, 1:23pm UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/55 "2020-04-24T13:23:12Z")

</div>

Thank You Laz i tested & its working

Regards  
shaan

---

<div class="post-metadata">

**Author:** ![anjanchandra.in](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/anjanchandra.in/32/2901_2.png) [@anjanchandra.in](https://forum.networklessons.com/u/anjanchandra.in)\
**Post date:** [August 13, 2020, 7:00pm UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/56 "2020-08-13T19:00:01Z")

</div>

Hi Rene,  
Suppose Host A,B & C connected with Router (R1) in 3 different interfaces. R1 is working as a Relay agent. R1 is connected with 3 different DHCP Servers (D1,D2&D3) to provide IP address to Host A,B &C. I mean A will get IP from D1, B will get from D2 & C will get from D3. I will configure 3 ip helper address in R1. Is this scenario feasible ? If yes then how R1 will map the broadcasts to helper addresses accordingly ?

May be configuring a single server with 3 different pools and using single ip-helper in R1, we can solve it. Or using VLAN, we can solve the problem. But my question is, is the said scenario feasible ? if yes then how ?  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)\
**Post date:** [August 15, 2020, 8:52am UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/57 "2020-08-15T08:52:57Z")

</div>

Hello Anjan

> [@anjanchandra.in](#):
>
> I will configure 3 ip helper address in R1. Is this scenario feasible ?

Yes it is feasible because the IP helper address is configured on each interface. You would configure it like so:

- Interface GE0/1 on which Host A is connected will have an IP helper address of 10.10.10.10
- Interface GE0/2 on which Host B is connected will have an IP helper address of 10.10.20.10
- Interface GE0/3 on which Host C is connected will have an IP helper address of 10.10.30.10

So each host, which belongs to a different subnet, will send their DHCP request, and the interface of the router to which it is attached will forward that request to the appropriate DHCP server.

Now this is not a very scalable solution, as it would require a different physical device for each DHCP server (or at least a different VM if you go virtual). Ideally, your suggestion would be the best, to create a single DHCP server, use the same server as the IP helper address, and simply have 3 different pools. This would solve it because the DHCP request from Host A will include the IP address and subnet mask of the interface on which the helper address is configured, and this subnet will inform the DHCP server from which pool to offer addresses. Introducing VLANs would not make a difference in the DHCP scenario.

I hope this has been helpful!

Laz

---

<div class="post-metadata">

**Author:** ![victorgarcia3000](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/v/59ef9b/32.png) [@victorgarcia3000](https://forum.networklessons.com/u/victorgarcia3000)\
**Post date:** [October 23, 2020, 1:05am UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/58 "2020-10-23T01:05:54Z")

</div>

HI Laz,  
I understand that R1 Relays DHCP messages as unicast, but I did not understand why DHCP Server also replies in unicast mode once it is in the same broadcast domain, I thought DHCP Server would follow DHCP messages as broadcast way.  
Can you pls help me with this doubts. Thank you

Victor Hugo

---

<div class="post-metadata">

**Author:** ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)\
**Post date:** [October 25, 2020, 7:27am UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/59 "2020-10-25T07:27:14Z")

</div>

Hello Victor

If the DHCP server is in the same network segment/broadcast domain as the client, then once the server receives the DHCPDISCOVER, **it knows the MAC address of the client**. This is because the MAC address of the client is used as the source MAC address in the Ethernet header of the DHCPDISCOVER message. Since the DHCP server knows the Layer 2 address of the client, there is no need to send a multicast DHCPOFFER message to the client. It can send a unicast DHCPOFFER message using the MAC address of the client as the destination address. In this case, it doesn’t matter what is found in the IP address fields of the IP header, since this communication is functioning at Layer 2, and such connectivity is achievable within the same network segment.

I hope this has been helpful!

Laz

---

<div class="post-metadata">

**Author:** ![speedychuck](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@speedychuck](https://forum.networklessons.com/u/speedychuck)\
**Post date:** [December 2, 2020, 8:39pm UTC](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121/60 "2020-12-02T20:39:52Z")

</div>

Hi, I’m trying to figure out an issue with a network I’ve been building. DHCP relay isn’t working.

The vlan which the helper address is enabled on is at remote site. I can see from the debug that the DHCP request is being forwarded as unicast message toward the DHCP server.

The DHCP server is located on a core switch elsewhere, and has DHCP snooping enabled on the interface where the DHCP server is.

The interface which the unicast DHCP messages will reach the remote site through does not have DHCP snooping trust set on it.

This particular core switch is not under my control, and before I contact HQ and ask them I have this question-

**Does DHCP snooping trust need to be enabled even on an interface that will be sending/receiving unicast (DHCP Relay) messages?**

Thanks in advance.  
Charles.

[Previous page](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121.md?page=2)

[Next page](https://forum.networklessons.com/t/cisco-ios-dhcp-relay-agent/1121.md?page=4)
