02-19-2025 03:53 AM
Could you please tell me the command to check if DHCP relay is working?
I couldn't find the answer even after searching, so could you help me?
Reference information
Model number: C9300
OS: version 17.9
<Japanese>
Whether DHCP Relay is Working
Could you give me the command to investigate?
You can only find out how to set up the relay agent.
reference information
Model: C9300
OS: version 17.9
02-19-2025 03:55 AM
Hello @suzuki2502
You could check the config of ip helper-address configured with this command:
#show ip helper-address
but a command to check if it works... you could monitor traffic to ensure unicast packet is build for DHCPDiscover with the ip helper-address as destination IP...
02-19-2025 06:51 AM
One way to check if dhcp relay is working would be to check the content of the arp table. If there are entries in the arp table for devices in the subnet which is getting addresses using dhcp relay then that is a demonstration that dhcp relay is working.
02-19-2025 05:23 PM
Thanks!
I found "show arp" to be a useful command.
> the subnet which is getting addresses using dhcp relay
If you are trying to assign IP addresses of 192.168.0.0/24 using DHCP, is it correct to say that it is working if the IP address 192.168.0.1 is written to the ARP table?
(The above values are just examples.)
02-20-2025 09:12 AM
You are welcome. I am glad that you found show arp to be useful. We do not know enough about your environment to say with confidence whether seeing 192.168.0.1 in the arp table is proof that dhcp relay is working. It is quite possible that this address is the vlan IP address of the vlan interface. And in that case seeing it in the arp table does not prove anything about dhcp relay. If you see entries in the arp table for clients in the vlan then it is proof that dhcp relay is working.
02-19-2025 05:27 PM
Thanks for letting me know!
But I was looking at the command reference and realized it might not exist...
02-19-2025 10:07 AM - edited 02-19-2025 10:08 AM
Hello,
You can view DHCP packet forwarding statistics:
Router> show ip dhcp server statistics // Displays count information about server statistics and messages sent and received.
Thanks!
02-19-2025 05:17 PM
Thank you for letting me know twice!
I don't have the actual device here to try it, so I was looking at the command reference this morning.
Looking at it, I thought that the command might not exist...
Also, I have a question about the command you told me about.
The device I'm thinking of (C9300) doesn't function as a DHCP server, but rather as a DHCP relay agent.
Even in that case, would the command be useful?
02-20-2025 12:13 AM
If your device doesn't function as a DHCP server, the command @Joshqun Ismayilov mentioned - show ip dhcp server statistics - will not produce any meaningful information. Here is what the output will look like from a device whic is not configured as a dhcp server:
c1000#show ip dhcp server statistics
Memory usage 0
Address pools 0
Database agents 0
Automatic bindings 0
Manual bindings 0
Expired bindings 0
Malformed messages 0
Secure arp entries 0
Renew messages 0
Workspace timeouts 0
Static routes 0
Relay bindings 0
Relay bindings active 0
Relay bindings expired 0
Relay bindings terminated 0
Relay bindings selecting 0
Message Received
BOOTREQUEST 0
DHCPDISCOVER 0
DHCPREQUEST 0
INIT-REBOOT 0
REQUEST 0
RENEW 0
REBIND 0
DHCPDECLINE 0
DHCPRELEASE 0
DHCPINFORM 0
DHCPVENDOR 0
BOOTREPLY 0
DHCPOFFER 0
DHCPACK 0
DHCPNAK 0
Message Sent
BOOTREPLY 0
DHCPOFFER 0
DHCPACK 0
DHCPNAK 0
Message Forwarded
BOOTREQUEST 0
DHCPDISCOVER 0
DHCPREQUEST 0
INIT-REBOOT 0
REQUEST 0
RENEW 0
REBIND 0
DHCPDECLINE 0
DHCPRELEASE 0
DHCPINFORM 0
DHCPVENDOR 0
BOOTREPLY 0
DHCPOFFER 0
DHCPACK 0
DHCPNAK 0
DHCP-DPM Statistics
Offer notifications sent 0
Offer callbacks received 0
Classname requests sent 0
Classname callbacks received 0
Port Based Allocation Statistics
Discover MAC change 0
Request MAC change 0
Invalid binding in fwd req 0
HTH
02-20-2025 01:19 AM
Thanks for letting me know!
I didn't try it on a C9300, but I did try it on a C2960-X.
I confirmed that these values incremented, even though I only configured it as a DHCP relay agent.
- DHCPDISCOVER
- DHCPREQUEST
- DHCPOFFER
- DHCPACK
It seems to indicate that it's working.
02-19-2025 11:33 AM
The way I would verify that the dhcp relay is working - I would look at the client. Is he getting the correct IP, gateway, DNS, etc. from the DHCP server? Alternatively, I would check the DHCP server to see if a binding for the client exists in the correct pool.
Another way to check this is to do two packet captures - one on the LAN segment to see that the client is requesting an IP and the second capture on the segment pointing to the DHCP server in order to see the unicast packets destined to the DHCP server.
HTH
02-19-2025 05:13 PM
Thanks for letting me know!
I'll consider doing a packet capture.
02-20-2025 12:18 AM
debug ip dhcp server packet detail <<- share this
MHM
02-20-2025 12:51 AM
Hello
How about......
sh ip dhcp relay ?
02-20-2025 03:47 AM
It seems that the ip dhcp relay family of commands is only available on Cisco small business switches. I checked in my lab and the ip dhcp relay address isn't available on routers running IOS or IOS XE.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide