Building network automation solutions

9 module online course

Start now!

Running IOS commands from Tclsh: the details you never wanted to know

You might be aware that there are two ways of executing IOS CLI commands from IOS tclsh: either you insert the IOS commands directly in the Tcl code (tclsh passes any unknown commands to the CLI parser) or you execute them with the exec command. There are subtle differences between the two methods, described in the “Executing IOS commands from Tcl shell article” in the CT3 wiki.

Read the full article in the CT3 wiki


  1. Can a script be used to replace the IOS?
  2. You have to be careful with the ios_config command in Tclsh. Some config modes require an explicit "end" command passed to them to properly exit out of the config mode and ios_config does not do this for you. The most glaring example is EEM applet config mode. If you use ios_config to configure an eem applet and forget to add an "end" command to the end of the list, that applet will be stuck - can't modify it, can't remove it, all you can do is reload.
Add comment