Testing Connectivity

Testing the connectivity is something that basically came up for me with the CCIE labs to verify the end-to-end connectivity in the Lab. But the more and the bigger networks I implement the more its a thing I like to do before I really install them (actually I configure them 99% of the time in our lab). In the end it will not verify that everything works correct but it gives me a good level of confidence before installing the devices on site.

Which thing to use to test heavily depends on the platform and the IOS version. There are two options to test I know of:

  • TCL Scripts
  • Switch Macros

Switch macros are for switches and TCL Scripts should nowadays work on every router with a kinda up to date IOS Image (for more informations on which IOS and feature set to use klick here). I personally prefer the TCL Scripts over the switch macros and am quite happy that the Cat3k switches with an IOS version of 12.2(40)SE and above are now TCL enabled too. But to have the article complete I’ll show on how to do the ping tests with switch macros too.

The best way to start, no matter if its for TCL or a switch macro, is to get a list with all IP addresses of the devices in question. First get the list of all IPs within the device with the command sh ip int brief | e una, this will only show the interfaces with a configured IP address. This can really start to be slow depending on the number of IPs each device has. But with CRT and probably other terminal session applications you can use a shortcut (press alt and then mark the area with the mouse) which allows you to only mark the IPs instead of the whole line. So you can copy&paste once per device and got all IPs with it:

crtalt

After you got your list, you have to create the TCL script:

tclsh
foreach LAB {
204.12.1.1
167.1.135.1
167.1.13.1
150.1.1.1
167.1.27.2
150.1.2.2
204.12.1.3
167.1.135.3
167.1.34.3
167.1.13.3
150.1.3.3
167.1.4.4
192.10.1.4
167.1.34.4
167.1.45.4
150.1.4.4
167.1.5.5
167.1.58.5
167.1.135.5
167.1.45.5
150.1.5.5
150.1.6.6
167.1.27.7
167.1.78.7
167.1.58.8
167.1.78.8
} {ping $LAB repeat 3 timeout 1}

After you hit enter, the router (or Cat3k Switch) will ping every IP listed with three repeats (instead of five) and a timeout of one second (instead of two seconds) this is just to speed it up if one or more addresses are not reachable. Just ensure that you use tclquit to exit the TCL shell.

The switch macros are done this way:

macro name doPing
do ping 164.1.18.1 repeat 3 timeout 1
do ping 164.1.12.1 repeat 3 timeout 1
do ping 164.1.13.1 repeat 3 timeout 1
do ping 150.1.1.1 repeat 3 timeout 1
do ping 164.1.26.2 repeat 3 timeout 1
do ping 164.1.12.2 repeat 3 timeout 1
do ping 164.1.23.2 repeat 3 timeout 1
do ping 150.1.2.2 repeat 3 timeout 1
do ping 164.1.34.3 repeat 3 timeout 1
do ping 164.1.35.3 repeat 3 timeout 1
do ping 164.1.23.3 repeat 3 timeout 1
do ping 164.1.13.3 repeat 3 timeout 1
do ping 150.1.3.3 repeat 3 timeout 1
do ping 164.1.47.4 repeat 3 timeout 1
do ping 204.12.1.4 repeat 3 timeout 1
do ping 164.1.34.4 repeat 3 timeout 1
do ping 164.1.45.4 repeat 3 timeout 1
do ping 150.1.4.4 repeat 3 timeout 1
do ping 164.1.5.5 repeat 3 timeout 1
do ping 164.1.55.5 repeat 3 timeout 1
do ping 164.1.35.5 repeat 3 timeout 1
do ping 164.1.45.5 repeat 3 timeout 1
do ping 150.1.5.5 repeat 3 timeout 1
do ping 192.10.1.6 repeat 3 timeout 1
do ping 164.1.26.6 repeat 3 timeout 1
do ping 54.1.2.6 repeat 3 timeout 1
do ping 150.1.6.6 repeat 3 timeout 1
do ping 164.1.7.7 repeat 3 timeout 1
do ping 164.1.47.7 repeat 3 timeout 1
do ping 164.1.31.7 repeat 3 timeout 1
do ping 164.1.14.7 repeat 3 timeout 1
do ping 150.1.7.7 repeat 3 timeout 1
do ping 164.1.18.8 repeat 3 timeout 1
do ping 164.1.24.8 repeat 3 timeout 1
do ping 164.1.32.8 repeat 3 timeout 1
do ping 150.1.8.8 repeat 3 timeout 1
do ping 164.1.9.9 repeat 3 timeout 1
do ping 164.1.31.9 repeat 3 timeout 1
do ping 164.1.32.9 repeat 3 timeout 1
do ping 164.1.43.9 repeat 3 timeout 1
do ping 150.1.9.9 repeat 3 timeout 1
do ping 164.1.24.10 repeat 3 timeout 1
do ping 164.1.14.10 repeat 3 timeout 1
do ping 164.1.43.10 repeat 3 timeout 1
do ping 150.1.10.10 repeat 3 timeout 1
@

To execute the switch macro, use macro global apply doPing within the configuration mode. The macro will stay in the switch’s configuration so you will have to delete it with no macro name doPing. As you can see, creating and using a switch macro is more effort compared to the TCL scripts (I’m a lazy guy :)) and thats why Im quite happy that Cisco now supports TCL scripts for the Cat3k switches and who knows which others in the future.

Advertisements

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s