Wednesday, July 16, 2008

Simple TCLSH, multiple ping from IOS

This is simple way to multiple ping from IOS command in one way, use tclsh. tclsh is IOS scripting like shell scripting in *nix machine. Just type your script in note text, paste it in your terminal console.

foreach IP {
192.168.0.1
192.168.1.1
192.168.2.1
192.168.3.1
} { "ping $IP" }


Router# tclsh
Router(tcl)#foreach IP {
+>192.168.0.1
+>192.168.1.1
+>192.168.2.1
+>192.168.3.1
+>} { "ping $IP" }

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/4 ms

No comments: