Conditional debugging

Cisco-conditional-debug-www.ipcisco.com

Cisco Conditional Debug

We use debug command to see the events, errors and etc. on a Cisco router or a switch.  There is also another useful version of this command called conditional debugging which allows showing debug information for a specific interface, ip address, MAC address, username, vlan or other parameters. Here, we will learn Cisco conditional debug with debug condition command.

 

For example, if we use interface as debug condition, the debugging will be work on that specific interface on the router or on the switch. Any other interface information will not be displayed. This is very useful and effective way of debugging. Because, we are specifying specific interface not all the things in the router or the switch and only this information is displayed to us.

 


Cisco Packet Tracer Cisco Configurations Course!


 

Cisco-conditional-debug-www.ipcisco.com

How To Configure Conditional Debug on Cisco IOS?

Cisco conditional debug is very useful command for debugging. So, how can we configure conditional debug on Cisco routers and switches? Here, there are different parameters that can be used with debug command. We can display them with “debug condition ?” command.

 

Router# 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

 

You can choose any of these paramaters for your configuration. Let’s show some of these Cisco conditionally debugging commands with examples.

 


 

Cisco Conditional Debug Commands

debug condition interface

To show conditional debugging, let’s give an example. To do this, we will use debug condition interface command with the interface name. In this example, we will use interface Gi0/0/1 on a router for our condition.

Router# debug condition interface Gi0/0/1

Condition 1 set

 

Router #

OSPF: sending v2 update to 224.0.0.6 via GigabitEthernet0/0/1 (10.10.10.1)

OSPF: build update entries

10.10.20.1/24 via 0.0.0.0, metric 1, tag 0

 


 

debug condition ip

Instead of interface, we can use ip address as filter for debugging condition. Let’s do this for ip address 10.10.10.1.

 

Router# debug condition ip 10.10.10.1

Condition 1 set

 


 

debug condition mac-address

Like ip address, this configuration can be done also with specific mac address. Let’s do this with mac address AA:BB:CC:11:22:33.

 

Router# debug condition mac-address AA:BB:CC:11:22:33

Condition 1 set

 


 

debug condition username

For specific user debug, we can filter debug condition with username. To do this, we will use debug condition username command. Let’s do this for username IPCisco.

 

Router# debug condition IPCisco

Condition 1 set

 


 

debug condition vlan

If you would like to filter debug output for the specified VLAN ID, you can use debug condition vlan command. For example let’s do this VLAN 10.

 

Router# debug condition vlan 10

Condition 1 set

 


 

show debug condition command

To display which conditional debugs are enabled on Cisco device, we use show debug condition command.

 

Router# show debug condition

 

This is basically, how we use Cisco conditional debug commands for conditionally debugging. These commands will be very useful for you during your network troubleshooting.

 


DOWNLOAD Cisco Packet Tracer Configuration & Cisco GNS3 Configurations


 

Back to: CCNP Enterprise 350-401 ENCOR > Network Assurance

Leave a Reply

Your email address will not be published. Required fields are marked *

CCNP Enterprise 350-401 ENCOR

Collapse
Expand