Cisco IOS test commands are a very useful and powerful command in real-world or laboratory environments. Learn the basic usage of this command and learn about several useful subcommands.
If you have never used the Cisco IOS test command, this is not surprising. I've met many network administrators who have never heard of this command. In my experience, this test is a very useful and powerful command, both in the real world and in a lab environment.
As you probably know, it is sometimes not easy to use Cisco IOS commands just in the right order. And after you use the correct commands in the correct order, you can know that these commands are executed correctly? This is why the commands need to be tested. Let's have a close contact on this.
To see the options available for testing on your iOS, enter in privileged way and enter:
Router# test ?
This command returns a list of options. For example, on a 3600 Series router that I run IOS 12.3(6a) I have 34 subcommands. And on my Catalyst 3524 IOS switch, I only have eight subcommands available. To give you an idea of what you can do, here is the output of my router and switch to this command.
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 sgbp
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
router#
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
CAT1#test
As you can see, you usually only use a few of these subcommands to test, especially on the router. But so many choices often tempt you to learn more about them – do you know which ones are the most useful?
Of course, the most important thing is what you want to test. When you are relatively idle, I suggest you run this command and try all available subcommands.
However, remember that you should not use some of these test subcommands on a product-grade router. For example, using test memory on NVRAM deletes all files.
Some Cisco router models provide test commands only for specific production lines. For example, on a Cisco 7500 series router, the t1 test command is used.
In my experience, the following subcommand is very useful.
test aaa
If you configure router authentication to a TACACS+ or RADIUS server, there is always a danger that you may make mistakes and keep everyone out of the router. You can use this command to test authentication from the router to the AAA server with a specific username and password. To get more information, please check it outcisco.com/univercd/cc/td/doc/product/software/ios122/122newft/122t/122t4/">Cisco documentation on the test aaa command.
test interfaces
This command allows you to test a router that does not currently have a network connection. In other words, test the router with this command before connecting it to the network. To get more information, please check it outcisco.com/univercd/cc/td/doc/product/software/ios123/123cgcr/fun_r/cfr_1g12.htm#wp1031393">Cisco documentation on the test interfaces command.
Here is 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 the integrated CSU/DSU unit. For example, if you integrate a 56K CSU/DSU or T1 CSU/DSU on your router, you can use this command to test the module. To get more information, check outcisco.com/univercd/cc/td/doc/product/software/ios123/123cgcr/inter_r/int_t1g.htm#wp1139872">Cisco documentation on the test service-module command.
test crypto
This command will be very useful if you are establishing IPSec encryption between two routers. You can use it to test establishing encrypted channels with remote routers without using any real production data to trigger the connection. To get more information, check outcisco.com/en/US/products/sw/iosswrel/ps1824/products_configuration_guide_chapter09186a0080087e8b.html">Cisco documentation on the test crypto command.
isdn test
This is one of several test subcommands that do not start with test. The isdn test call interface and isdn test disconnect interface commands are very useful for any network administrator using ISDN. Using these one-line commands, you can force the router to call any number to an ISDN and disconnect the call.
You can also use this command to completely disconnect an existing call, which is a better option than using clear interface bri0/0 to disconnect a line, because clear interface bri0/0 can cause confusion between the ISDN interface and the switch. Although this command does not require any dial-up list, you still have to make sure that the ISDN service profile identifier (SPID) and switch type are correct. To get more information, check outcisco.com/univercd/cc/td/doc/product/software/ios123/123cgcr/dial_r/dia_i2g.htm#wp1159581">Cisco documentation on isdn test command.
VoIP commands
There are also several test subcommands available for VoIP. Actually, I will focus on the various different VoIP test subcommands on Cisco routers in another post. So if you are using VoIP, I recommend getting to know these subcommands in detail; try test voice, test call, test port and test tone. To get more information, check outcisco.com/univercd/cc/td/doc/product/software/ios122/122newft/122tcr/122tvr/vrg_t1.htm">Cisco documentation on VoIP commands.