From: Brian Dennis (bdennis@internetworkexpert.com)
Date: Thu Mar 23 2006 - 01:54:05 GMT-3
Actually I just posted something about this on our forum last night.
Here is the post:
For those of you that use the TCL "ping" scripts for reachability
testing, you should be aware of the fact the 3550's do not support the
TCL shell (tclsh). A workaround is to enable RSH on the 3550 and RSH
into the 3550 from another router that does support the TCL shell. This
will allow you to run your ping script on the 3550's by "proxying" the
script through another router. Here is an example:
hostname Rack1R1
!
ip rcmd source-interface Loopback0
!
no ip domain lookup
!
interface Loopback0
ip address 150.1.1.1 255.255.255.0
hostname Rack1SW1
!
no ip domain lookup
!
ip rcmd rsh-enable
ip rcmd remote-host Rack1R1 150.1.1.1 Rack1R1 enable
!
interface Loopback0
ip address 150.1.7.7 255.255.255.0
tclsh
!
foreach ipadd {
150.1.1.1
152.1.123.1
152.1.125.1
204.12.1.7
} {puts [exec "rsh 150.1.7.7 ping $ipadd timeout 1"]}
Rack1R1#tclsh
Rack1R1#!
Rack1R1#foreach ipadd {
+>150.1.1.1
+>152.1.123.1
+>152.1.125.1
+>204.12.1.7
+>} {puts [exec "rsh 150.1.7.7 ping $ipadd timeout 1"]}
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 150.1.1.1, timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 36/42/56 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 152.1.123.1, timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 36/42/56 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 152.1.125.1, timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 36/42/60 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 204.12.1.7, timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Rack1R1#
The script was run on R1 but R1 connected remotely to SW1 via RSH and
executed the pings from SW1.
Here is an example of using RSH to do a show version on SW1 from R1:
Rack1R1#rsh 150.1.7.7 show version
Cisco IOS Software, C3550 Software (C3550-IPSERVICESK9-M), Version
12.2(25)SEC2, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2005 by Cisco Systems, Inc.
Compiled Wed 31-Aug-05 10:18 by antonino
ROM: Bootstrap program is C3550 boot loader
Rack1SW1 uptime is 6 hours, 10 minutes
System returned to ROM by power-on
System image file is "flash:c3550-ipservicesk9-mz.122-25.SEC2.bin"
This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.
A summary of U.S. laws governing Cisco cryptographic products may be
found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
<snip>
Rack1R1#
Lastly notice the difference from a standard TCL "ping" script that
isn't using RSH:
tclsh
!
foreach ipadd {
150.1.1.1
152.1.123.1
152.1.125.1
204.12.1.7
} {puts [exec "ping $ipadd timeout 1"]}
The difference is just that the "rsh 150.1.7.7" is removed.
--------------------
HTH,
Brian Dennis, CCIE #2210 (R&S/ISP-Dial/Security)
bdennis@internetworkexpert.com
Internetwork Expert, Inc.
http://www.InternetworkExpert.com
Toll Free: 877-224-8987
Direct: 775-745-6404 (Outside the US and Canada)
-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf Of
Mushtaq A. Khan
Sent: Wednesday, March 22, 2006 7:49 PM
To: Cisco certification
Subject: TCL Script for 3550
All,
My ping script works pretty well on all my 2600/3600 routers but doesn't
work on 3550. Do anyone know a way this could also work on 3550. I
searched
the groupstudy posting but couldn't find anything.
tclsh
foreach add {
1.1.1.1
2.2.2.2
} {puts [exec ping $add]}
TIA,
Mushtaq
This archive was generated by hypermail 2.1.4 : Sat Apr 01 2006 - 10:07:39 GMT-3