Master the many uses of the Cisco IOS test command

The Cisco IOS <i>test</i> command can be a very useful and powerful command in both real-world and lab scenarios. Learn the basics of using this command, and find out about several helpful subcommands.

Want to learn more about router and switch management? Automatically sign up for our free Cisco Routers and Switches newsletter, delivered each Friday!

If you've never used the Cisco IOS test command, you're not alone. I've run into many network administrators who have never even heard of the command. In my experience, test can be a very useful and powerful command in both real-world and lab scenarios.

As you probably know, even applying just the right sequence of Cisco IOS commands—in the right order—can be tricky at times. And once you've applied the right commands in the right order, how do you know if it will really work? That's where the test command comes in. Let's take a closer look.

To view the available options for test on your IOS, go to privileged mode, and enter the following:

Router# test ?

This command returns a list of options. For example, on my 3600 Series router running IOS 12.3(6a), I have 34 subcommands. On my Catalyst 3524 IOS switch, I have eight subcommands available. To give you an idea what to expect, here's what the outputs this command returned for my router and my switch.

router# test ?
  aaa               AAA Authentication, Authorization and Accounting
  interfaces        Network interfaces
  memory            Non-volatile and/or multibus memory
  pas               Port Adaptor Tests
  scp               SCP test commands
  service-module    Service module
  Virtual-Template  Virtual Template interface
  appletalk         APPLETALK diagnostic code
  cac               test the l2 cac functionality
  call              Call test commands
  cns               CNS agents
  crypto            Test crypto functions
  dsp               Test DSP functions
  eigrp             IPX EIGRP test commands
  enum              test enum
  gssapi            GSSAPI test code
  hpi               host port interface
  ifs               IFS TEST code
  ipc               Inter-Process Communication Test Commands
  ipmobile          IP Mobility Test commands
  pasvc             PPP over ATM SVC Test Driver
  pm                Port Manager test commands
  pppatm            PPP over ATM SSS Test
  pppoe             PPPoE test commands
  sctp              SCTP test commands
  source-group      Test Source IP Group
  spanning-tree     Spanning Tree Subsystem
  ssl               SSL Test
  sw-vlan           Test VLAN Manager feature
  tpu               TPU test system
  translation-rule  Test translation rule table
  voice             Voice related test commands


CAT1#test ?
  cns                CNS agents
  ifs                IFS TEST code
  l2protocol-tunnel  layer 2 tunnel port
  l3tcam             Test L3TCAM Manager
  spanning-tree      Spanning Tree Subsystem
  stats              Test stats
  sw-vlan            Test VLAN Manager feature
  tcam               Test TCAM Mgr


As you can see, you typically have several subcommands for test at your disposal, particularly on a router. But having so many options can often be overwhelming—how do you know which ones are most useful?

Of course, it really depends on what you want to test. When you find yourself with some free time, I suggest you play around with this command and experiment with the available subcommands.

However, keep in mind that you shouldn't use some of these test subcommands on a production router. For example, using test memory removes all files in NVRAM.

Some models of Cisco routers have test commands just for that particular product line. For instance, on a Cisco 7500 series router, there is the t1 test command.

In my experience, the following subcommands have been most useful.

test aaa

If you're configuring router authentication to a TACACS+ or RADIUS server, there's always the danger that you could make a mistake and lock everyone out of the router. You can use this command to test authentication from the router to the AAA server using a specific username and password. For more information, check out Cisco's documentation on the test aaa command.

test interfaces

This command lets you test a router that doesn't currently have a network connection. In other words, use this command to test a router before sending it out to a site. For more information, check out Cisco's documentation on the test interfaces command.

Here's an example of this command:

Router# test interfaces
Test Ethernet0/0 [y/n] ? y
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Passed No IP address for Serial0/0. Skipping... No IP address for BRI0/0. Skipping... No IP address for BRI0/0:1. Skipping... No IP address for BRI0/0:2. Skipping... Test Dialer1 [y/n] ? ... Failed - timeout problem Test Loopback1 [y/n] ? n Skipping... Test Tunnel1 [y/n] ? n Skipping... Test Tunnel2 [y/n] ? n Skipping... 9 interfaces: 1 passed, 1 failed, 3 skipped, 4 untestable Router#

test service-module

You can use this command to test integrated CSU/DSU units. For example, if you have an integrated WIC in your router that's a 56K CSU/DSU or a T1 CSU/DSU, you can use this command to test that module. For more information, check out Cisco's documentation on the test service-module command.

test crypto

If you're setting up IPSec encryption between two routers, this command can come in very handy. You can use it to test bringing up an encrypted tunnel to a remote router, without using any real production data to trigger the connection. For more information, check out Cisco's documentation on the test crypto command.

isdn test

This is one of several test subcommands that doesn't start with test. The isdn test call interface and isdn test disconnect interface commands are great for any network administrator using ISDN. Using these one-line commands, you can force the router to place an ISDN call to any number and disconnect that call.

You can also properly disconnect an existing call using this command—a much better alternative to using clear interface bri0/0 to disconnect a line, which can create confusion between the ISDN interface and switch.While this command works regardless of any dial lists you have, you must still make sure the ISDN Service Profile Identifiers (SPIDs) and switch type are correct. For more information, check out Cisco's documentation on the isdn test commands.

VoIP commands

There are also several available test subcommands for voice over IP (VoIP). In fact, I could devote another article just to the variety of the VoIP test subcommands available on Cisco routers. So if you're using VoIP, I suggest you try out some of these subcommands; in particular, check out test voice, test call, test port, and test tone. For more information, check out Cisco's documentation on the VoIP-related test commands.

David Davis has worked in the IT industry for 12 years and holds several certifications, including CCIE, MCSE+I, CISSP, CCNA, CCDA, and CCNP. He currently manages a group of systems/network administrators for a privately owned retail company and performs networking/systems consulting on a part-time basis.