Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Boot and config router cisco automatic using TCL script

Hello everyone, 
I am a beginner. I search for the course, how can we automatically boot config and cisco router using TCL script? 
I do not know if it is possible. 
If yes, how is it? 
If not, what solution can it replace? 
Well thank you everyone!

5 REPLIES
Cisco Employee

On the network management

On the network management thread, you mentioned that you want to fully boot a router (including the IOS) over the network.  This isn't fully possible, at least not on all platforms.  You need to at least have some image on the router.  Then, assuming the router does not have a valid startup configuration, it will boot, request an IP via DHCP, get a TFTP boot server, and fetch an initial config file.  One you can do that, you can push a config that contains an EEM applet to the router.  This EEM script can then download a more complex Tcl script.  Once you have Tcl on there, the sky is the limit.  You can do all sorts of things including downloading new IOS and configuring any parameters you want. 

 

As I pointed out previously, this is exactly what I did at CiscoLive this year in San Francisco.  I did it with switches, but the same procedure will work with routers.  I included all of my code and documented some of the process at https://supportforums.cisco.com/blog/12218591/automating-cisco-live-2014-san-francisco .

New Member

Hello Joseph, Thank you for

Hello Joseph, 
Thank you for your reply. 
In your opinion, what is to say that we need EEM in the config file and download this EEM TCL scripts? But after downloading tcl script, how do you Execute? Waiting until the end of AutoInstall and execute command "tclsh script.tcl"? I await your reply with impatience. 
Have a nice day.

Cisco Employee

The EEM Tcl policy that gets

The EEM Tcl policy that gets downloaded can execute on a timer.  If you look at http://www.marcuscom.com/viewvc/viewvc.cgi/marcuscom/switch-ztp/trunk/eem/tm_sw_autoconf.tcl?revision=19678&view=markup you will see that this policy, once registered, will start based on a one second timer.

New Member

Hello,For the script, you

Hello,

For the script, you must configure the policy in the tcl file startup-config; is that it? 

So if the file no longer resides on nvram, the policy would be executed?

Thanks very much.

Have a nice day

Cisco Employee

I don't understand the

I don't understand the question.  The Tcl script will be copied to the device, then registered in the running config.  In my solution, the startup-config is replaced with the actual config for the device.  This replacement startup-config does NOT contain the line to register the EEM Tcl policy.  The result is that while the Tcl script may still reside on flash, it is not registered, and thus does not run when the device reboots.

710
Views
5
Helpful
5
Replies