Cisco IOS debugging is a very useful feature for the troubleshooting various issues on the Cisco Routers and switches. Though useful, debugging must be run on devices with caution as it is very CPU intensive and may result in router/switch crash if low PU memory is available on the device.
Conditional debugging is used to filter out the debug information so that the CPU consumption by debug is lowered significantly. It allows us to show debug information that matches a certain interface, MAC address etc.
Let us use the example below to understand this further –
We enable the RIP debug on R2 as below:
R2#debug ip rip
RIP protocol debugging is on
*Jul 18 13:14:23.351: RIP: sending v2 update to 224.0.0.9 via FastEthernet1/0 (9.9.23.2)
*Jul 18 13:14:23.351: RIP: build update entries
*Jul 18 13:14:23.355: 9.9.12.0/24 via 0.0.0.0, metric 1, tag 0
R2#
*Jul 18 13:14:27.955: RIP: sending v2 update to 224.0.0.9 via FastEthernet0/0 (9.9.12.2)
*Jul 18 13:14:27.955: RIP: build update entries
*Jul 18 13:14:27.959: 9.9.23.0/24 via 0.0.0.0, metric 1, tag 0
We see we are getting debug messages on both interfaces Fa0/0 and Fa1/0.
Now let us enable conditional debug as below for interface Fa0/0.
R2#debug condition interface fa0/0
R2#sh debug condition
Flags: Fa0/0
R2#
*Jul 18 13:17:20.215: RIP: build update entries
*Jul 18 13:17:20.219: 9.9.23.0/24 via 0.0.0.0, metric 1, tag 0
Now we see we only get debug messages for interface Fa0/0.
To disable the conditional debug use the following command:
R2#undebug condition interface fa0/0
Removing all conditions may cause a flood of debugging
messages to result, unless specific debugging flags
are first removed.
Proceed with removal? [yes/no]: yes
Condition 1 has been removed
ABOUT THE AUTHOR
I am here to share my knowledge and experience in the field of networking with the goal being – “The more you share, the more you learn.”
I am a biotechnologist by qualification and a Network Enthusiast by interest. I developed interest in networking being in the company of a passionate Network Professional, my husband.
I am a strong believer of the fact that “learning is a constant process of discovering yourself.”
– Rashmi Bhardwaj (Author/Editor)