I will cover a very basic configuration of the DHCP on the L3 switch where I will explain how to verify the debug logs related to the DHCP on the L3 switch and also on the client. I believe sometimes it's extremely important to brush up on our basics for isolating the bigger problem in the network, even though it's very basic.
Agenda:
I will show you the Configuration at the L3 and L2 switch levels, where my L3 switch will act as a DHCP Server.
In addition, I will demonstrate the packets that you will see on the switch and on the client.
As you can see in the diagram below, I have a L3 switch that serves as a DHCP server, and I have a directly connected L2 switch that connects to my PC.
L3 switch configuration
I have created SVI for VLAN 70
DHCP_SERVER#show ip interface brief | inc up
Vlan69 10.106.69.152 YES NVRAM up up
Vlan70 10.106.70.4 YES NVRAM up up
Fo1/0/2 unassigned YES unset up up
Fo1/0/7 unassigned YES unset up up
This is the config for my SVI
DHCP_SERVER#show run interface vlan 70
Building configuration...
Current configuration : 62 bytes
!
interface Vlan70
ip address 10.106.70.4 255.255.255.0
end
I am creating a pool name 14thDec_REPRO and assigning the network and network mask.
DHCP_SERVER(config)#ip dhcp pool 14thDec-REPRO
DHCP_SERVER(dhcp-config)#network ?
A.B.C.D Network number in dotted-decimal notation
DHCP_SERVER(dhcp-config)#network 10.106.70.0 255.255.255.0
DHCP_SERVER(dhcp-config)#DHCP_SERVER(dhcp-config)#default-router 10.106.70.4
L2 switch configuration
Also, here I have created the SVI for VLAN 70, but I am not manually assigning it any IP addresses, rather I am using the command ip address dhcp to obtain the IP address from DHCP.
L2_Switch#show ip interface brief | inc up
Vlan69 unassigned YES unset up up
Vlan70 10.106.70.11 YES DHCP up up
GigabitEthernet0/0 10.106.62.68 YES NVRAM up up
TwentyFiveGigE1/0/3 unassigned YES unset up up
TwentyFiveGigE1/0/5 unassigned YES unset up up
TwentyFiveGigE1/0/47 unassigned YES unset up up
Switchport configuration where PC is connected.
L2_Switch#show running-config interface TwentyFiveGigE1/0/3
Building configuration...
Current configuration : 88 bytes
!
interface TwentyFiveGigE1/0/3
switchport access vlan 70
switchport mode access
end
L2_Switch#show running-config interface Vlan70
Building configuration...
Current configuration : 41 bytes
!
interface Vlan70
ip address dhcp
end
DHCP Debug
To capture DHCP packets and events, I have enabled DHCP debug on the L3 switch.
Debug from L3 switch side which is acting as DHCP Server
*Dec 13 10:53:36.561: DHCP: Waiting for 5 seconds on interface GigabitEthernet0/0 to come up
*Dec 13 10:53:41.561: DHCP: Waiting for 5 seconds on interface GigabitEthernet0/0 to come up
*Dec 13 10:53:43.194: Option 82 not present
*Dec 13 10:53:43.194: DHCPD: Reload workspace interface Vlan70 tableid 0.
*Dec 13 10:53:43.194: DHCPD: tableid for 10.106.70.4 on Vlan70 is 0
*Dec 13 10:53:43.194: DHCPD: client's VPN is .
*Dec 13 10:53:43.195: DHCPD: No option 125
*Dec 13 10:53:43.195: DHCPD: DHCPRELEASE message received from client 01a0.369f.e727.1f
*Dec 13 10:53:43.195: DHCPD: FSM state change INVALID
*Dec 13 10:53:43.195: DHCPD: Workspace state changed from INIT to INVALID(10.106.70.13).
*Dec 13 10:53:43.195: DHCPD: Option 125 not present in the msg.
*Dec 13 10:53:43.195: DHCPD: Sending notification of TERMINATION:
*Dec 13 10:53:43.195: DHCPD: address 10.106.70.13 mask 255.255.255.0
*Dec 13 10:53:43.195: DHCPD: reason flags: RELEASE
*Dec 13 10:53:43.195: DHCPD: htype 1 chaddr a036.9fe7.271f
*Dec 13 10:53:43.195: DHCPD: lease time remaining (secs) = 86234
*Dec 13 10:53:43.195: DHCPD: interface = Vlan70
*Dec 13 10:53:43.195: DHCPD: Destroy binding called for 7FD4F65624E8
*Dec 13 10:53:43.195: DHCPD: removing ARP entry (10.106.70.13 vrf default).
*Dec 13 10:53:43.195: DHCPD: dhcpd_deactivate_binding binding removed from mac hash 7FD4F65624E8 index 323
*Dec 13 10:53:43.195: DHCPD: returned 10.106.70.13 to address pool TAC-REPRO.
*Dec 13 10:53:43.195: DHCPD: Freeing 7FD4F65624E8
*Dec 13 10:53:46.562: DHCP: Waiting for 5 seconds on interface GigabitEthernet0/0 to come up
*Dec 13 10:53:49.531: Option 82 not present
*Dec 13 10:53:49.531: DHCPD: Reload workspace interface Vlan70 tableid 0.
*Dec 13 10:53:49.531: DHCPD: tableid for 10.106.70.4 on Vlan70 is 0
*Dec 13 10:53:49.531: DHCPD: client's VPN is .
*Dec 13 10:53:49.531: DHCPD: No option 125
*Dec 13 10:53:49.531: DHCPD: Option 125 not present in the msg.
*Dec 13 10:53:49.531: Option 82 not present
*Dec 13 10:53:49.531: Option 82 not present
*Dec 13 10:53:49.531: DHCPD: Option 125 not present in the msg.
*Dec 13 10:53:49.531: DHCPD: Sending notification of DISCOVER:
*Dec 13 10:53:49.531: DHCPD: htype 1 chaddr a036.9fe7.271f
*Dec 13 10:53:49.531: DHCPD: circuit id 000400460107
*Dec 13 10:53:49.531: DHCPD: interface = Vlan70
*Dec 13 10:53:49.531: DHCPD: class id 4d53465420352e30
*Dec 13 10:53:49.531: DHCPD: DHCPDISCOVER received from client 01a0.369f.e727.1f on interface Vlan70.
*Dec 13 10:53:49.531: DHCPD: Option 125 not present in the msg.
*Dec 13 10:53:49.532: Option 82 not present
*Dec 13 10:53:49.532: Option 82 not present
*Dec 13 10:53:49.532: DHCPD: Option 125 not present in the msg.
*Dec 13 10:53:49.532: DHCPD: Sending notification of DISCOVER:
*Dec 13 10:53:49.532: DHCPD: htype 1 chaddr a036.9fe7.271f
*Dec 13 10:53:49.532: DHCPD: circuit id 000400460107
*Dec 13 10:53:49.532: DHCPD: interface = Vlan70
*Dec 13 10:53:49.532: DHCPD: class id 4d53465420352e30
*Dec 13 10:53:49.532: DHCPD: FSM state change INVALID
*Dec 13 10:53:49.532: DHCPD: Workspace state changed from INIT to INVALID
*Dec 13 10:53:49.532: DHCPD: classname not set in msg
*Dec 13 10:53:49.532: DHCPD: client requests 10.106.70.13.
*Dec 13 10:53:49.532: DHCPD: Selecting relay q from pool
*Dec 13 10:53:49.532: DHCPD: Allocated binding 7FD4F65624E8
*Dec 13 10:53:49.532: DHCPD: Adding binding to radix tree (10.106.70.13)
*Dec 13 10:53:49.532: DHCPD: Adding binding to hash tree 7FD4F65624E8
*Dec 13 10:53:49.532: DHCPD:dhcpd_binding_add_to_mac_hash: index- 323 add binding 7FD4F65624E8
*Dec 13 10:53:49.532: DHCPD: assigned IP address 10.106.70.13 to client 01a0.369f.e727.1f.
*Dec 13 10:53:49.532: DHCPD: Saving workspace (ID=0x3E000004)
*Dec 13 10:53:49.532: DHCPD: New packet workspace 0x7FD4FE020000 (ID=0x63000005)
*Dec 13 10:53:51.532: DHCPD: Reprocessing saved workspace (ID=0x3E000004)
*Dec 13 10:53:51.532: DHCPD: Option 125 not present in the msg.
*Dec 13 10:53:51.532: Option 82 not present
*Dec 13 10:53:51.532: Option 82 not present
*Dec 13 10:53:51.532: DHCPD: Option 125 not present in the msg.
*Dec 13 10:53:51.532: DHCPD: Sending notification of DISCOVER:
*Dec 13 10:53:51.532: DHCPD: htype 1 chaddr a036.9fe7.271f
*Dec 13 10:53:51.532: DHCPD: circuit id 000400460107
*Dec 13 10:53:51.532: DHCPD: interface = Vlan70
*Dec 13 10:53:51.532: DHCPD: class id 4d53465420352e30
*Dec 13 10:53:51.532: DHCPD: DHCPDISCOVER received from client 01a0.369f.e727.1f on interface Vlan70.
*Dec 13 10:53:51.532: DHCPD: Sending DHCPOFFER to client 01a0.369f.e727.1f (10.106.70.13).DHCPD: Setting only requested parameters
*Dec 13 10:53:51.532: DHCPD: Option 125 not present in the msg.
*Dec 13 10:53:51.532: DHCPD: egress Interfce Vlan70
From the above, you can see that my client a036.9fe7.271f received the IP 10.106.70.13.
Client-Side capture
As you can see, I am not releasing the IP address from the client side, but rather sending for its renewal using the command ipconfig /renew from my Windows PC. Due to this, my client is sending a DHCP request instead of a discovery request.
L3 Switch side capture which is acting as DHCP server
*Dec 13 10:53:51.532: DHCPD: broadcasting BOOTREPLY to client a036.9fe7.271f.
*Dec 13 10:53:51.533: DHCPD: Freeing saved workspace (ID=0x3E000004)
*Dec 13 10:53:51.534: Option 82 not present
*Dec 13 10:53:51.534: DHCPD: Reload workspace interface Vlan70 tableid 0.
*Dec 13 10:53:51.534: DHCPD: tableid for 10.106.70.4 on Vlan70 is 0
*Dec 13 10:53:51.534: DHCPD: client's VPN is .
*Dec 13 10:53:51.535: DHCPD: No option 125
*Dec 13 10:53:51.535: DHCPD: DHCPREQUEST received from client 01a0.369f.e727.1f.
*Dec 13 10:53:51.535: DHCPD: DHCPREQUEST received on interface Vlan70.
*Dec 13 10:53:51.535: DHCPD: Found previous binding
*Dec 13 10:53:51.535: DHCPD: FSM state change INVALID
*Dec 13 10:53:51.535: DHCPD: Workspace state changed from INIT to INVALID
*Dec 13 10:53:51.535: DHCPD: client is directly connected going with default flow
*Dec 13 10:53:51.535: DHCPD: Option 125 not present in the msg.
*Dec 13 10:53:51.535: DHCPD: Sending notification of ASSIGNMENT:
*Dec 13 10:53:51.535: DHCPD: address 10.106.70.13 mask 255.255.255.0
*Dec 13 10:53:51.535: DHCPD: htype 1 chaddr a036.9fe7.271f
*Dec 13 10:53:51.535: DHCPD: lease time remaining (secs) = 86400
*Dec 13 10:53:51.535: DHCPD: interface = Vlan70
*Dec 13 10:53:51.535: DHCPD: No default domain to append - abort update
*Dec 13 10:53:51.535: DHCPD: Sending DHCPACK to client 01a0.369f.e727.1f (10.106.70.13).DHCPD: Setting only requested parameters
*Dec 13 10:53:51.535: DHCPD: Option 125 not present in the msg.
*Dec 13 10:53:51.535: DHCPD: egress Interfce Vlan70
*Dec 13 10:53:51.535: DHCPD: broadcasting BOOTREPLY to client a036.9fe7.271f.
Client-Side capture in this case
ARP Entry from the switch side
DHCP_SERVER#show ip arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 10.106.69.1 0 0025.4533.167f ARPA Vlan69
Internet 10.106.69.152 - 00a7.42d7.ac9f ARPA Vlan69
Internet 10.106.70.4 - 00a7.42d7.ac9f ARPA Vlan70
Internet 10.106.70.11 11 cc7f.76b7.c2df ARPA Vlan70
Internet 10.106.70.12 16 78da.6e12.f580 ARPA Vlan70
Internet 10.106.70.13 0 a036.9fe7.271f ARPA Vlan70
L2_Switch#show ip arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 10.106.70.4 1 00a7.42d7.ac9f ARPA Vlan70
Internet 10.106.70.11 - cc7f.76b7.c2df ARPA Vlan70