[nsp] Cisco commands automatically sent

Michal Mertl mime@kpnqwest.cz
Fri, 9 Aug 2002 17:27:34 +0200 (CEST)


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 w=
here 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/
>

-- 
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čínaje datem 1.5. 2002 došlo k provoznímu
sloučení společností KPNQwest a GTS