You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am trying to connect to a router that is running on gns3 using telnet. After successful connection i want to execute some commands and want to press enter key after each command.
here is my code:
constmyFunc=async()=>{constconnection=newTelnet();// these parameters are just examples and most probably won't work for your use-case.constparams={host: "localhost",port: 5000,shellPrompt: ">",// or negotiationMandatory: falsetimeout: 1500,};try{awaitconnection.connect(params);}catch(error){// handle the throw (timeout)console.log(`error: ${error}`);}constres=awaitconnection.exec("enable");//here i want to press enter keyconstres1=awaitconnection.exec("show running-config",{shellPrompt: "#",});//here i want to press enter keyconsole.log(`res1: ${res1}`);};
After running this code, it successfully connects to router and then run the first command enable.
But it is not sending the enter key that why i receive the error:
Please guide me, how to resolve the issue.
The text was updated successfully, but these errors were encountered:
Hello, I am trying to connect to a router that is running on gns3 using telnet. After successful connection i want to execute some commands and want to press enter key after each command.
here is my code:
After running this code, it successfully connects to router and then run the first command enable.
But it is not sending the enter key that why i receive the error:
Please guide me, how to resolve the issue.
The text was updated successfully, but these errors were encountered: