07-09-2014 06:48 AM - edited 03-03-2019 07:30 AM
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!
07-22-2014 09:07 AM
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 .
07-31-2014 08:26 AM
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.
07-31-2014 08:34 AM
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.
08-02-2014 05:52 AM
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
08-04-2014 09:52 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide