The joys of the Debug condition command
Say you are running RIP, & you wish to debug ip rip.
Typically you will see every 30 seconds a barrage of output from the debug.
If you are only interested in seeing the debug on a particular interface/subinterface, this is where debug condition helps.
So say we have R1 with the following interfaces all running RIP:
R1#sh ip int b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 100.1.111.1 YES manual up up
Serial0/0 unassigned YES unset up up
Serial0/0.12 10.1.12.1 YES manual up up
Serial0/0.13 10.1.13.1 YES manual up up
Serial0/0.14 10.1.14.1 YES manual up up
FastEthernet0/1 unassigned YES unset up up
Serial0/1 10.1.100.1 YES manual up up
If we are only interested in debug ip rip for s0/0.14 we can do this:
R1#debug condition interface s0/0.14
Condition 1 set
R1#
R1#debug ip rip
RIP protocol debugging is on
R1#
RIP: received v2 update from 10.1.14.4 on Serial0/0.14
10.1.45.0/24 via 0.0.0.0 in 1 hops
10.1.46.0/24 via 0.0.0.0 in 1 hops
10.1.56.0/24 via 0.0.0.0 in 2 hops
Cool we can see debug condition working its magic.
You can select multiple interfaces/subinterfaces with debug condition.
To view the current list of interfaces with debug condition:
R1#sh debug condition
Condition 1: interface Se0/0.14 (1 flags triggered)
Flags: Se0/0.14
Something to bear in mind here, is that doing: undebug all does NOT remove debug condition.
So if you want to remove the debug condition on your interfaces you need to do (in this case)
no debug condition interface s0/0.14
If s0/0.14 was the only remaining interface with the debug condition you’ll see the following:
R1#no debug condition int s0/0.14
This condition is the last interface condition set.
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
NB. As s0/0.14 had condition id of 1, you could have also done: no debug condition 1 instead of no debug int s0/0.14.
Finally, debug condition can be used in quite a varied no of ways as seen below:
R1#debug condition ?
application Application
called called number
calling calling
card card
glbp interface group
interface interface
ip IP address
mac-address MAC address
match-list apply the match-list
standby interface group
username username
vcid VC ID
vlan vlan
Comments(2)