How do I use the GNS3 WorkBench Labs?
Let’s distinguish between Labs and Exercises – they work slightly differently – Labs continue your configuration from where you last saved them, Exercises have a pre-defined starting point that is always the same. The subtlety different lesson on How to use the GNS3 WorkBench Exercises is here.
All the Labs (as described in this tutorial) are from the Standard Layouts collection found on the Desktop. Double clicking the Standard Layouts opens a folder of labs, so we’ll start with the Linear2Routers – Stand Alone Lab (continue) layout.
Now in this lesson I am going to cover:
- How to to start a GNS3 WorkBench Lab session
- How to use the VPCs application
- How to start the virtual routers
- How to configure the virtual routers
- How to save your configurations
- How to quit the GNS3 WorkBench environment cleanly
- How to continue a previous Lab session
- How to clear your configurations and start a new session.
Task 1: start a GNS3 WorkBench session
Double-click on the Linear2Routers – Stand Alone Lab (continue) icon. This will start three processes:
1. The GNS3 application will start, and depending on the speed of your PC, it may appear sooner or later than the Instructions window. For now though, we need to focus on the Instructions window described below.
2. A page of instructions will appear in text format in a konsole window. This konsole window will become the main focus of your entire session, so take note of it. If the window is covered by the GNS3 application, bring it to the front.
Task 2: use the VPCs application
After you have read the Instructions, Click on the VPCs tab. Remember, clicking on the Instructions tab will bring you back to the instructions. Clicking on the VPCs tab will show you the VPCs window, and you should see that there have been two Virtual PCS configured with IP addresses. The Prompt showing:
indicates that your VPCs focus is Virtual PC number 1. There are 9 Virtual PCs, and you can switch to Virtual PC number 2 by entering the digit 2 and pressing <Enter>. Note how the prompt changes to:
Your job in this exercise is to get the two PCs pinging each other. Lets start by making sure that your focus is back at PC #1 (type 1<Enter>) and then enter the show command. This will show you the IP address and default gateway for each of the PCs.
Now try some pings. Firstly, ping your own IP address. That should work. Then ping your default gateway (that won’t work, we haven’t even started the routers yet) and then ping the IP address of PC#2 – that won’t work either, but you will see something interesting in the output. Examine my session below:
VPCS 1 >show NAME IP/CIDR GATEWAY MAC LPORT RPORT PC1 172.20.1.10/24 172.20.1.1 00:50:79:66:68:00 20000 30000 PC2 172.20.2.10/24 172.20.2.1 00:50:79:66:68:01 20001 30001 PC3 0.0.0.0/0 0.0.0.0 00:50:79:66:68:02 20002 30002 PC4 0.0.0.0/0 0.0.0.0 00:50:79:66:68:03 20003 30003 PC5 0.0.0.0/0 0.0.0.0 00:50:79:66:68:04 20004 30004 PC6 0.0.0.0/0 0.0.0.0 00:50:79:66:68:05 20005 30005 PC7 0.0.0.0/0 0.0.0.0 00:50:79:66:68:06 20006 30006 PC8 0.0.0.0/0 0.0.0.0 00:50:79:66:68:07 20007 30007 PC9 0.0.0.0/0 0.0.0.0 00:50:79:66:68:08 20008 30008 VPCS 1 >ping 172.20.1.10 172.20.1.10 icmp_seq=1 time=0.001 ms 172.20.1.10 icmp_seq=2 time=0.001 ms 172.20.1.10 icmp_seq=3 time=0.001 ms 172.20.1.10 icmp_seq=4 time=0.001 ms 172.20.1.10 icmp_seq=5 time=0.001 ms VPCS 1 >ping 172.20.1.1 host (172.20.1.1) not reachable VPCS 1 >ping 172.20.2.10 host (172.20.1.1) not reachable
Notice that the output for the ping to 172.20.2.10 shows the output “host (172.20.1.1) not reachable” rather than “host (172.20.2.10) not reachable” as you might expect, since after all you were trying to ping 184.108.40.206! Hopefully your mind is saying ‘Of course – before the Virtual PC could send a ping to 172.20.2.10, it would have to resolve the MAC address of its default gateway, and it tried and failed so THAT’S WHY the reply comes back “host (172.20.1.1) not reachable”.’
Task 3: start the virtual routers
It’s time now to focus on the GNS3 window. Bring this window to the front, and you should see the layout of the lab. If necessary, resize the sides of the window so you can see the entire topology. You can also zoom in and zoom out using Ctrl++ and Ctrl+–
Notice the three featured icons in the picture above. Click the Start all devices icon and observe that the icons for R1 & R2 in the Status icons section turn green to indicate that the routers R1 & R2 have now started. You will also notice that the interface status markers between the two routers turn green as well.
Task 4: configure the virtual routers
Now with your routers started, click the Telnet to all IOS icon, and your konsole window will gain two new tabs (careful – don’t click on the Telnet icon more than once – if you can’t see you original konsole window, bring it to the front now).
Click the tab of the router you wish to configure first – R1 or R2, then click inside the window, and hit <Enter>. You may have to be a bit patient here, as it may take some time for the routers to boot up.
The routers will actually be now running the last saved configuration (hence the word Continue in the name of the shortcut to the lab). For this exercise I will assume that there are no saved configurations, and so the routers will soon start with the standard default blank configuration dialogue:
Would you like to enter the initial configuration dialog? [yes/no]:
Answer No, and go ahead and configure the routers with IP addresses, but at this stage without any routing. If you are not confident you can do this on your own, cut and paste the sessions below:
For router R1
enable config term hostname R1 interface fa0/0 ip address 172.20.1.1 255.255.255.0 no shut exit interface s0/0 clock rate 64000 ip address 192.168.1.1 255.255.255.0 no shut end write mem
and of course, router R2
enable config term hostname R2 interface fa0/0 ip address 172.20.2.1 255.255.255.0 no shut exit interface s0/0 clock rate 64000 ip address 192.168.1.2 255.255.255.0 no shut end write mem
Check that one router can ping the serial interface of the other router, and it would be a good idea now, to click on the VPCs tab and check that VPC 1 can ping its default gateway, and VPC 2 an ping its default gateway – of course they won’t be able to ping each other yet because you haven’t configured routing!
Task 5: save your configurations
If you look at the end of the Instructions, you will see a summary of what I’ll describe here:
If you wish to save your configs and continue at a later time, make sure you do BOTH a) save your configs (using 'copy running-config startup-config') AND b) save your network file (click file->save) from GNS3.
Note that the past command you issued for each router was write memory (which executes a no-nonsense copy running-config startup-config) – in other words, you saved your configuration – but don’t get too excited, you haven’t saved it from within the GNS3 environment yet – so it may not be completely saved yet – you still have to export your configurations from GNS3 so that they will be loaded again next time you run the lab.
For now, I’m going to tell you that the easiest way to export your most recently saved configurations is to click File->Save from within GNS3. This will export your configurations to the configs directory of your project, and you should see the following output in the Dynagen management console for Dynamips window at the bottom of your GNS3 workspace.
Task 6: quit the GNS3 WorkBench environment cleanly
Quitting is a 3 step process (you can skip step 1, but I want you to see what happens)
Step 1 is to stop the routers. This can be done by clicking the big red Stop every device icon at the top of your GNS3 workspace, or (in version 0.7.3) by clicking Device->Stop.
Notice that when you stop all the devices, your console sessions for each of the routers disappears from the main konsole window.
Step 2 is to quit GNS3 – this is easily achieved by clicking File->Quit in GNS3
Step 3 is the step most people forget, and then they come to grief if they try to start another session. This is the step to close the konsole window where the Instructions are displayed and the VPCs session is running. This can be done easily by clicking File–>Quit form the konsole application.
Task 7: continue a previous session
NOTE: The method described below is relevant for any of the Standard Layout labs. The other labs use a different method
Now back at the desktop, open the Standard Layouts folder again if necessary, and double-click on the Linear2Routers – Stand Alone Lab (continue) exercise again. The launch should be just the same as last time, and once the GNS3 application and the Instructions/VPCs konsole session is started, start your routers using the green Start every device button, and open the router console sessions by clicking on the Telnet to all devices button.
This time the routers should start with the same configuration they had when you last saved your configurations earlier, and you can complete the exercise.
Here’s the config you can paste in to complete the exercise using static routes – you might prefer to finish the exercise using RIP instead.
enable config term ip route 172.20.2.0 255.255.255.0 192.168.1.2 end write mem
enable config term ip route 172.20.1.0 255.255.255.0 192.168.1.1 end write mem
Once you have completed the configuration, test if your PCs can ping each other now, by clicking on the VPCs tab and using the ping command, and also try the tracert command:
VPCS 1 >ping 172.20.2.10 172.20.2.10 icmp_seq=1 timeout 172.20.2.10 icmp_seq=2 time=9.124 ms 172.20.2.10 icmp_seq=3 time=9.974 ms 172.20.2.10 icmp_seq=4 time=9.967 ms 172.20.2.10 icmp_seq=5 time=9.235 ms VPCS 1 >tracert 172.20.2.10 traceroute to 172.20.2.10, 64 hops max 1 172.20.1.1 5.425 ms 10.867 ms 18.088 ms 2 192.168.1.2 8.902 ms 10.815 ms 6.281 ms 3 172.20.2.10 9.824 ms 16.034 ms 14.760 ms
Task 8: clear your configurations and start a new session
Fantastic. The final task is to see how to clear the current configurations. You may be used to the idea of using the erase startup command on a Cisco router, however, the configs were exported to the lab’s config directory, so next time we start this exercise, we are going to be presented with the configurations we last exported by saving the configs within the GNS3 application.
There is an explanation of how to do this in the Instructions – so click on the Instructions tab and read the message at the end of the text:
If you wish to save your configs and continue at a later time, make sure you do BOTH a) save your configs (using 'copy running-config startup-config') AND b) save your network file (click file->save) from GNS3. You can reset the lab later by running the 'startup.0 (delete saved configs)' script from the '/opt/GNS3/Project/Linear2Routers' directory.
So to clear the configs, we are going to run a script called startup.0 (delete saved configs) outside of the GNS3 application. This will delete the files in the configs directory and start a session with no configs. Do you remember how to shut down the GNS3 WorkBench environment properly? There were three steps involved, and they are recorded above.
Shut down GNS3 WorkBench using the 3 steps described earlier in this lesson in Task 6, and close any items on the desktop.
Now back at the desktop, double-click the icon labelled GNS3 Files – More exercises here. This is actually a folder, and contains shortcuts to all the /opt/GNS3/Project directories. You are looking for the Linear2Routers directory. When you find it, double-click on it. This time, the program won’t start, but you will get to see some of the scripts and configuration files that live behind the scenes of GNS3 WorkBench.
Locate the startup.0 (delete saved configs) script – it has a little red icon with a white “x” on it.
When you find it, double click on it, and you will be presented with 4 options. Run in Terminal, Display, Cancel and Run.
You should choose Run, but it you choose Run in Terminal the script will still run, but you will have to confirm some of the actions, but you can see a little more clearly what is going on BUT you have to be careful you don’t close the terminal window or it will close every program it spawned – including GNS3.
Notice that when the GNS3 application starts, it displays a message in the Dynagen management console for Dynamips window at the bottom of your GNS3 workspace saying:
Dynagen management console for Dynamips (adapted for GNS3) Copyright (c) 2008 GNS3 Project => Local configuration configs/R1.cfg cannot be found for router ROUTER R1, use configuration /opt/GNS3/Project/Linear2Routers/configs/R1.cfg instead Local configuration configs/R2.cfg cannot be found for router ROUTER R2, use configuration /opt/GNS3/Project/Linear2Routers/configs/R2.cfg instead
This message appears simply because there are no saved configurations – which was the purpose of the task!
End of Lesson