Sponsored Message:

Tuesday, November 10, 2009

CCIE R&S v4.0 - Here I come

I just noticed in VUE tracking database the following entry:


It appears that my 3-day-study attempt at R&S v4.0 written was a success :-). Next thing is ~$1.400 crocodile steak at NH hotel in Brussels.

Shall we say February/March time-frame?

Sunday, November 1, 2009

New Responsibilities

By now it has become public what was in the making in the past few weeks. Starting November 1st, I have joined IPexpert, Inc. as full-time content developer and technical instructor. I will be able to devote more of my time to doing stuff I really enjoy - exploring and learning new things, writing about them and passing this to others.

I will be teaching classes in the parts of the world that are not United States. If you are scheduled on any IPexpert's R&S or SP bootcamps in Africa, Asia, Australia or Europe - see you there! If not, what are you waiting for?

What this means for this blog is uncertain at this moment. I will, of course, be publishing CCIE/CCDE related content on IPexpert's blog, but I will most certainly continue to write things here. I suppose this blog will become more personal than it was, but still relevant to networking.

She is happy about my new position. I really love her. She will become Mrs, real soon. We'll keep you posted on that!

Wednesday, September 30, 2009

Mass Change on Routers

I suppose I should post something here, since I haven't been blogging in a month.

There was, many times repeated, question on GroupStudy today.

How do I deploy my changes on many routers? Are there any tools that do that?

The answer to that question is - sure there are. Many of them. Some cost money, some are free, some offer good change control, rollback, etc. What is common with all of them is that often, one doesn't have the luxury of having them around when one needs them. For those cases, something quick-and-dirty just may be enough. The Perl script below does just that. It will pick up the list of commands to run from a file, it will pick up the list of routers from another file. It will then telnet to all routers in sequence and deploy your set of commands. There is very rudimentary error checking, so... use at your own risk.

This has been written in 15 minutes and is probably full of bugs and really bad code, but... it works for me.

#!/usr/bin/perl -w

use Net::Telnet::Cisco();
use strict;

my ($host, $user, $pass, $enab, $cmdf, $lstf, @cmds);

$cmdf = "commands.txt";
$lstf = "list.txt";

$user = "USERNAME";
$pass = "PASSWORD";
$enab = "ENABLE_PASSWORD";

sub ConfigureRouter {
my ($t, $host, $cmd);

$host = $_[0];

if (!($t = Net::Telnet::Cisco->new(Host => "$host", Errmode => "return"))) {
printf("Could not open session to '%s'\n", $host);
return;
};
if (!($t->login($user, $pass))) {
printf("Could not log into '%s' as '%s'\n", $host, $user);
return;
}
$t->enable($enab);
print("Login successful. Setting up ");
$t->print("terminal length 0");
print $t->waitfor("/#/");
$t->print("conf t");
foreach $cmd (@cmds) {
print $t->waitfor("/#/");
$t->printf("%s", $cmd);
}
print $t->waitfor("/#/");
$t->print("end");
print $t->waitfor("/#/");
$t->print("write memory");
print $t->waitfor("/#/");
$t->close();
}

#
# Main Body
#
open (CF, "< " . $cmdf) or die "Can't read the command file '$cmdf'";
@cmds = <CF>;
close(CF);

open (IF, "< " . $lstf) or die "Can't read the router list file '$lstf'";

while (defined ($host = <IF>)) {
chomp($host);
if ($host ne "") {
printf("\n\n\n%s %s %s\n", "-" x 22, $host, "-" x 22);
ConfigureRouter($host);
}
}
close(IF);


Did I say that you should use this at your own risk?