Lab Exercise 9 - Configuring a Router/Switch with Cisco IOS


In this lab, you will spend more time learning the basics of the Cisco IOS system for making specific changes to a router or switch.

Configuring the Switch

In the previous lab you used User Mode and you really only monitored the very basic state of the router. User Mode doesn't get you very far for administering a router. To administer a router, you need to enter Privileged Mode. In Privileged Mode, you can make changes to the state of the switch or router. Of course, if you make the wrong changes, bad things can happen which is why it's also nice to have the Cyclades box connected to the serial console ports on the routers themselves.

First, some basic things about Privileged Mode:

First, the specialized information. For instance, the show interfaces command is only available from Privileged Mode and provides you with information about

To get into Privileged Mode, you need to first login to the switch or router, and then type the "enable" command. You will then be asked for a password. For this lab, the password for the administrative privileged mode is Nets.Werk3.  If for some reason, you are asked for a user id, your user id will be Cisco.  After you've entered into privileged mode, your prompt will change. To get out of privileged mode, you can type "disable".

Working together from your table (try to spread out so the tables are somewhat even), login to your respective routers and switches that are associated with your table.  You'll need to review your notes from Lab 7 to make sure you access the right equipment.  Recall that the routers are associated with the SSH ports [7004, 7007] and the switches are associated with SSH ports [7008, 7011].  Again, make sure you know which switch and router are associated with your table and use only those SSH ports when accessing the equipment as described below.

Using the techniques from the previous Cisco lab and the SSH ports you've deemed related to your table, ssh into the Cyclades box ( and explore the show interfaces command. The show interfaces command may be one of the more used commands as it will provide you with information that might be needed to debug an interface (or connection to another piece of equipment). Accessing the switches routers at the same exact time is problematic, so work together as a group and have one person make changes to the configuration at a time.  So, (1) work together on these next steps, (2) coordinate your actions, or (3) work in groups to make the changes.

Now that you are in Privileged Mode, let's examine the naming conventions, such as FastEthernet 0/1, in more detail. The numeric parts of the interface name refer to the slot/port numbers. Slot numbers relate to the slot number on the interface "module" that was added to the switch or router. The port numbers are more interesting for us and relate to the numbered ports on the front of the switch (where you plug that Ethernet cable). Note also that you can abbreviate the FastEthernet 0/1 to Fa0/1.

An important part of configuring a router is understanding the interface configuration. To view a summary of the interfaces on the router, type "show interfaces". Other sub-commands to the show interfaces command are likely more interesting and may be interesting on other types of switches or routers. For instance, to find out the MTU on a Fa0/1 port, you can use "show interfaces Fa0/1". Try it. Did it report anything of importance to you?  Can you find the MTU?

Another way to get quick information about the IP configuration on an interface is the "show ip interface" command. Type that command now and play around with it a bit. Obviously, the main command provides a lot of information! The sub-commands provide more refined information.

Question 1: Using privileged mode, report some information about the interfaces on your switch.

A Note on Shortcuts

Cisco IOS is full of key-based shortcuts to make it easier to manage and modify the information on the router/switch. Here are some of them:

There are other shortcuts, but these should get you going on how to operate within Cisco IOS.

Key Mappings

Ahhh, emacs key-bindings. Some of them are built into the command prompt parser of IOS. Here are some helpful tips on them if you're not an emacs user (note: ^ is the Control key):

Configuration of Router State

Each switch or router maintains two configuration states: the running configuration state and startup configuration state. When you make changes to the state with the Cisco IOS commands, you make changes to the running state. When your router or switch boots up it comes up with the startup configuration that is save in non-volatile memory.

The configuration data in the switch or router specifies how the interfaces should be used, what routing code should be used, how logins should be handled, what VLANs are supported, etc... it is the information that makes the router or switch do its thing.

To view the current startup configuration of the router, you can type show config or show startup-config. Show config only works in Privileged Mode. Also note that you may have to page through several pages of configuration data. To get the current running configuration, you need to type show running-config.

Question 2: Get the current running configuration for your router and report it for what you turn in.

Making Actual Changes

To make changes to the running configuration of the switch or router, you need to enter the configure terminal command or conf t, for short. Entering this command will change your prompt to "...(config)#". To exit out of config mode, you can type ^Z or type the command exit. While in config mode, you will not be able to show the configuration.

In "config" mode, you can make changes to the router. For instance, configure mode allows you to change the name of the router, change how interface FastEthernet 0/2 is setup, add VLANs, or change routing. For the time being, we are not going to make many changes. However, I do want you to make some changes to the switch associated with your table. First, change the hostname of the switch. Before you do this, make note of the running configuration's hostname. Look at the running configuration's output and find the hostname command. One quick way to find this would be to pipe it to the begin command, like this:

show conf | begin hostname

Question 3: Change the host name of the switch to something. Turn in the name that you set After you make the change, show the running configuration and the startup configuration. In which configuration listing is your hostname change shown? Did your change take effect immediately or not?

Note that the actual commands/text that you see in the configuration listings represents the actual Cisco IOS commands that are used to make the configuration changes.

Question 4: Set the correct time and date on the switch's clock. See below for more info on this.

Next, let's set the correct time and date on the switch you logged into. Use the show command to output the current clock's time and date. To set the clock to the correct time/date, enter configuration mode and use the following command to set the timezone information:

clock timezone CDT -5

which will set the timezone to the current timezone. Exit configure mode, and then set the clock with the following command, but use the correct information (note that it's not in config mode):

clock set 09:18:12 Nov 12 2003

Check the time with the show command. Is the change made?

Question 5: Finally, add a description to one of the FastEthernet interfaces on your switch. To do this, you will need to enter commands that resemble the following sequence once you have successfully entered the configure mode:

interface FastEthernet 0/3
description My connection to the internet, from Me

The two exits at the end of that sequence get you out of the "interface" configuration and then out of the configure terminal command.

To stop the page-by-page display of data, change the terminal length, using the "terminal length 0" command, which will set the number of lines on the screen to 0, meaning all lines will be display. You can then use the Terminal applications scroll bar to scroll back if need be.

Setting the changes in the startup-config

The changes you've made only modify the running configuration currently in use by the switch. Type "show conf" (for show configuration) now to see what changes you've made. Is the name you gave listed in the configuration for the hostname? The reason your change has not been applied is because the show conf command displays the startup configuration that is stored in the router's flash memory. Show the running-config. Are your changes there? Recall that Cisco IOS does do command completion so pressing TAB will help to complete a command.

To save the running configuration to the startup configuration, you can type

copy running-config startup-config

Do this now. You will have to confirm the name of the startup-config file, but simply press Return to accept the default. We will login to the switch remotely and check to see how the descriptions were changed.

At this point, you can exit the switch, by disabling privileged mode (disable command), and exiting the Cyclades box's SSH connection (tilde-.).

Finding the DHCP and Routing Configurations

Next, login to the router associated with your table.  Change to privileged mode.

Question 6: Find the configuration lines for DHCP for your table and report them.

Question 7: Locate the routing configuration and report that.  Recall that we are using OSPF (a link-state algorithm) in the lab.  Why is this information specified in the router and not the switch?

At this point, you can exit the switch, by disabling privileged mode (disable command), and exiting the Cyclades box's SSH connection (tilde-.).