You are on page 1of 18

Lab 10: Introduction to GNS3 and Static Routing

Lab Title: Introduction to GNS3 and Static Routing


Objective of this lab:

The goal of this lab is to introduce you how to configure static routes on a network. We will use GNS3
(graphical network simulator) as a simulation tool for this lab. At the end of this lab you will be
comfortable with GNS3, and can configure static routes for the given network topology.

Instructions:

 Read carefully before starting the lab.

 These exercises are to be done individually.

 You are supposed to provide the answers to the questions listed at the end of this document and
upload the completed report to your course’s LMS site.

 Avoid plagiarism by copying from the Internet or from your peers. You may refer to source/ text
but you must paraphrase the original work. Your submitted work should be written by yourself.

 Complete the lab half an hour before the lab ends.

 At the end of the lab, a viva will be conducted to evaluate your understanding.

Background:
In static routing the network administrator tells the device exactly where to send traffic, no matter
what. Static routing is often used when your networks have only a few devices and administrator can
manually configure the routers.
Static routing has the following pros:
 You could possibly buy a cheaper router than if you are using dynamic routing because there
is no overhead on router CPU.
 It increases security, because the network administrator can decide to allow routing access to
certain networks only.
Static routing has the following cons:
 The administrator must have the full knowledge for the network topology, so as to configure
the static routes correctly.
 If a new network is added to the existing network than the administrator has to add a route
to it on all the routers manually.
 In large networks it is not feasible because maintenance would be a full time job then.

1. Introduction to GNS3:

GNS3 is state of the art Graphical Network Simulator that allows emulation of complex
networks. You may have used VMWare, VirtualBox programs that are used to emulate
various operating systems in a virtual environment. Through these programs you can run
Windows XP or Ubuntu in a virtual environment on your computer. In the same way
GNS3 allows emulation of Cisco Internetwork Operating Systems (IOS). GNS3 allows you
to run a Cisco IOS in virtual environment on your computer. Dynamips is core engine
that actually emulates the Cisco IOS, while GNS3 provides the more user friendly
graphical user interface on the top of Dynamips. Dynagen is another text based front
end for Dynamips. GNS3 is very popular among people studying for CCNA, CCNP, and
CCIE certification exams.
Lab 10: Introduction to GNS3 and Static Routing

Note: In this lab manual we’ll use GNS3 as shared term for both the frontend software
(GNS3) and backend software (Dynamips).

GNS3 is open source free software, but due to licensing restrictions you have to provide
the Cisco IOS images. GNS3 can provide around 1000 packets per second throughput in
virtual environment, but a real router can provide much more than this. In short GNS3
can’t replace the real router but provide a good tool for lab environment.

2. Installation of GNS on Windows:

You can download GNS3 from the http://www.gns3.net/download/. After downloading


double click on it and just follow the default setting in the setup wizard. GNS3
depends on several other programs to work, which include WinPCAP, Dynamips and
Qemu, and these components along with GNS3 are all chosen by default for
installation.

Figure 1: Installation of GNS3

3. Defining Cisco IOS file:


As already, mentioned that you will provide your own Cisco IOS to use GNS3. Once you obtained
Your own copy of a Cisco IOS (google it) for the one of the supported platforms, then you are ready to
continue. GNS3 support various platforms such are Cisco 1600, 1700, 2600, 3600, 3700, and 7200
series. On the Edit menu, choose IOS image and hypervisor see Figure 2 below.
Lab 10: Introduction to GNS3 and Static Routing

Figure 2: Loading IOS images from Edit menu.

Then under the IOS Images tab, click and then locate the IOS file and click
Open. The file will appear as your image file. Next, from the drop-down arrow
next to platform select the platform that corresponds to your IOS file. Similarly
chose the model of your platform from the drop-down arrow of model. Next is
very important value called the IDLE PC, which we’ll discuss later. Click on Save
button, and you will come to the default GNS3 window.
Lab 10: Introduction to GNS3 and Static Routing

Figure 3: Selecting Platform and model


4. Creating Network Topology:
The following figure 4 shows that there are by 4 window panes in GNS3 by
default, each pane is highlighted in the figure.
Lab 10: Introduction to GNS3 and Static Routing

Figure 4: 4 Window panes in GNS3

Click on a router icon under Nodes Types matching to the IOS platform you
are using. You must use a platform for which you defined IOS. After dragging the
router to the workplace Right-click on it and choose configure. Click on R1 and
then the Slots tab. Click the drop-down arrow next to slot0 and choose an adapter
that includes FE in its description. This will add a FastEthernet Adapter to the
router. Next, click the drop-down arrow next to slot1 and choose PA-4T, PA-4T+,
NM-4T (if you do not have these exact adapters, just choose something close.).
This will add 4 serial interfaces to your router.
Lab 10: Introduction to GNS3 and Static Routing

Figure 5: Configuring router


Lab 10: Introduction to GNS3 and Static Routing

Figure 6: Adding ports to a router

Right-click the router and choose Start, again right-click the router and
choose Console. A putty console opens up. You may need to press Enter one
initially in the Console window. After a few seconds your router will start. Now if
you check your CPU usage from the Windows Task Manager then it will be near to
100 %. We need to bring this CPU usage down so that we can build more complex
topology. For this purpose we need Idle PC value. Right-click on router and choose
Idle PC. GNS3 will spend a moment after calculating an Idle PC value before
presenting the screen. When you click the drop-down list you will see a list of
possible idle pc values. The one marked with asterisk is the best so, choose that
one and click OK. This idle PC value will be saved for this particular platform. The
idle pc actually put you IOS into sleep mode when it is not active and wakes it
when it actually needs CPU cycle.
Lab 10: Introduction to GNS3 and Static Routing

Figure 7: Selecting Idle PC value

Although the single router is useful to get familiar with GNS3, now we will build
more complex topology. Let’s build the topology with three routers. Drag three
routers running an IOS you have configured into the workspace.
Select the three routers, right-click and choose configure. Click on routers and
then the Slots tab. Choose a NM-4T serial adapter for slot0. (or any one close to
that). This will configure a NM-4T serial adapter for slot0.
Now we are ready to connect the routers together. Click the add a link
button on the toolbar at the top, choose serial from the drop-down menu (See
Figure 8). Your cursor will change to a cross, and the icon will change to red stop
sign with an X. Click on R1 slide your mouse over to R2, and then click on R2, now
R1 is connected to R2. Do the same for the rest of the topology. You can change the
name of router by clicking right and then choose change the hostname. After
connection and changing host name your topology will look like to figure 9.
Lab 10: Introduction to GNS3 and Static Routing

Figure 8: Adding a serial link

Figure 9: Network Topology

You can check your connection in the Topology Summary window pane at the right by clicking the
plus next to each router.

The links are all red. Let’s start the routers by clicking the Start/Resume all devices button on the
toolbar (figure 10). If we click the Console to all devices button, then separate console windows will
Lab 10: Introduction to GNS3 and Static Routing

start for each router.

Figure 10: Starting all routers together

5. Configuring the router:


To configure the router we first need to know Cisco IOS commands. The following Table
shows important terms and acronyms used.

Cisco IOS - Cisco Internetworking Operating System


CLI - Command Line Interface
EXEC - Command line session to the router (could be console, modem, or telnet)
Flash - Non-Volatile Memory used to store IOS software image
NVRAM - Non-Volatile RAM used to store router configuration
RAM - Random Access Memory

Table 1: List of term and acronyms used


CLI Architecture
A Cisco IOS router command line interface can be accessed through a console connection,
modem connection, or a telnet session. Regardless of which connection method is used,
access to the IOS command line interface is generally referred to as an EXEC session.
As a security feature, Cisco IOS separates EXEC sessions into two different access levels -
user EXEC level and privileged EXEC level. User EXEC level allows a person to access
only a limited amount of basic monitoring commands. Privileged EXEC level allows a person
to access all router commands (e.g. configuration and management) and can be password
protected to allow only authorized users the ability to configure or maintain the router.
For example, when an EXEC session is started, the router will display a "Router>" prompt.
The right arrow (>) in the prompt indicates that the router is at the user EXEC level. The user
EXEC level does not contain any commands that might control (e.g. reload or configure) the
operation of the router. To list the commands available at the user EXEC level, type a question
mark (?) at the Router> prompt.
Critical commands (e.g. configuration and management) require that the user be at the
privileged EXEC level. To change to the privileged EXEC level, type "enable" at the Router>
prompt. If an enable password is configured, the router will then prompt for that password.
When the correct enable password is entered, the router prompt will change to "Router#"
indicating that the user is now at the privileged EXEC level. To switch back to user EXEC
level, type "disable" at the Router# prompt. Typing a question mark (?) at the privileged
Lab 10: Introduction to GNS3 and Static Routing

EXEC level will now reveal many more command options than those available at the user
EXEC level. The text below illustrates the process of changing EXEC levels.
Router> enable
Password: [enable password]
Router# disable
Router>

Note: For security reasons, the router will not echo the password that is entered. Also, be
advised that if configuring a router via telnet, the password is sent in clear text. Telnet does
not offer a method to secure packets.
Once an EXEC session is established, commands within Cisco IOS are hierarchically
structured. To assist users in navigation through IOS CLI, the command prompt will change
to reflect the position of a user within the command hierarchy. This allows users to easily
identify where within the command structure they are at any given moment. Table 2 is a
summary of command prompts and the corresponding location within the command structure.

Router> - User EXEC mode


Router# - Privileged EXEC mode
- Configuration mode (notice the # sign indicates this is only accessible
Router(config)#
at privileged EXEC mode.)
Router(config-if)# - Interface level within configuration mode.
Router(config-
- Routing engine level within configuration mode.
router)#
Router(config-line)# - Line level (vty, tty, async) within configuration mode.
Table 2: IOS command prompt summary

CLI Editor Features


Context Sensitive Help
Cisco IOS CLI offers context sensitive help. This is a useful tool for a new user because at
any time during an EXEC session, a user can type a question mark (?) to get help. Two types
of context sensitive help are available - word help and command syntax help.

Word help can be used to obtain a list of commands that begin with a particular
character sequence. To use word help, type in the characters in question followed
immediately by the question mark (?). Do not include a space before the question
mark. The router will then display a list of commands that start with the characters
that were entered. The following is an example of word help:
Router# co?
configure connect copy

Command syntax help can be used to obtain a list of command, keyword, or


argument options that are available based on the syntax the user has already
entered. To use command syntax help, enter a question mark (?) in the place of a
keyword or argument. Include a space before the question mark. The router will
Lab 10: Introduction to GNS3 and Static Routing

then display a list of available command options with <cr> standing for carriage
return. The following is an example of command syntax help:
Router# configure ?
memory Configure from NV memory
network Configure from a TFTP network host
overwrite-network Overwrite NV memory from TFTP network host=20
terminal Configure from the terminal
<cr>
Command Syntax Check
If a command is entered improperly (e.g. typo or invalid command option), the router will
inform the user and indicate where the error has occurred. A caret symbol (^) will appear
underneath the incorrect command, keyword, or argument. The following example displays
what happens if the keyword "ethernet" is spelled incorrectly.
Router(config)#interface ethernat
^
% Invalid input detected at '^' marker.

Command Abbreviation
Commands and keywords can be abbreviated to the minimum number of characters that
identifies a unique selection. For example, you can abbreviate the "configure" command to
"conf" because "configure" is the only command that begins with "conf". You could not
abbreviate the command to "con" because more than one command could fit this criteria. The
router will issue the following error message if you do not supply enough characters.
cisco(config)#i
% Ambiguous command: "i"

Entering Configurations

Perhaps the best way to illustrate IOS CLI navigation is by walking through a
simple router configuration. The comments in the example do not attempt to
explain the meaning of each individual command, but rather intend to display
where configuration commands are entered within the IOS command structure. Pay
particular attention to how the command prompt changes as the user navigates
through the IOS CLI hierarchy. Also notice that global parameters are configured at
the global configuration level (indicated by the "Router(config)#" prompt) whereas
interface specific commands are entered after switching to the particular interface
(indicated by the "Router(config-if)#" prompt).
Router> enable - switches to privileged EXEC level
Router# configure terminal - switches to global configuration level
Router(config)# enable secret cisco
- configures router with an enable secret
(global)
Router(config)# ip route 0.0.0.0 0.0.0.0
20.2.2.3 - configures a static IP route (global)

Router(config)# interface ethernet0


- switches to configure the ethernet0
interface
Router(config-if)# ip address 10.1.1.1 - configures an IP address on ethernet0
255.0.0.0 (interface)
Lab 10: Introduction to GNS3 and Static Routing

Router(config-if)# no shutdown - activates ethernet0 (interface)


Router(config-if)# exit - exits back to global configuration level
Router(config)# interface serial0 - switches to configure the serial0 interface
Router(config-if)# ip address 20.2.2.2 - configures an IP address on serial0
255.0.0.0 (interface)
Router(config-if)# no shutdown - activates serial0 (interface)
Router(config-if)# exit - exits back to global configuration level

Router(config)# exit - exits out of configuration level


Router# copy running-config startup-
config - saves configuration into NVRAM
Router# disable - disables privileged EXEC level
Router> - indicates user is back to user EXEC level
In the above example, notice how the “exit” command is used to back up a level within the
IOS hierarchy. For example, if in the interface configuration level (i.e. Router (config-if)#
prompt), typing exit will put the user back in the global configuration level (i.e. Router
(config)# prompt).
Taking Interfaces Out Of Shutdown
Routers ship from the factory with all interfaces deactivated. Deactivated interfaces are
referred to as being in a shutdown state. Before an interface can be used, it must be taken out
of the shutdown state. To take an interface out of shutdown, type "no shutdown" at the
appropriate interface configuration level. The example above includes these commands for
both the Ethernet and serial interfaces.
Removing Commands / Resetting Default Values

IOS provides an easy way to remove commands from a configuration. To remove a


command from the configuration, simply navigate to the proper location and type
"no" followed by the command to be removed. The following example displays
how to remove an IP address from the ethernet0 interface.
Router> enable - switches to privileged EXEC level
Router# configure terminal - switches to global configuration level
Router(config)# interface ethernet0 - switches to configure the ethernet0 interface
Router(config-if)# no ip address - removes IP address
Router(config-if)# exit - exits back to global configuration level
Router(config)# exit - exits out of configuration level
Router# disable - disables privileged EXEC level
Router> - prompt indicates user is back to user EXEC level
Some configuration commands in IOS are enabled by default and assigned a certain default
value. When left at the default value, these commands will not be displayed when the
configuration is listed. If the value is altered from the default setting, issuing a "no" form of
the command will restore the value to the default setting.
Lab 10: Introduction to GNS3 and Static Routing

Saving Configurations
A Cisco IOS router stores configurations in two locations - RAM and NVRAM. The running
configuration is stored in RAM and is used by the router during operation. Any configuration
changes to the router are made to the running-configuration and take effect immediately after
the command is entered. The startup-configuration is saved in NVRAM and is loaded into the
router's running-configuration when the router boots up. If a router loses power or is reloaded,
changes to the running configuration will be lost unless they are saved to the startup-
configuration. To save the running-configuration to the startup configuration, type the
following from privileged EXEC mode (i.e. at the "Router#" prompt.)
Router# copy running-config startup-config

IMPORTANT: When editing a configuration, SAVE the configuration often!

Displaying the interfaces and routes on router


With show ip interfaces brief command shows the status of each ip interface on router.

Figure 11: Show ip interface brief command


With show ip route command displays the routing table on the router. See figure 12.

Figure 12: Displaying routes on router using show ip route command


Lab 10: Introduction to GNS3 and Static Routing

You can use ping command to check the connectivity of any host in the network
(Figure 13).

Figure 13: checking the connectivity between nodes by ping command


Lab 10: Introduction to GNS3 and Static Routing

 Configure static routes on the given topology using 1700 series


platform.

Hints:
 First configure ip address on each interface of a router using ip address command.
 Turn on each interface on which you configure ip address by using no shutdown command.
 Configure routes on each router for those networks which are not directly connected to it by
using ip route command.
 Save your configuration to NVRAM by using copy running-config startup-config command

I will do these steps for “Lahore” router you can follow the same for others routers.

Lahore> enable

Lahore# configure terminal

Lahore(config)# interface ethernet0

Router(config-if)# ip address 10.3.20.1 255.255.255.0

Router(config-if)# no shutdown

Router(config-if)# exit

Router(config)# ip route 10.3.12.0 255.255.255.0 10.3.20.2

Router(config)# ip route 10.3.15.0 255.255.255.0 10.3.20.2

Router(config)# exit
Lab 10: Introduction to GNS3 and Static Routing

Router# copy running-config startup-config

Do the same for all routers and answer the following questions.

1. What are the route(s) which you will configure on Karachi router (you must write
exact command)?

2. What are the route(s) which you will configure on Peshawar router (you must write exact
command)?

3. How did you configure ip address on the serial port of Islamabad router?

4. Display the routing table of Lahore router (snapshot required)?

5. Display the routing table of Islamabad router (snapshot required)?

6. How will you ensure that host with ip address 10.3.20.1 is accessible from Peshawar router
(snapshot required)?

7. How will you ensure that host with ip address 10.3.15.1 is accessible from Lahore router
(snapshot required)?
Lab 10: Introduction to GNS3 and Static Routing

You might also like