Network Toolkit – Using tclsh for general ping testing

For a small bit of trivia, tclsh stands for Tool Command Language Shell. This has the potential of being a very versatile tool. This has been in IOS since the latest version of the 12.2S and 12.3T trains. I just started working with this recently. I had heard of this before but everything I saw indicated it was a tool that was good mostly for programmers. In the CCNP classes, this is used as a method of pinging all of the addresses you need to for a particular lab to make sure that all is working. This can be extended to use in the real world by checking all of the critical ip addresses in a particular remote office when you are working on a problem. You start using TCLSH by typing that command into a router. You must be running at privilege level 15 or you wont have access to the command.

Once you are at the TCL prompt (it will look something like Router_name(tcl)#, you can then paste the following script into the router –

foreach address {
10.1.1.5
10.1.1.6
10.5.1.1
192.168.1.1
192.168.1.2
} { ping $address }

You should a response on the router something like this when as the script runs –

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/8 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.5.1.1, timeout is 2 seconds:
…..
Success rate is 0 percent (0/5)
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
…..
Success rate is 0 percent (0/5)
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
…..
Success rate is 0 percent (0/5)

Press CTRL-Z to exit the TCL shell and back to the enable prompt.
Modify the script you see above with the ip addresses to reflect the actual addresses you need to test and you should be good to go.

Send to Kindle
This entry was posted in Blog Entries, CCNP and tagged , . Bookmark the permalink.