Re: Help, using script to edit router config (entering different modes automatically)



On Friday 27 October 2006 09:23, Michael Alipio wrote:
Hi,

Suppose I have an appliance, it's not cisco but the process of updating
configuration is almost the same.

1. First you log-in either via ssh or telnet..
2. Then you go into a certain mode by typing a particular command.
3. Only after you have enter that mode, you can issue the actual editing
command, (e.g; set ip 192.168.1.1) 4. Finally, issue another command to
apply the configuration change.

I need to execute these steps on a regular basis via cron.
Step 1 is not a problem I guess because I have discovered that the
appliance supports ssh public/private key authentication. Step 2 is also
not a problem since I can execute it together with the command I use in
step 1,

ssh appliance.our.domain "conf t"

Now, what? I don't know what to do next. Any idea?

Tried Net::SSH::Perl?
http://search.cpan.org/~dbrobins/Net-SSH-Perl-1.30/lib/Net/SSH/Perl.pm

You can send multiple commands separately with that.

--
Bjørge Solli - Office:+47 55205847
Mohn-Sverdrupsenteret, Nansensenteret, Høyteknologisenteret T47
Thormöhlensgate 47, 5006 Bergen, Norway - www.nersc.no
Google Earth: www.nersc.no/GE - TOPAZ: topaz.nersc.no
.



Relevant Pages

  • RE: Redirect stdout from SSH
    ... command from the commandline the shell TTY will of cause be used and ... I did some tests on different machines ... therefore I also assume that it must be a configuration issue. ... connect from the same machines to the HPUX box using the same SSH client ...
    (SSH)
  • Re: ssh restrictions (/etc/ssh_config)
    ... is there a way to restrict commands passed to ssh to override ... command line options ... ssh obtains configuration data from the following sources in the follow‐ ... So I made a patch by myself, which I also update with every new release ...
    (SSH)
  • Re: ssh restrictions (/etc/ssh_config)
    ... is there a way to restrict commands passed to ssh to override ... command line options ... ssh obtains configuration data from the following sources in the follow‐ ... So I made a patch by myself, which I also update with every new release ...
    (SSH)
  • Re: show / copy pre-shared key in plaintext
    ... configured an appropriate tftp-server command. ... When you hard set that within a configuration ... pix uses that to get it's config at every boot. ...
    (comp.dcom.sys.cisco)
  • Re: show / copy pre-shared key in plaintext
    ... configured an appropriate tftp-server command. ... When you hard set that within a configuration the ... pix uses that to get it's config at every boot. ...
    (comp.dcom.sys.cisco)