Adding New Exercises to GNS3 WorkBench v5.x


This is a re-hash of the file /opt/GNS3/READMEs & Scripts/README to see How to use the Project folders/ which explains how to add more exercises using the model I have set up.

If you don’t already have GNS3 WorkBench installed, you need to understand that the following article assumes you have the WorkBench environment, which can be obtained from http://rednectar.net/gns3-workbench

If you start by looking at the directory structure, you will notice that all the exercises are found in folders that live in the /opt/GNS3/Project folder. Future versions of the WorkBench may have further sub-directories as I find it harder and harder to keep these files managed in a single directory. In any case they will all work along these lines:

There will be a folder that corresponds to the Project. A Project may be an Exercise or a Lab. There is really no difference, except that from the desktop there are a few folders full of shortcuts. If the shortcuts run a script that wipes out any previous saved configs, it is considered an Exercise, and can be repeated from scratch over and over. If the shortcut assumes you want to continue from where you saved last time, it is considered a Lab. I’ve modified all Lab shortcuts to have the word (continue) in the title, and all lab shortcuts are found in the Standard Layouts Folder on the desktop.

Probably the best way to create a new exercise is to copy a Folder that lives in the Project Folder, delete any files in the Configs directory, and then modify the topology.net file from within GNS3.

Each folder under /opt/GNS3/Project represents an Exercise, (including configuration examples) or a Lab.

Basic Idea:
* Each project has a folder
* If the project is meant to start with no configs at all, there will be a startup.0 (delete saved configs) script in the folder to allow you to reset the lab.
* Most projects have some basic pre-configured stuff (even if it is just names). These can be:
a) started by running startup.x (description)
b) continued later by running startup.continue
c) running any startup.x script always removes any previously saved configs.
* Any “startup” script in a Project folder that has a link to it from one of the folders on the desktop has a green “default” tick attached to it to make it easier to find
Other scripts you are likely to want to run that don’t have a green tick will have a “favourites” heart icon attached.

If you open a folder, you should see a list of files and folders), typically:

configs:
Where the router configs are stored if any. These configs will be updated every time you BOTH a) save your router config (using copy running-config startup-config) AND b) you save your network file (click file->save) from GNS3. Use the script startup.continue if you want to load the lab again with the configs saved in this folder.

instructions.x (description) or instructions:
These are the instructions that are displayed when you run a lab. Read in advance if you are browsing.

startup.x.vpc:
virtual pc configurations for exercise x (if required). If present, it gets copied to startup.vpc by the startup script
OR
startup.vpc:
virtual pc configurations for all exercises (if required)

startup.0 (delete saved configs): [if present]
script files to reset the lab by deleting the *.cfg files from the configs directory.

startup.x (description):
sometimes the topology.net startup.vpc files are suitable for multiple exercises. In these cases, a startup script has been written for each exercise that copies the appropriate configs (from a configs.x (description) directory) to the configs directory, displays the instructions.x (description) file and starts GNS3. In addition:
If a startup.x.vpc exists it is copied to startup.vpc
If a topology.x *.net file exists, it is copied to topology.net

When you double-click on this (startup.x) file, you will be prompted to
[Run in Terminal] or [Display] or [Run].
Choose [Run].
If you choose [Run in Terminal], it takes you through any debug pauses in the script, and if the user presses after the final pause, the script closes it will take out all its spawned prcesses including GNS3, VPCs any console session and the Instructions screen

startup.continue:
in labs where it is possible to save your configuration, the startup script is called startup.continue. As the name suggests, this script allows you to continue the lab from where you last saved it.

When you double-click on this (startup.continue) file, you will be prompted to
[Run in Terminal] or [Display] or [Run].
Choose [Run].
If you choose [Run in Terminal], it takes you through any debug pauses in the script, and if the user presses after the final pause, the script closes it will take out all its spawned prcesses including GNS3, VPCs any console session and the Instructions screen
Note: all of the startup.* scripts actually just pass parameters to the master
startup script found in /opt/GNS3/READMEs & Scripts/WorkBench Scripts.
see the ‘about these scripts’ file in that directory for more.

topology.net:
the topology file for the exercise – gets overwritten if user saves – however, it may get restored in some cases (see below)

topology.x (Description).net:
the topology file for the exercise, copied to topology.net before the exercise is run.

solution.x (description):
A folder containing a set of completed configs that matches the lab envoked by startup.x. If this folder exists, you lab will open with a window ready to compare your completed lab with the configs found in this directory and show the differences.

If you wish to write your own exercise, copy a whole folder of a similar layout
(typically Classic3Router or Linear3Routers) and rename it.

Then make the following edits:

Rewrite the instructions obviously, and configure startup.vpc to your liking.

Once you have named the routers the way you want, and saved the initial configuration the way you like, save the router configs (copy run start AND file->save from GNS3) then copy these files to the
\opt\GNS3\Project\yourproject\configs.x (yourdescription)
directory.
copy one of the startup scripts to the same directory, and rename it
startup.x (yourdescription)

create an instructions file Instructions.x

If you have a set of completed configs, copy them to
\opt\GNS3\Project\yourproject\solution.x (yourdescription)

Comments and suggstions welcome

Chris Welsh
rednectar.chris has a gmail account

http://rednectar.net

@rednectarchris

9 Responses to Adding New Exercises to GNS3 WorkBench v5.x

  1. Jeff says:

    I have found that some vrouters start to do this – I think it has to do with formating on the saved config .cfg file. Try moving it aside, starting that router with no config and then pasteing it back in from notepad.

  2. rednectar says:

    You can’t use the “reload” command in GNS3 – if you want to reload, right-click on the device on the main GNS3 screen, and choose “Relaod”
    HTH
    CW

  3. Pete says:

    It is OK when I do a copy run start, however when I save in GNS and reload I lose access

  4. rednectar says:

    Pete – so you are saying that it works OK until you save (save as in “copy run start” or save as in File->Save in GNS3?) then stops after that?

  5. Pete says:

    Firstly I just want to say what a fantastic setup you have created. It’s going to save me a huge amount of money in the long run!

    Now, I have a small problem. I am creating a new Lab based on the labs from my study. I have created a frame realy setup and since saving cannot access the terminals. I am using a 3725-ent-124-15-t8.image for all routers.

    I have 5 routers in total, 3 configured in the frame. I can access the 2 unconfigured ones but not the 3 in the frame. The console opens but does not accept any keyboard input. The same thing happened when I created the same scenario on windows, which is what led me to you Workbench in the firstplace. Do you have any ideas? I can send the topology and configs if you need.

    Thanks for a great product

    Pete

    • rednectar says:

      Pete,
      Sorry for the slow reply – your problem sounds very much like a corrupted image. If you started with an image that works on a real hardware router, and followed the steps shown in the READMEs on GNS3-Workbench, then you should be OK. Other than that, the following “troubshooting console connection” tips may help:

      Step 1: Check the tcp port number that the console is running on (RIght-click on device->Change Console Port). Call this number is pppp

      Step 2: Open up a konsole shell (there is a shortcut on the desktop)

      Step 3: From the command window, issue the command telnet 127.0.0.1 ppp

      If this works, something has screwed up the console command settings in GNS3

      If this doesn’t work, go back to step 1 and try changing the port number

      • Pete says:

        Hi Chris

        I have checked all that, but still no joy :( I have added a new image from a 2600 router, changed using the scripts etc but still get no console access.

        Everything works fine until I come to save, then next time I try and connect to any console I get no keyboard input at all. I have tried rebooting the virtual machine, rebooting the host machine, etc.

        The 2600 I have got the ios from is a fully working unit that I used in my CCNA lab.

        any help greatfully recieved

        Pete

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