Conditional debug is very useful to filter out some of the debug information that you see on a (busy) router. It allows us to only show debug information that matches a certain interface, MAC address, username and some other items.
It’s best to demonstrate this with an example, so let me show you the following router that is running RIP on two interfaces:
Let’s enable RIP debugging on this router:
R1#debug ip rip
RIP protocol debugging is on
We will see RIP debug information from both interfaces:
R1#
RIP: sending v2 update to 224.0.0.9 via FastEthernet0/0 (192.168.12.1)
RIP: build update entries
192.168.13.0/24 via 0.0.0.0, metric 1, tag 0
R1#
RIP: sending v2 update to 224.0.0.9 via FastEthernet0/1 (192.168.13.1)
RIP: build update entries
192.168.12.0/24 via 0.0.0.0, metric 1, tag 0
If I only want to see the debug information from one interface then I can use a debug condition:
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
voice-port voice-port number
xconnect Xconnect conditional debugging on segment pair
This is quite a list with different items to choose from. I’ll use the interface as a condition:
R1#debug condition interface fastEthernet 0/0
Condition 1 set
Using this debug condition we will only see RIP debug information from the FastEthernet 0/0 interface:
R1#
RIP: sending v2 update to 224.0.0.9 via FastEthernet0/0 (192.168.12.1)
RIP: build update entries
192.168.13.0/24 via 0.0.0.0, metric 1, tag 0
When you want to get rid of the debug condition then you can use the following command:
Rene,
I have been able to get conditional debug to work with interface. However, I have yet to perform a successful conditional debug with ip. Here’s an example:
... Continue reading in our forumHi Ronald,
I just tried this on some IOS 15 routers but I’m having the same issue as you. Whatever IP address I try in “debug condition ip”…nothing shows up
I’m guessing that this command doesn’t work for most debug commands…
Rene
Rene,
Thank you for checking as well. Much appreciated.
Roland
I tried a couple of different combinations and maybe in GNS3 this command doesn’t work at all.
I set conditions for completely different IP and only enable debug ip icmp, ping from another router and I still get output.
enable condition for interface that isn’t used and I still get debug output when pinging.
Seems this command isn’t working at all in GNS3.
I’d fire up my rack of gear but it’s 110 here …
... Continue reading in our forumHi Daniel,
Same issue here, conditional debugging works for interfaces but I was unable to get any wanted results with debug ip condition. Tried it in VIRL and on real hardware.
Rene