back to overview
You cannot start a Telnet session from Tcl shell
Recently, I've got a really interesting question: “If I start a telnet or SSH session from my Tcl shell with the exec command, I get the initial text, but then it all freezes. What's wrong?”
Let's start with the basic picture: When you open a telnet session to a router, the input and output is captured by the Exec process. When you open an outgoing telnet or SSH session to another router, the Exec process implements the telnet/ssh client functionality and switches the input/output data between the two TCP sessions:
However, when you start the Tcl shell, the Exec CLI loses its control of the input/output streams, as they are taken over by Tclsh. The only means of communicating with the Exec CLI is through the typeahead and exec commands:
So, if you start another Telnet session with the exec command, the Tclsh still controls the input/output of the user session and there is no way for the telnet client in the Exec CLI to communicate with the user.
Let's start with the basic picture: When you open a telnet session to a router, the input and output is captured by the Exec process. When you open an outgoing telnet or SSH session to another router, the Exec process implements the telnet/ssh client functionality and switches the input/output data between the two TCP sessions:



This article is part of You've asked for it series.
Related posts by categories
Please read our Blog Commenting Policy before writing a comment.
1 comment:
Constructive courteous comments are most welcome. Anonymous trolling will be removed with prejudice.
Hello,
ReplyDeleteI want to get the running config of a remote router from a local router. How can I do with TCL ? I have searched many but can not find the solution.
Any help will be highly appreciated !
Nguyen Su Tam