Intercept Cisco’s “write net” command with EEM

Posted by: admin  :  Category: Cisco, Networking

Well, here’s just a quick snippet on how to intercept Cisco’s “write net” command.

Why would I want to do it? Because people are lazy and tend to forget.
So instead of forcing them to remember, that they need to add the ‘/incoming’ directory for config writebacks,
I just let an EEM applet do the trick.

How is it working?

The EEM applet is intercepting the ‘write net’ cli command by matching all inputs against the pattern given.
Whenever the command is seen, it will run my own commands instead. Nice, huh? ;-?

Enough talking, here’s the code:

no event manager applet WRITENET
event manager applet WRITENET
event cli pattern “write net” sync yes
action 1.0 puts “Please wait …”
action 1.5 cli command “enable”
action 2.0 cli command “conf t”
action 2.1 cli command “file prompt quiet”
action 2.2 cli command “exit”
action 3.0 cli command “copy run tftp://tftp01/incoming/”
action 4.0 cli command “conf t”
action 4.1 cli command “no file prompt quiet”
action 4.2 cli command “exit”
action 5.0 puts “Copy stored to TFTP server at /incoming, good bye”

Swisscom FTTH: 6RD mit Cisco 892F nutzen

Posted by: admin  :  Category: Cisco, HowTo's, Networking

Wie bereits aufgezeigt, kann man statt dem Centro Grande oder Centro Piccolo auch problemlos einen Cisco 892F an einem Swisscom Vivo FTTH-Anschluss betreiben.

Hat man diese Hürde erstmal geschafft, möchte man den Cisco vielleicht am Swisscom-eigenen IPv6 6RD Gateway anbinden um in den Genuss von IPv6 zu kommen.

! Wichtige Information !

Die IP-Adresse des Swisscom 6RD Relays ändert per 9. April 2013:

193.5.29.1

Read more…

Swisscom Vivo FTTH Anschluss mit Cisco Router betreiben

Posted by: admin  :  Category: Cisco, Networking

Wer das Glück hat in einem mit Glasfaser erschlossenen Quartier zu wohnen, kann statt DSL mit Lichtgeschwindigkeit surfen – FTTH (Fibre to the Home) macht’s möglich. Bei Swisscom Vivo FFTH-Anschlüssen für Privatkunden wird man mit dem Centro Piccolo oder dem Centro Grande ausgestattet, was für die meisten Kunden auch mehr als ausreichend sein dürfe.

Möchte man allerdings seinen FTTH-Anschluss richtig ausreizen, bietet sich der Einsatz eines Cisco 892F Routers an. Zugegebenermassen nicht gerade ein billiges Gerät (ab rund 1000 Franken Listenpreis), dafür kriegt man aber auch alles, was ein Cisco typischerweise so zu bieten hat.
Read more…

Sleep Timeout on TCL (and Cisco too…)

Posted by: gdelmatto  :  Category: Cisco, TCL

Being used to other languages sometime leads to false assumptions, like having the same commands every now and then.
While doing some TCL scripting on a Cisco I just had the need for a ‘sleep’ command or equivalent.

Since no ‘sleep’ exists, the ‘after’ command will do. Just supply it with the timeout in milliseconds, like this for a 10-second timeout:

after 10000

Or, with a bit more overhead, but some may think it’s more readable:

after [expr {int(10 * 1000)}]

Extract and Unify Cisco Device-Types with SNMP and Perl

Posted by: gdelmatto  :  Category: Cisco, Networking, Perl, Programming

Here’s a short script which I use to extract Cisco device-types from SNMP.
Bad enough, most of these devices return their device type ID differently, e.g. sometimes prefixed with an uppercase ‘C’, sometimes without any prefix, then again sometimes we find a suffix.

So here’s a snippet, that makes them look neat, so I can work with simple and unified looking device IDs.
Read more…

RegExp Filter: Extract complete interface blocks without ‘shutdown’ statement

Posted by: gdelmatto  :  Category: Cisco, Networking, Programming, RegExp

A project I’m currently working on involges much Regurlar Expressions trickery to parse values from Cisco’s running configuration.
Here’s how to extract a complete interface block not in ‘shutdown’ state.
Read more…