Amazing motivation for students
Matt has an amazing blog
Matt has an amazing blog
Begin each Day, as it for one Purpose
- movie, ‘Hitch’
I am running about 12 routers in dyanmips (in a separate server). I have to open a seperate terminal for each router. This is really tedious.
The best option is to use PuTTY Connection Manager. Windows users I greatly recommend this but Linux user have no option.
I wrote this simple script to open all my routers in single terminal window with a tab for each router. Helps me when ever I run a complex network in dynamips.

Linux terminal with router consoles in Tabs
NOTE: In the below example I am considering that we have to connect to only three routers in a single window with tabbed interface.
1. create a file
# vi gnometab.sh2. enter the following code in the file
gnome-terminal -t R1 -e ‘telnet 10.1.1.10 2001′ –tab -t R2 -e ‘telnet 10.1.1.10 2002′ –tab -t R3 -e ‘telnet 10.1.1.10 2003′ NOTE: at the end of the line remember to press enter. This command should be in one line. No carriage returns in-between.3. save and exit by pressing ESC key and wq
4. run the script
# sh gnometab.sh
5. Now a terminal window opens with 3 tabs and with given title on each tab.
Command Explanation
-t = is to set the tile for the window/tab -e = is to execute the command given within the qoutes –tab = is to open a new tab in the same windowPlease feel free to customise the above code based on your requirement.
To mount the CD rom use the following command in the CLI
To mount CD
sudo mount /media/cdrom0/ -o unhide
To unmount CD
sudo umount /media/cdrom0/
Most of them use a home computer to run GNS3 or Dynamips.
These systems mostly has 1GB to 2GB ram. So It is imperative to use a low end router with low memory requirement in Dyamips to simulate complex networks.
The best cisco router which can be used for the above requirement is 3620 with 12.2(40a) IOS.
The best IdlePC value for this IOS is 0×60452150.
This is a very old IOS, so I am not really sure if this IOS is still available for download in the www.cisco.com.
Specification Summary
Router: 3620
IOS File: c3620-i-mz.122-40a.bin
IdlePC: 0×60452150
you can run about 5 to 6 of the above routers via GNS3/Linux
This can suffice the practise lab for CCNA and CCNP.
Following technologies can be practised with the above IOS:
This IOS dosen’t support MPLS.
Ubuntu 8.04 LTS is a stable realese.
Zach has written an excellent guide to install GNS3 on the Ubuntu desktop.
Please find the tutorial in his blog.
Debian has an excellent package manager called apt-get. This is more like windows installer. You don’t have to find dependencies as in native Linux, the apt-get will automatically install the required dependencies. But apt-get depends on their repositories. New softwares will not be available via repositories. So only way to install them is to download the .deb package (application file) and install it manually.
To Install the application manually:
1. Download the .deb package
# wget file.deb
2. install the package
# dpkg -i ./file.deb
The above command will install the application package in the Debian system
This is the perl code to telnet into a cisco router and run a command. I have given this code for the sake of Perl lovers. I personally prefer python as it is easy.
NOTE: to use this script you should install Net::Telnet::Cisco module. You can download this from CPAN.
#Telnet Script
#!/usr/bin/perl
## usage is ‘perl tel.pl <ipaddress> ######
use Net::Telnet::Cisco;
#Open a file for logging errors.
$errFile = “/tmp/NoTelnet.txt”;
open (ERR,”>>”.$errFile);
#########
$tr=0;
my $session = Net::Telnet::Cisco->new(Host =>$ARGV[0],Timeout=>50,Errmode=>’return’) or $tr=1;
print $ARGV[0] ,”\n”;
if($tr != 1)
{
$session->login(‘username’,'password’); #replace your username and password here
my @cmd_output = $session->cmd( ‘terminal length 0′ );
if ($session->enable(“enable-pass”) ) {
my @output = $session->cmd(’sh run’);
print “My privileges: @output\en”;
} else {
warn “Can’t enable: ” . $session->errmsg;
print ERR “Not in Tacacs or Password Incorrect for this IP $ARGV[0]\n”;
}
$session->close;
}
if($tr == 1 ) {
print “Unable to Telnet $ARGV[0]\n”;
print ERR “Unable to Telnet the Router $ARGV[0] \n”;
}
This program will telnet into a Cisco router and will display the running config of the router. Please feel free to modify the code to save the config to a file which can be used as a backup script (if you have troubles send me a mail I will send you the code).
Below is the python code with which we can telnet to any cisco router or a switch and display its running configuration.
#— Start ——
import telnetlib
HOST = “192.169.10.10″ #ipaddress of the host you are telneting
user = “cisco” #user name
password = “cisco” #user password
en_password = “cisco” #enable password (privilege level 15)
tn = telnetlib.Telnet(HOST)
tn.read_until(“Username: “)
tn.write(user + “\n”)
tn.read_until(“Password: “)
tn.write(password + “\n”)
tn.write(“enable\n”)
tn.read_until(“Password: “)
tn.write(en_password + “\n”)
tn.write(“terminal length 0\n”)
#the above command is to instruct cisco routers to display
#the output without any break or human intervention.
tn.write(“show run\n”) #display running-config of the cisco device
tn.write(“exit\n”)
print tn.read_all()
#— Stop ——
NOTE: I am writing a code which can take in a list of cisco routers (and switch) ips and will save its running-config to the local system. This will be useful during the change management (CM) when each network device’s configuration in the NOC has to be backed up.
Suddenly I was unable to add any post to my blog. Every time I tried add a post I got the message “Internet Explorer cannot display the webpage in requested format”.
After much of googling I found out that by adding the following code in the .htaccess (found in the directory where you installed wordpress or /public_html folder) the issue is resolved.
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
I got this information from the wordpress forum (REF: http://wordpress.org/support/topic/229215)
I made the changes and it worked like a charm. Thanks to the forum guys.