Monthly Archives: July 2010

Enhanced ping sweep script

The regular ping sweep script used to verify The Golden Moment can be a bit annoying due to the massive amount of output it generates. I’ve written a new version that is meant to be easy to remember. There could be a lot more fancy stuff but i want it simple so that I can easily recreate it from memory at any time (read: CCIE-lab).

Here is a full version of it including all IP address in my current scenario (Cisco 360, Lab 15):

foreach address {
160.20.14.1
160.20.123.1
160.20.101.1
160.20.10.1
160.20.16.1
160.20.123.2
160.20.102.1
160.20.25.2
160.20.36.3
160.20.123.3
160.20.103.1
160.20.163.1
160.20.169.1
160.20.174.1
160.20.40.4
160.20.14.4
160.20.104.1
160.20.25.5
160.20.105.1
160.20.16.6
160.20.106.1
160.20.10.10
160.20.17.10
160.20.17.20
160.20.40.20
160.20.36.6
} {
  puts -nonewline “$address:t”
  flush stdout
  set ping_response [exec “ping $address rep 3n”]
  regexp -line {(^Success.*))} $ping_response result sub1
  puts $sub1
}

This will generate the following output (when at The Golden Moment):

160.20.14.1:     Success rate is 100 percent (3/3)
160.20.123.1:   Success rate is 100 percent (3/3)
160.20.101.1:   Success rate is 100 percent (3/3)
160.20.10.1:     Success rate is 100 percent (3/3)
160.20.16.1:     Success rate is 100 percent (3/3)
160.20.123.2:   Success rate is 100 percent (3/3)
160.20.102.1:   Success rate is 100 percent (3/3)
160.20.25.2:     Success rate is 100 percent (3/3)
160.20.36.3:     Success rate is 100 percent (3/3)
160.20.123.3:   Success rate is 100 percent (3/3)
160.20.103.1:   Success rate is 100 percent (3/3)
160.20.163.1:   Success rate is 100 percent (3/3)
160.20.169.1:   Success rate is 100 percent (3/3)
160.20.174.1:   Success rate is 100 percent (3/3)
160.20.40.4:     Success rate is 100 percent (3/3)
160.20.14.4:     Success rate is 100 percent (3/3)
160.20.104.1:   Success rate is 100 percent (3/3)
160.20.25.5:     Success rate is 100 percent (3/3)
160.20.105.1:   Success rate is 100 percent (3/3)
160.20.16.6:     Success rate is 100 percent (3/3)
160.20.106.1:   Success rate is 100 percent (3/3)
160.20.10.10:   Success rate is 100 percent (3/3)
160.20.17.10:   Success rate is 100 percent (3/3)
160.20.17.20:   Success rate is 100 percent (3/3)
160.20.40.20:   Success rate is 100 percent (3/3)
160.20.36.6:     Success rate is 100 percent (3/3)

Reset startup configs in GNS3 (and some nifty always-there aliases)

So after having manually reset my CCIE-lab of 10 devices (11 counting the FRS) about 5 times I got bored and wrote an extremely simple shell script that does it for me. And of course, don’t forget to include a few aliases that really saves typing. Not to mention the risk of typos. I mean, how many times have you done “show run |include” by misstake? If you can’t see what’s wrong with the command than these aliases are not for you!

HOWTO reset the startup-config in GNS?

1) Paste the following into all your devices. Don’t forget to add another carriage return after “wr erase” so that you don’t have to [confirm] manually.

end
wr erase

!

You figure this would do it but nope, it doesn’t. You need to..

2) Shut down all your devices (the big red button in GNS3) and then run this script:

#!/bin/bash

PATH=/cygdrive/c/Files/gns3/Cisco360/cisco-360_configs

for host in R1 R2 R3 R4 R5 R6 SW1 SW2 SW3 SW4 FRS
do
  echo “Resetting $host”
  echo “hostname $host” > $PATH/$host.cfg
  echo “alias exec srb sh run | begin” >> $PATH/$host.cfg
  echo “alias exec sri sh run | include” >> $PATH/$host.cfg
  echo “alias exec srr sh run | begin ^router” >> $PATH/$host.cfg
  echo “alias exec srs sh run | section” >> $PATH/$host.cfg
done

And in case you’re wondering, if you don’t do step 2 as suggested here you have to right click on every device, choose “Startup config” and then delete everything from the text field. And of course, click OK.

Focus!

Brand new day, it’s cloudy and rain is imminent. What a perfect day for studying!

Unfortunately I got stuck with some random administration of GNS3. I automated the process of erasing startup-configs from my devices. I installed cygwin to get more tools for scripting. I fiddled with some simple tcl-scripts for IOS. And then I created a new blog.

Enough slacking, time to get started with the studies! Today it’s IPv6..

But first, lunch!

Cisco 360 and GNS3

So I’ve been a little lazy with the updates. At the moment I’m working with the Cisco 360 labs. After having browsed around for suitable rack rentals I decided to build the topology in GNS3. I had to use 3660s with NM-16ESW as Cat3560 replacements since Dynamips can’t handle those. So far it’s been working just fine. Just need to make sure to edit the Initial configs supplied by Cisco 360 as the ports used are different. This is all pretty obvious after loading the net-file and checking connections and comparing them the to configs.

The GNS3-files can be found here