From: Wayne Hines (wayneh@DataNetDev.com.au)
Date: Sun Feb 22 2004 - 21:31:04 GMT-3
Hi Cesar,
To run the tcl script (from anywhere - router, UNIX box, PC etc) (Note this
is your rsh client) that includes rsh (remote-shell) commands each router
(rsh server) must include the following in its config
conf t
ip rcmd remote-host Rtcl 172.16.0.1 Rtcl en
ip rcmd rsh-enable
end
where Rtcl is the name of box (router in this case) and 172.16.0.1 is an IP
address on that box where the rsh client requests shall come from
also on the rsh client include the following.
conf t
int Lo 0
ip address 172.16.0.1 255.255.255.255
ip rcmd source-interface Lo 0
end
Note a box can be both a rsh client and server as well as a tcl srcipt
interpreter simultaneously.
Also for this method to work, only 1 box needs to run tcl script (usually a
multiservice 2600/3600), all other boxes (any IOS box) merely need to be rsh
servers.
HTH
Wayne
-----Original Message-----
From: csaez [mailto:csaez@satec.es]
Sent: Sunday, 22 February 2004 23:09
To: 'Wayne Hines'
Subject: RE: CCIE -lab - scripts .
Hello Wayne,
I am new with all this script stuff.
What is it necessary to configure in each router to allow to run an
script like this remotely from another router? I have done it from a
UNIX station but not from a router. I have tried but always get the
"%Permission denied message".
Thanks in advance.
Cesar.
-----Mensaje original-----
De: nobody@groupstudy.com [mailto:nobody@groupstudy.com] En nombre de
Wayne Hines
Enviado el: jueves, 19 de febrero de 2004 15:23
Para: 'Rahul Barua'; ccielab@groupstudy.com
Asunto: RE: CCIE -lab - scripts .
Hello Rahul,
The only issue I found on running a tcl script similar to [yours] below
on a
locked down desktop is that if the output exceeds the buffer limit of
the
terminal emulator the first xxx lines are lost. There are a few ways to
counter this such as
conf t
line vty 0 4
!or line con 0
length 25
end
but this is not ideal as it will suspend your script and requires you to
change your config.
To improve on this would require the ability to communicate via file
systems. eg
eg 1) to pause a script without changing the line length on the router
set answer [gets stdin]
eg 2) to dump output to a file
set f "flash:\test.txt"
set x [open $f a]
puts $x [rsh $i ping $j]
close $x
Does anyone know [or can they test] if the tcl on a multiservice router
(26xx, 36xx) will support stdin and/or file system access for dumping
the
output to a file somewhere in the filesystem, so that the output can be
read
back with more?
Following a more complete scripts
Script 1 - standard ping all from all routers and sh ip route script
tclsh
foreach i {
1.1.1.1
1.1.1.2
} {
puts "****************$i***********************"
rsh $i sh ip route
foreach j {
1.1.1.1
10.1.1.1
11.1.1.1
12.1.1.1
13.1.1.1
1.1.1.2
20.1.1.1
21.1.1.1
22.1.1.1
23.1.1.1
} {
rsh $i ping $j
}
}
tclquit
Script 2 - attempt [unverified] to use file systems
tclsh
set f "flash:\\test.txt"
set x [open $f a]
foreach i {
1.1.1.1
1.1.1.2
} {
puts $x "****************$i***********************"
puts $x [rsh $i sh ip route]
foreach j {
1.1.1.1
10.1.1.1
11.1.1.1
12.1.1.1
13.1.1.1
1.1.1.2
20.1.1.1
21.1.1.1
22.1.1.1
23.1.1.1
} {
puts $x [rsh $i ping $j]
}
set answer [gets stdin]
}
close $x
tclquit
more flash:\test.txt
!Note 1
!could use more nvram:\test.txt instead
!Note 2
!more will still require changing of the router's line length, but at
least
[if the script works] the output can be reviewed when you are ready and
not
have to watch the script run.
ie - if anyone has a [non production] multiservice router accessible, we
all
would be greatful if script 2 could be tested!!
Wayne
-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com]On Behalf Of
Rahul Barua
Sent: Sunday, 8 February 2004 4:01
To: ccielab@groupstudy.com
Subject: CCIE -lab - scripts .
Dear Kasturi ,
Any help is always appreciated . any ways i am yet far away from 8hr
sessions.
wat i really wanted to ask for is small tricks n tips , well one of my
ccie
freinds says
ccie is a fight against time ,the more u save ,the better coz u can
review
ur
configs .
Th script he asked me to use is :
tclsh
foreach test {
10.1.1.1
10.2.2.2
10.3.3.3
10.4.4.4
} {ping $test} ps: works on 12.2t and above n mostly seen on 26xx (yet
to
see
a 25xx with it)
This way for checking end to end connectivity i don't have to type in
more
key
storkes .
just one script and test it on all the routers well saves 15 min , just
type
all ips in
a note pad along with the script and boy u r not waiting for a ping to
finish
to resume another one .
well i just wanted to know if there are other similar short tricks that
could
make life easier .
i bet this script will sure help a lotta guys who din't know {if people
like
that exist on this forum}.
well i use a long list of alias commands and practice to type them in
just
abt
10 min .so that i can save time .
well i have made this post before but just if someone missed it here it
is
again .
alias configure ac alias configure
ac ae alias exec
ac ai alias interface
ac as alias subinterface
ai i ip address
ai ns no shut
ai cr clock rate
ai e exit
ai ef encapsulation frame-relay
ai ep encapsulation ppp
ai fm frame-relay map ip
ai fi frame-relay interface-dlci
ai nfi no frame-relay inver
ai frts frame-relay traffic-shap
as i ip address
as ns no shut
as cr clock rate
as e exit
as ef encapsulation frame-relay
as ep encapsulation ppp
as fm frame-relay map ip
as fi frame-relay interface-dlci
as nfi no frame-relay inver
as frts frame-relay traffic-shap
ac r router rip
ac e router eigrp
ac o router ospf
ac is router isis
ac b router bgp
ac a access-list
ac na no access-list
ac ia ip access-list
ac nia no ip access-list
ac i interface
ac rm route-map
ac nrm no route-map
ac di default interface
ae a sh access-list
ae b sh runn | begin
ae c conf t
ae sr sh runn | e alias
ae s sh ip inter brief | e unass
ae si sh ip route
ae i sh runn interface
ae sp sh ip protocols
ae sf sh frame-relay
ae sn sh isdn
ae sa sh atm
ae so sh ip ospf
ae se sh ip eigrp
ae sb sh ip bgp
ae sm sh ip mroute
ae ci clear ip route *
ae co clear ip ospf process
ae cb clear ip bgp *
ae sb sh ip bgp
ae nd undebug all
ae d debug
ae dci debug condition inteface
ae ndc no debug condition interface
ae sc show controller serial
ae v sh vlan
ae sis sh interface status
ae st sh inter trunk
ac vd vlan database
ae sec show ether
no ip domain lookup
line con 0
logg sync
exec-t 0 0
lin vty 0 4
logg sync
exec-t 0 0
Regards
Rahul Barua .
" Do,Or do not.There is no try . " - Yoda .
This archive was generated by hypermail 2.1.4 : Fri Mar 05 2004 - 07:13:55 GMT-3