Re: How to reload a Cisco Router in C#? - WeOnlyDo Discussion board

Re: How to reload a Cisco Router in C#? (General questions)

by zubenelgenubi, Friday, May 02, 2008, 12:20 (6049 days ago) @ woddrazen

Thanks for the quick reply,

I have set a breakpoint in the Connectd event to try to debug, but the code never gets past the .Connect() method, where it times out as described above.

I have tried telnet as well from the Code as well as from putty. The .Connect method still times out. Here is the current code:

Ssh1.Hostname = 192.168.0.1 ;
Ssh1.Login = user ;
Ssh1.Password = pass ;
Ssh1.Protocol = WeOnlyDo.Client.SSH.SupportedProtocols.SSHAuto;
Ssh1.Timeout = 10;
Ssh1.TerminalType = tty ;
Ssh1.Blocking = true;

Ssh1.Connect();
Ssh1.WaitFor( cisco871# );
Ssh1.Send( configure terminal
);
Ssh1.WaitFor( cisco871#(config) );
Ssh1.Send( file prompt quiet
);
Ssh1.WaitFor( cisco871#(config) );
Ssh1.Send( end
);
Ssh1.WaitFor( cisco871# );
Ssh1.Send( copy OldConfig startup-config
);
Ssh1.Send( reload
);
Ssh1.WaitFor( Proceed with reload? [confirm] );
Ssh1.Send(
);

TIA


Complete thread: