Sunday, June 26, 2011

Top Ten Cisco IOS Commands - 8) debug

debug - is a fickle command that doesn't always give you the smoking gun you'd hope for. However, sometimes it really comes through. (This is a command that you really want to be careful with! It can bring a device to its knees in a hurry.) That said, there are hundreds of possible options for debugging, I not going to dive in that deep, but, here's a good example to get you off and running.


Let's debug our dhcp server...

router1# debug ip dhcp server packet detail
router1# sh log
....
Log Buffer (65534 bytes):
 CST:   DHCPD: htype 1 chaddr 0025.84a2.1b56
Oct 14 07:49:52.389 CST:   DHCPD: lease time remaining (secs) = 86400
Oct 14 07:50:11.641 CST: DHCPD: Sending notification of ASSIGNMENT:
Oct 14 07:50:11.641 CST:  DHCPD: address 192.168.64.193 mask 255.255.254.0
Oct 14 07:50:11.641 CST:   DHCPD: htype 1 chaddr 0025.8418.cb21
Oct 14 07:50:11.641 CST:   DHCPD: lease time remaining (secs) = 86400
Oct 14 07:50:13.405 CST: DHCPD: Sending notification of ASSIGNMENT:
Oct 14 07:50:13.405 CST:  DHCPD: address 192.168.62.123 mask 255.255.254.0
Oct 14 07:50:13.405 CST:   DHCPD: htype 1 chaddr 0025.84a2.1c7a
Oct 14 07:50:13.405 CST:   DHCPD: lease time remaining (secs) = 86400
Oct 14 07:50:21.677 CST: DHCPD: Sending notification of DISCOVER:
Oct 14 07:50:21.677 CST:   DHCPD: htype 1 chaddr 10d0.d812.83f1
Oct 14 07:50:21.677 CST:   DHCPD: remote id 020a00000a3c00fe00000384
Oct 14 07:50:21.677 CST:   DHCPD: circuit id 00000000
Oct 14 07:50:21.677 CST: DHCPD: Seeing if there is an internally specified pool class:
Oct 14 07:50:21.677 CST:   DHCPD: htype 1 chaddr 10d0.d812.83f1
Oct 14 07:50:21.677 CST:   DHCPD: remote id 020a00000a3c00fe00000384
Oct 14 07:50:21.677 CST:   DHCPD: circuit id 00000000
Oct 14 07:50:21.677 CST: DHCPD: there is no address pool for 192.168.0.254.
Oct 14 07:50:26.153 CST: %ISDN-6-CONNECT: Interface Serial0/0/0:0 is now connected to 4177666471 N/A
Oct 14 07:50:29.901 CST: DHCPD: Sending notification of DISCOVER:
Oct 14 07:50:29.901 CST:   DHCPD: htype 1 chaddr 10d0.d812.f606
Oct 14 07:50:29.901 CST:   DHCPD: remote id 020a00000a3c00fe00000384
Oct 14 07:50:29.901 CST:   DHCPD: circuit id 00000000
Oct 14 07:50:29.901 CST: DHCPD: Seeing if there is an internally specified pool class:
Oct 14 07:50:29.901 CST:   DHCPD: htype 1 chaddr 10d0.d812.f606
Oct 14 07:50:29.901 CST:   DHCPD: remote id 020a00000a3c00fe00000384
Oct 14 07:50:29.901 CST:   DHCPD: circuit id 00000000
Oct 14 07:50:29.901 CST: DHCPD: there is no address pool for 192.168.0.254.
Oct 14 07:50:32.153 CST: %ISDN-6-CONNECT: Interface Serial0/0/0:0 is now connected to 4177666471 N/A
Oct 14 07:50:34.557 CST: DHCPD: Sending notification of ASSIGNMENT:
Oct 14 07:50:34.557 CST:  DHCPD: address 192.168.64.138 mask 255.255.254.0
Oct 14 07:50:34.557 CST:   DHCPD: htype 1 chaddr 0025.84a0.f328
Oct 14 07:50:34.557 CST:   DHCPD: lease time remaining (secs) = 86400



This is what you'd expect to see, discovery of MACs and assignment of IP addresses. Good stuff.


Don't forget to stop the debugging when you're done with it. Otherwise you're just chewing up valuable resources...

router1# undebug all
All possible debugging has been turned off



Also, you can check to see what debugging you or someone else has turned on...

router1# sh debug
DHCP server packet detail debugging is on


No comments:

Post a Comment