[nsp] Cisco commands automatically sent

MacDonald, James James.MacDonald@attcanada.com
Fri, 9 Aug 2002 09:45:25 -0600


I use expect as well ... everything from password changes to major =
config
changes and netflow collection. There are a tonne of examples on the =
web ...
get the O'Reilly Expect book to help learn it. Also, I found a few ways =
to
encrypt password files on a unix box, and read that into the script =
when it
runs ... allowing you to help protect passwords better then clear text
passwords.


James MacDonald, CCNP
Senior Platform Manager, IP
Network Operations
AT&T Canada Corp.
370 King St W., 6th Floor
Toronto, ON M5V1J9
Ph: 416-204-5793
Fx: 416-204-5744
Emergency: 416-204-5700 (NMC Hotline)
Email: james.macdonald@attcanada.com


-----Original Message-----
From: Michal Mertl [mailto:mime@kpnqwest.cz]
Sent: Friday, August 09, 2002 11:28 AM
To: odusseus
Cc: cisco-nsp
Subject: Re: [nsp] Cisco commands automatically sent


On Fri, 9 Aug 2002, [iso-8859-1] odusseus wrote:

> Hi,
>
> +----------------+
> | Unix box       |
> | running a prog |
> +----------------+
>         |
>         |
>         |
>         |
>         V
> +---------------------+
> | Cisco device        |
> | (router or switche) |
> +---------------------+
>
>
> I would like to know if it is possible to write a program on a Unix =
box
where it could automatically run some commands on a
> cisco devices (7200 series and 3500XL) like:
>
> enable
> conf t
> int fa0/1
> shut
> end
>

I know about at least two utilities - netcat and expect. Expect is much
more powerfull (can check results of commands - syntax error could stop
it) but harder to use. If you make sure the commands are correct I =
suggest
using netcat.

I use it like this:
nc ${address} 23 << END_OF_FILE
username
password
en
enable-password
conf t
int fa0/1
 shut
end
wr
END_OF_FILE

> Thank you.
>
> Regards,
>
> Christophe
> ------------------------------------------
>
> Faites un voeu et puis Voila ! www.voila.fr
>
> _______________________________________________
> cisco-nsp mailing list  real_name)s@puck.nether.net
> http://puck.nether.net/mailman/listinfo/cisco-nsp
> archive at http://puck.nether.net/pipermail/cisco-nsp/
>

--=20
Michal Mertl
Specialist IP Service Development
KPNQwest Czechia s.r.o.
GTS Czech a.s.
Vinohradska 184
130 52 Praha 3
Tel.: +420 2 96157111
Fax: +420 2 96157444
e-mail: Michal.Mertl@kpnqwest.cz
____________________________________________
Po=E8=EDnaje datem 1.5. 2002 do=B9lo k provozn=EDmu
slou=E8en=ED spole=E8nost=ED KPNQwest a GTS


_______________________________________________
cisco-nsp mailing list  real_name)s@puck.nether.net
http://puck.nether.net/mailman/listinfo/cisco-nsp
archive at http://puck.nether.net/pipermail/cisco-nsp/