cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
189
Views
0
Helpful
1
Replies

TCL Scripting, need help !

illusion_rox
Level 1
Level 1

Hi all, i have a requirement in which i have to shut and no shut a particular tunnel at around 20+ spokes from the hub. I want to write the script in which it says that go to int tunnel 1 (its always tunnel 1 ) shut and no shut. At each spoke i have authentication through AAA but i am expecting then when i will be doing this activity they will be accessible via local username/pass only which is constant throughout. so this is the steps i need

go to particular WAN IP

enter username

enter password

enable

enter password

conf t

int tun 1

sh

no sh

end

exit

Can some 1 help me write this script ?

1 Reply 1

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Ovais,

for this kind of things you could use the expect library under tcl.

http://expect.nist.gov/

this is thought to be able to manage interactive logins

only warning: when you shut tunnel1 the branch is still reachable ?

www.activestate.com activetcl 8.4.x or later should have an expect library

you need to build a list of devices ip addresses that will be indexed in a for cycle and in the for body there the instructions for performing the required actions

I used it and it works well. I had used a 5.21 version of porting to windows

if you have a linux box it should be even easier

commands are

expect "sername"

send $user

expect "assoword"

send $pass

during configuration the expect should match only the hostname

Hope to help

Giuseppe

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card