Re: Quick method for testing reachability of all interfaces of

From: Matthew Poole (matthew.poole@blueyonder.co.uk)
Date: Sat Apr 19 2003 - 08:52:18 GMT-3


I worked on this with a colleague, Yasser Mahmud and we came up with a
fantastic variant of this,. where from one box we can RSH into every other
box and run the TCL script. I ran about 130 pings in 2 minutes.

It's a little complicated to understand but well worth the work. On, my
online lab I had
a lot of 2500's and 3550's which don't support TCL but do support RSH.
Below is copy of an email I sento out to another study group.

It sequences through all the routers and switches on your network, provided
they have loopbacks numbered sequentially and can be pinged, i.e.

R1 - 172.22.1.1
R2 - 172.22.2.2

You need to prepare the routers who will be accessed remotely, I do this
when I'm pasting all my aliases in -

ip rcmd rsh-enable
ip rcmd remote-host R7-(R2) 172.22.2.2 R7-(R2) enable
ip rcmd source-interface Loopback0

Where R7-(R2) is the hostname of the router running the TCL script and the
IP address is it's loopback, Also include this on the router runing the
script.

The script itself is as follows:

tclsh
foreach i {2 3} {
puts "****************R$i********************"
foreach pl {
172.22.3.3
172.22.1.1
172.22.0.18
} {rsh 172.22.$i.$i ping $pl}
}

Line 2 variable "i" is the IP octet, in my numbering scheme this will enter
a 2 in the 3rd and 4th octets, on the second time round a "3". If I had
routers 172.16.4.4 and 172.16.99.99 this would have read foreach i {2 3 4
99} {

It will then print a line showing which router is having the code run.

The next 3 lines are the ip addresses to be pinged, obviously this needs to
have all IP addresses in your network - remember if you want local Frame
Relay networks included you'll need a mapping.

The penultimate line calls the RSH (using i assigned earlier) then sequences
through each IP address with a ping.

Simply paste this script in to the router - We only tested It works on 2600
& 3600. It definately doesn't work on 2500 and 4500, a simple test is
typing tclsh at the exec prompt to see if the prompt becomes (tcl)#.

Yasser found a good tutorial at:-
http://hegel.ittc.ukans.edu/topics/tcltk/tutorial-noplugin/tutorial-2.html

A sample output is -

R2-(R3)#
R2-(R3)#tclsh
R2-(R3)(tcl)#foreach i {2 5} {
+>puts "****************R$i********************"
+>foreach pl {
+>172.22.3.3
+>172.22.1.1
+>172.22.0.18
+>} {rsh 172.22.$i.$i ping $pl}
+>}
****************R2********************
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.22.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/5 ms

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.22.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/16/16 ms

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.22.0.18, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 48/48/49 ms
****************R5********************
 Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.22.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/52/124 ms

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.22.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 172.22.0.18, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/16/20 ms

R2-(R3)(tcl)#tclquit
R2-(R3)#

----- Original Message -----
From: "Kristof Ulrix" <kristof@uk-systems.com>
To: "Wayne Hines" <wayneh@DataNetDev.com.au>; <ccielab@groupstudy.com>
Sent: Friday, April 18, 2003 2:56 PM
Subject: RE: Quick method for testing reachability of all interfaces of all
routers?

> You can use the tcl shell commands:
>
> tclsh
> foreach pl {
> 128.200.1.1
> 133.10.0.1
> 133.10.0.2
> } {ping $pl}
>
> HTH
>
> Kristof Ulrix
>
> -----Oorspronkelijk bericht-----
> Van: nobody@groupstudy.com [mailto:nobody@groupstudy.com]Namens Wayne
> Hines
> Verzonden: vrijdag 18 april 2003 14:26
> Aan: ccielab@groupstudy.com
> Onderwerp: Quick method for testing reachability of all interfaces of
> all routers?
>
>
> Hello Group
>
> In the absense of tools such as Ciscoworks or 3rd party tools in THE LAB,
> has anyone come up with a quick way of testing interface reachability for
> all interfaces of all routers. (and no I do not trust myself to read each
> line of the sh ip route output under pressure.)
>
> My thoughts were to create a series of ping statements for each interface.
> (This can be done quickly by copying all the configs together, sorting
them
> alphabetically grabing the ip address statements and changing them to ping
> statements) ie.
> ping 128.200.1.1
> ping 133.10.0.1
> ping 133.10.0.2
> ping 133.10.0.3
> ping 133.10.0.4
> ping 133.10.0.5
> ping 133.10.0.6
> ping 133.10.10.1
> ping 133.10.20.1
> ping 133.10.20.10
> ping 133.10.30.1
> ping 133.10.40.1
> ping 133.10.60.1
> ping 133.10.60.3
> ping 133.10.60.4
> ping 133.10.70.1
> ping 133.10.80.1
> ping 133.10.90.1
> ping 133.10.90.2
> ping 133.200.0.26
> ping 133.200.0.36
> ping 133.200.0.62
> ping 133.200.0.63
> ping 160.100.1.1
> ping 160.100.1.254
> ping 160.100.100.1
> ping 160.100.128.1
> ping 160.100.129.1
> ping 160.100.130.1
> ping 160.100.2.1
> ping 160.100.2.254
> ping 161.100.1.1
> ping 172.16.30.2
> ping 172.16.30.22
> ping 172.16.30.3
> ping 172.16.30.6
> ping 192.168.1.1
> ping 192.190.100.1
> ping 192.190.101.1
> ping 192.190.102.1
>
> but if I try to do a copy/paste to the router via either a console session
> or a telnet session buffer overflow results and characters are dropped.
> Hence this approach as is does not work. Has anyone come up with a
solution
> that enables reliable and quick reachability testing of all interfaces of
> all routers.
>
> thanks in advance
> Wayne Hines
> B.Sc., M.Sc., CMACS Proj. Man., CSS1, CCDP+Net. Man.+Voice+ATM, CCNP, CNE,
> MCNE, MCSE
> Database & Network Developers - your Cisco Premier Partner / Novell
Business
> Partner
> Mailing: P.O. Box 14283 Melbourne 8001
> Email: wayneh@DataNetDev.com.au
> Web: http://www.DataNetDev.com.au/
> Tel: +61 (0)3 9329 6444
> Mobile: +61 (0)41 152 4486



This archive was generated by hypermail 2.1.4 : Thu May 01 2003 - 13:35:58 GMT-3