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

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

by zubenelgenubi, Thursday, May 01, 2008, 23:46 (6049 days ago)

Hi,

Id like to specify a new configuration and reload my cisco router using wodSSH.Net. What is the recommended method for doing so?

Here is what I have so far, but it fails to get past the connect.

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

Ssh1.Connect( 192.168.0.1 );
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(
);
Ssh1.Disconnect(); //Is this necessary?

Thanks


Complete thread: