TCL Script – Ping Test

One of the major parts of the CCIE lab is ensuring you have full reachability to your network.

How do you ping all your addresses? TCL script or tickle script as it is usually pronounced is the answer to your problems.

It is a bit trickier now they are using Putty as the terminal client as with Secure CRT there was a neat little trick you could use to harvest all your ip addresses.

using the command sh ip alias – you can easily bring up all all the live ip’s on each device – with secure CRT you could then hold down the alt key and select only the IP addresses.

With putty you will just need to delete some of the fluff – unless anyone knows a way to do this?

R1#sh ip alias
Address Type        IP Address      Port
Interface                150.19.8.8
Interface                183.19.28.8
R1#

So get all the IP addresses from all your devices and drop them into notepad

150.19.8.8
183.19.28.8
150.19.2.2
183.19.28.2
183.19.123.2

Then add the following text to the notepad file

foreach address {
150.19.8.8
183.19.28.8
150.19.2.2
183.19.28.2
183.19.123.2} { ping $address
}

Then once you have all the IP’s from every one of your devices go onto one of your routers and enter the command tclsh this will drop you into the tcl shell.

R4#tclsh
R4(tcl)#

Then paste in the contents of your notepad file and hit enter

R4(tcl)#tclsh

R4(tcl)#foreach address {
+>150.19.2.2
+>183.19.28.2
+>183.19.123.2
+>150.19.1.1
+>183.19.17.1
+>183.19.123.1} { ping $address
+>}

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 150.19.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/58/60 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 183.19.28.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/59/60 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 183.19.123.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/57/61 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 150.19.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 112/114/117 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 183.19.17.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 112/113/116 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 183.19.123.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 112/115/120 ms
R4(tcl)#

Type exit to leave the tcl shell

R4#

This works on the switches and the routers

It will take you less than 5 minutes to knock this together and if you run it a few times through your lab after you have dealt with redistribution it could highlight some potential issues.

UPDATE – reduce the pings from 5 to 2

If you want to make the TCL Script only ping twice instead of the default of 5 simply add re 2 at the end of the ping command.

{ ping $address re 2

Good luck with your studies.

Roger

Comments

  1. Derrick says

    Good information. Have you tried the ALT key in Putty? It appears to work for me. Best of luck on the lab.

  2. Euan says

    Alt+left mouse button drag allows you to column select in Putty. This can be configured in Windows -> Selection to be the inverse.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>