Wednesday, August 1, 2012

Configuring SuperPuTTY for GNS3

Notes:
Host…………………….Win7 Pro
GNS3 version………….0.8.1
–note, you must have putty installed (i.e. the putty.exe file)

In my search for a tabbed console management tool for GNS3 sessions, I found several options.... but, running on a Windows platform, using gnome-terminal + running a script or using Screen wasn’t going to work. I read a little about Putty Connection Manager (PuttyCM) but it seemed outdated and the sources for the download were sketchy. I also looked into SecureCRT, what seems to be the choice of pro’s, but at $99 it broke my budget... by $99.
While researching PuttyCM I came across SuperPuTTY. There isn’t a whole lot of documentation out there on how to use it or even how to set it up with GNS3… but it’s free, and it’s a tabbed session management tool.  After spending some time fumbling around I was able to configure SuperPuTTY to establish console sessions in GNS3.

In this post I will explain how to get SuperPuTTY to work with GNS3 and a trick or two that I’ve learned while using it over the past few weeks. For Everyone’s Reference: I am a SuperPuTTY novice (if it's not mentioned here then i probably can't help ya) and I do have one problem with it...which I’ll get to later.

Some extra notes:
You will need putty exe and SuperPuTTY . Also, if you are consistent on naming your routers (I use R1, R2, R3…etc), once you set up your sessions in SuperPuTTY, the console ports should be the same no matter what lab you are working on (i.e. setting up one session in SuperPuTTY will work with any GNS3 file as long as the console port numbers are consistent). I’ll explain how to do this in a bit.

Start
Configure GNS3:
Again, you need putty exe and the SuperPutty exe files; these can be downloaded from the links inside this post. If my links are broken, you can probably find working links through google.

I created a new folder on my C: drive: (C:\SuperPutty) where I saved the SuperPuTTY extracted zip files. I also placed “ putty.exe “ in this folder as it will make life a little easier.

I opened an existing GNS3 project and navigated  to Edit > Preferences… In the General section, I went to the Terminal Settings tab. Under “Terminal Command:“ I changed the path to point to the SuperPutty.exe file on my c: drive.

Fig. 1: Terminal Command: c:\SuperPutty\SuperPutty.exe %h %p 

Next, with GNS3 Preferences still open, I clicked on Dynamips

(note: this part is not necessary but I like my console port connections to reflect the router I’m working on; e.g. R1 to use console port 2001, R2 > console port 2002, etc. In GNS3, the default console port for the first router placed on the stage is port 2000. I changed this to 2001; I now have port 2000 reserved for a router acting as a frame-relay switch.)

On the Dynamips tab I changed the  “Base Console:“ from 2000 to 2001. Now, the first router placed on the stage, R1, will use console port 2001 and increment from here (i.e. R2 will use 2002, R3 2003, etc.)

 
Fig. 2: Base Console: 2001 TCP



Configure SuperPuTTY:
Next I needed to create the connections within SuperPuTTY. I went into my c:\SuperPutty folder and started SuperPutty.exe




Fig. 3: c drive...lol





Fig. 4: SuperPutty exe file


Once SuperPuTTY is running, I went to Tools > Options (F2)
Here I needed to tell SuperPuTTY where the putty.exe file is located because putty.exe is required for the SuperPuTTY application to run. I typed the path pointing to the SuperPutty folder (c:\SuperPutty) and included “putty.exe“… If my putty.exe file was somewhere else I would change this to reflect such.

I also set the “Settings Folder (Required)“ to this same folder… this way, they can live happily together.


Fig. 5: SuperPuTTY Options 


I don’t believe I changed anything else here (i.e. I left the check-boxes to their default) and clicked Ok

Establish Sessions:
Now I needed to establish sessions; whilst in the SuperPuTTY application I right clicked on PuTTY Sessions > New




 Fig. 6: New Session



I then created a new session for R1 (Session Name: R1), added the Host Name as 127.0.0.1 (the local host loopback gns3 uses) and port number 2001. To keep things simple I used Telnet and pointed to my putty.exe configuration file named “gns3“ as the “PuTTY Session Profile"…(Note: this Session Profile file was created using putty.exe and is simply the size of the console window, the color and type of font, the history size, etc. … basically this is my viewing preference. Instructions on how to configure this can be found online... I think there is even a youtube video on it)



Fig. 7: R1 Session


I repeated this 7 more times so that I would have a total of 8 router sessions available, making sure I incremented the Session Name and Port number each time. In the future, if I create a lab where I need 9 routers, I can easily add the ninth gate repeating the above. I should also mention that the Session Name is only locally significant to SuperPuTTY; In other words, the Session Name does not have to match the name of the router in GNS3. SuperPuTTY goes by the Host Name (127.0.0.1) and the Port number… as has been my experience thus far.
 


Fig. 8: R8...note the port number is 2008 and the Session Name reflects the router number

 Fig. 9: I also created a "FR" session in case I'm using a router as a
frame-relay switch (assigned to port 2000)


Note: If I’m using a router as a frame-relay switch, I want to make sure That router in GNS3 is using port 2000. I can do this by right clicking on the router and selecting “ Change console port “ within GNS3…
Fig. 10: GNS3 - Changing the console port number



Back to the SuperPuTTY Config…
Of course I wanted to save this layout so I wouldn’t have to do all that typing again!

Fig. 11: Save layout




I now have 8 router sessions ready to go. I can double click on a router number (i.e. R1) and it will open the telnet session for that router (assuming that router is running / started in GNS3)
Fig. 12: Sessions


When I’m done:
When I’m done I simply go into GNS3 and stop all the routers; this will close the telnet sessions in SuperPuTTY.

My Error:
Now, as mentioned earlier, I do have one slight problem that I haven’t had time to troubleshoot… and it’s such a small issue that it doesn’t bother me. Here’s the problem: If I’m in GNS3 and do not have SuperPuTTY.exe running, I can double click on a router (assuming the router / node has been started) and SuperPuTTY will automatically open, but there will be an error…

Fig. 13: Fatal Error



It’s not as Fatal as it leads one to believe… no one dies in this network. This is not a big deal for me as I just click ok and move over to the Sessions table, double click on the router names I want to console to and it works just fine. But, this error automatically opens up a session (usually 2002) which I end up right-clicking and closing. It’s a slight annoyance but I haven’t had time to troubleshoot this. If you have a quick solution, please post it below. I'm sure it's an easy fix.

Also note, I started this post a few weeks ago and just now had time to finish it… that said, I hope I didn’t leave any steps out! If so, please let me know… hth
Cheers!


Oh! A trick…I almost forgot!
Let’s say I have 5 new, clean routers on my GNS3 stage and I want to configure the line con 0 for exec-time 0 0, logg synch, and no ip domain look…basic lab configs that I want on all routers…I suspect I would have to do that for each of the 5 routers; nope! I can program all of them at the same time using the “Commands” prompt...

Fig. 14: Commands Prompt; here I have 3
sessions, after putting each router into
enable mode I can then program all 3 at
the same time!
Also, don’t forget… each console window can be dragged off the “docking port”… or stage; just left click the tab for the router you want to detach and drag it off. Repeat the opposite to place it back. Na zdorov'ya!






15 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Gracias, informaciĆ³n puntual y valiosa.

    ReplyDelete
  3. Now there is an easier solution

    http://www.youtube.com/watch?v=ftl-daekJ8c

    ReplyDelete
  4. A quick solution to your error...putty defaults to attempting to connect via SSH, you need to amend your command within GNS3 to...
    c:\SuperPutty\SuperPutty.exe -telnet %h %p

    My gns3 config uses the command...
    SuperPutty.exe -telnet "%h -P %p -wt "%d" -gns3 5 -skin 4"
    For this to work I needed to install a patched version of putty from...
    http://forum.gns3.net/topic5016.html


    ReplyDelete
    Replies
    1. I'm trying to get something similar done, but with KiTTY (can't help it, I need the background image). The problem is, that when I pass either -wt or -title as an option for superputty I receive the host does not exist error(without these options it connects, but I'll get localhost/127.0.0.1 in the title of the tab - ugly).
      Any idea how could this be solved?

      Delete
    2. Awesome, spent ages trying to get this to work till I found you're guide.
      Thanks.

      Delete
    3. Superputty options - Tabs and Docking - Tab Text - change to dynamic - issue resolved.

      Delete
  5. i m trying to large the font size of supperputty in gns3, but it can't save, buttom show open instead of savi button option, can anyone help me?

    ReplyDelete
  6. Assalamo alaykom
    Good News i ve fixed the problme
    1. SupperPutty.ext and putty.exe save them were u installed gns. like C:\Program Files\GNS3
    2. When you want to upload file into supper putty (as it explained above) upload it from here (C:\Program Files\GNS3\putty.exe)


    ReplyDelete
  7. 1. Open Putty from GNS folder where you have installed the GNS3
    2. select the appearance from left hand site and click on the default settings
    3. After that click on save button. Done. Thats is

    ReplyDelete
  8. Thanks a lot bro your's blog cleared my confusions.

    ReplyDelete
  9. but how supperputty will run with gns3 automatically. I have to run seperatlly

    ReplyDelete