Lab 2
Lab 2
Aims:
• To gain an understanding of what a Switch is as a device
• To familiarise students with the Command Line Interface (CLI) to configure the Switch
• To gain knowledge in configuring network interfaces on a Switch
• To understand the different Cisco Switch modes of operation
• To understand how and where passwords apply on a Cisco Switch
• To understand the concept and differences between the running-config and the startup-config on a Cisco Switch
Background:
Network device to Human Interface (Local access)
A Terminal is an interface port, which is purpose-built for computer that incorporates a monitor and keyboard in the same
unit. A Console Terminal on a network Switch or Router is equipped with an RS-232 serial communication interface that
directly connected to an RS-232 (serial) port on a personal computer (PC). The Terminal processes ASCII characters as
transmitted over the RS-232 connection and displays them on the screen. Similarly, any keystrokes on the Terminal
keyboard are translate to ASCII characters; and it is forwards to the connected computer via the RS-232 connection too.
In a manner of speaking, the Terminal became the keyboard and monitor for the computer. Computers with multiple serial
ports could support multiple Terminals, essentially allowing many monitor/keyboard for concurrent users to use the
computer at the same time.
While computers have moved to a special purpose video card and keyboard/mouse technologies, networking devices have
stuck with the terminal concept as it consumes less power, requires less CPU, and less software to manage. Having said
that, we do not carry Terminals with us anymore. With ubiquitous access to laptop technologies, the current means of
accessing the terminal of networking equipment is to connect the terminal of the Switch or Router to the RS-232 port on
[1]
TNE10006 Networks and Switching Lab 2
your laptop (or other computer device), and then to run Terminal emulation software – such as PuTTy (or equivalent) to
pretend to be the Terminal which is talking to the device. In this way, your computer remains as a general-purpose
computing device, while one application running on your computer becomes the keyboard and monitor for the network
Switch or Router.
Connections are made using the Console terminal or port on the network Switch and Router. Another port – Auxiliary –
exists to connect a modem to the router to provide for dial-up access to the command line interface.
There are two primary means for accessing the network device-human interface remotely:
1. Configure remote access on the Switch. In this case you would configure the device to accept either telnet or ssh
connections from a remote device. As long as the device is reachable on the network, you can remotely access the
command line interface to monitor and/or change the router configuration. Ssh is preferred to telnet as it encrypts
communications thus providing better security for your network. You would then use a telnet/ssh client application
on your computer to connect to the remote device. The application becomes an extension of the command-line
interface of the router or switch, the application window becomes the device monitor, whilst any text entered into
the application is sent to the device as if it had been typed directly into the keyboard.
2. Another common approach is to use a device such as a console concentrator. This is physically installed into the
same rack as the Switch or Router. An RS-232 cable is then connected between the Switch/Router console port and
the console concentrator. The concentrator is then configured and connected to the network. Users then remotely use
ssh to connect to the concentrator, which will then forward the command-line interface from the console port
remotely. While this appears to be more complex than option 1, it is more flexible as multiple network
routers/switches can be connected to a single concentrator.
The Cisco labs will however use physical PCs and network devices like Switches and Routers.
[2]
TNE10006 Networks and Switching Lab 2
In this unit, we will mainly target on the Physical and CLI tabs.
Physical tab enabled us to add or replace the existing module(s) for special needs. The list of the installed interfaces
(usually refer to physical connectable ports that can be found on a device) can be found in the INTERFACE subheading in
the Config tab. To make a change to the device, first, locate the power button of the device in the “physical device view”,
turn off the device power by simply a click on the power button. Next, drag-n-drop selected module from the “Modules”
list to the appropriate blank space on the device. Once complete, turn on the device power again and spare some time for
the device to boot up (you can view the sequence in the CLI tab) before it is ready to be configured.
CLI tab enable you to program (configure the device to be more appropriate) the device so that it will be functionally
matching the requirements of the needs of specific network. This tab offers the only user interface to the inner world of
the device. The user shall key in appropriate commands at specific sequence to activate individual function of the device.
On default, once the device is placed on the workspace of the Packet Tracer, it will start to “boot up” and get ready in few
seconds. One can view the booting process through the CLI tab.
To replicates the real-world remote access to the command line interface (CLI) of a network device, you can construct a
connection like illustrated in Figure 1 above. Then use the given program called Terminal (in the desktop tab of the
PC). A terminal configuration window will be appeared, and you just need to select the OK button to start the CLI access
to the Switch/Router. The default configuration should be 9600 bps, 8 bits, no parity, 1 stop-bits, no flow control. This is
also the default setting found in generic network devices.
1. Download PuTTY (e.g. putty-0.73-installer.exe installer file) from the following link. Install and load it.
http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
Upon starting up the PuTTY at the first time, you will see the following screen:
[3]
TNE10006 Networks and Switching Lab 2
2. For direct console connection, Select Serial button and key in the correct COM port number for your serial link
to the network device.
a Optional: Select Logging under the Session option on the left panel if you want to safeguard your settings
for future reference. Choose what to log, supply a log filename, and specify what to do if the log file exists
already.
b Select Serial from the left panel and configure the COM port as per the image below
[4]
TNE10006 Networks and Switching Lab 2
3. In the case of remote terminal service is needed (through Ethernet interface as shown in Figure 2 above), we will
use Telnet for terminal emulation. While Session is selected from the left panel, type in the IP address of the
host you want to access, select Telnet from the Protocol option and click on Open. Ensure Telnet is configured
as per the image below:
running-config – The current configuration of the switch/router. The configuration is presented to the user as a
virtual file on the system. You can use the “show running-config” command to display this file (from
Administrator Mode). This command will read the current configuration, generate it as a text file/view, and
print it to the display. Be aware that this file does not exist on the device and refers to how the switch/router is
currently configured. When you switch on a switch/router for the first time, it has a blank configuration, this
does not mean that the running-config is empty, there are a number of default settings that will always be set
on a default configuration.
startup-config – This configuration is saved on the flash within the switch or router. When the device boots up, it
checks to see if this file exists, if so it loads the stored configuration in this file and sets the switch/router to
these properties. If this file does not exist, there is no configuration so the device is loaded with an
empty/default configuration, and the switch/router will prompt you if you wish to use the wizard to configure
the device. If you do not get prompted, then a startup-config exists and was loaded, the device has already
been configured and is not blank.
value does not correlate to the Router values, and changing it does not have the same affect. In the Swinburne Cisco labs,
the value of conf-reg on the router will be one of two possible values.
0x2102 – This signifies a normal boot cycle. The device will boot up normally, loading the stored OS. Once the OS is
loaded and the basic boot-up is complete, the device will check to see if a startup-config exists. If it does,
then the startup-config is loaded, and the device is configured with its stored contents, otherwise the wizard
will be launched.
0x2142 – This signifies a normal boot except for loading of the startup-config. The device will boot up normally,
loading the stored OS. Once the OS is loaded and the basic boot-up is complete, the device will launch the
configuration wizard regardless of whether a saved startup-config exists. If this is the case and you wish to
use the saved startup-config, you will need to load it manually using “copy startup-config
runningconfig”. This mode is often used for password recovery so you can boot the device up without a
password, then load the startup-config, before finally resetting the password to a known value.
In general, you should not be seeking to change the value of the router’s conf-reg during your labs. However, if you
come across a router with a configured password, you may need to do so in order to perform a password recovery
procedure.
Part 3: Useful Tips in the Command Line Interface (Try this out in the Packet Tracer too)
When entering commands at the CLI, the <tab> key and “?” are your friends.
1. Typing a “?” at any time on the command line will result in a list of all commands available to you at the present
time, along with a brief description of what each command does.
2. Typing a “?” with a partial command entered on the command line will result in a list of all commands available
to you that start with the letters you have currently typed in, along with a brief description of what those
commands do
3. Typing a command, followed by a space and then a “?” will list what the command is expecting as the next
parameter, along with a description of the parameter itself. This can be repeated for commands with multiple
parameters
4. Typing some letters, then hitting <tab> will result in the Router performing auto-completion of the command (or
parameter) name. For example, typing “sh<tab>” will result in the device displaying “show” as a valid/complete
command.
5. A variation on point 4 above is when the command is ambiguous, for example typing “ s<tab>”. In this case
multiple commands begin with “s” so no auto-completion is performed. If some auto-completion is possible,
then the device will automatically add characters until the first ambiguous option
6. You only need to enter enough characters in a command, so it is un-ambiguous to the device what you wish to
achieve. For example, a command we will use later is “show running-config”, however “show” is the only
command that starts with “sh”, so typing in “sh running-config” has the same result. Similarly,
“runningconfig” is the only filename that starts with “run”. As such, other valid alternatives are “sh run”,
“show run”, “sh runni”, “sho runn”, etc. However, “s run” is not valid as multiple commands begin with “s”
[6]
TNE10006 Networks and Switching Lab 2
Different commands are used to enter and leave different configuration modes. These are:
1. You can transition from User Mode to Administrator Mode by entering the command “enable”
2. Logout from User Mode by entering “exit”
3. Transition from Administrator Mode to User Mode by entering “exit”
4. Transition from Administrator Mode to Configuration Mode by entering “configure terminal”. This command
specifies that you wish to enter configuration mode via the terminal (or console port)
5. Transition from Configuration Mode to Administrator Mode by entering “exit”
6. Transition from a Sub-configuration Mode to Configuration Mode by entering “exit”
7. Transition from any Configuration or Sub-configuration Mode to Administrator Mode by entering “end”
Basic configuration for the network device for both Switch and Router)
You will now started to learn how a device (Switch or Router) are configured, verify and Test for what you have done. You
should always verify you work right after the implementation to ease in the testing process happened in later stage.
[7]
TNE10006 Networks and Switching Lab 2
Verification Note: after you set the switch’s name using the “hostname” command, the switch name will instantly change
and reflected in the prompt displayed on the screen. The hostname command takes one parameter, the
new name for the switch. This command is exactly the same if you are configuring a router.
Now let’s have a look at the hostname reflected in the current configuration of the switch (in running-configuration file):
ccna_swin#sh run
You can use the space bar to view the configuration one screen at a time or the “Enter” key to scroll through the
configuration one line at a time. Apart from all the default settings in the switch, you will notice the line:
hostname ccna_swin
This is an exact copy of the command you entered in configuration mode. In fact, you can type the entire contents of the
output of “sh run” into a switch to give it the same configuration.
ccna_swin#conf t
ccna_swin(config)#banner motd +
********************
** This is Week 2 **
** of CCNA1 **
** at Swinburne **
********************
+
ccna_swin(config)#end
ccna_swin#
2. The '+' is not a required character in that it has to be a '+', it just has to be any character that is NOT present
in the actual MOTD. This is because the “banner motd” command uses this character as a flag to determine
where the end of the actual MOTD is (because it can consist of multiple lines).
3. Observe the MOTD in the current configuration using the “sh run” command (verification)
4. To Test if it is working fine, Let us see the MOTD in action, keep typing “exit” until you are logged out of the
router
5. Now press Enter a few times to log back in, note that the entered MOTD is displayed before you see the prompt
“ccna_swin>”
6. Repeat the above set of commands using a different MOTD and a different special character to mark the
beginning and end of the MOTD
We will begin by rebooting the switch. To reboot the switch, enter the following command (same for routers):
[8]
TNE10006 Networks and Switching Lab 2
ccna_swin#reload
The switch may warn you that you have not saved the current configuration and ask if you are sure that you want to reboot
it. Please answer these questions such that the device reboots. The reboot process takes a few minutes to complete, it is the
same as switching the device on, you will have to wait. While you are waiting for the switch to reboot, please configure
your second switch with a hostname and MOTD as per the instructions above.
When the switch has restarted, you should note that it is again asking if you wish to run the configuration wizard, just as
per the start of this lab, again you should answer “No”. Once you have console access to the switch, change to enable
mode and confirm that there is no startup configuration, and all the work you have done up until now is lost:
Switch>ena
Switch#sh startup-config
Switch#sh running-config
On the second trial, do configure the hostname and MOTD and we will now save the most current configuration so that
when the switch reboots, it does so without losing your configuration. To do that, execute the following commands to
save the configuration:
USEFUL TIP: On the Cisco Routers, you can examine the current value of the conf-reg by executing the command
“show version” whilst in Administrator mode. The output of this command will contain basic information about the
router hardware, the current version number of the router OS, and the current value of the conf-reg. It will also tell you if
the conf-reg has been changed since the last reboot.
Now when the switch has rebooted, it will not ask you about running the configuration wizard, instead it will ask you to
press Enter to start using the device. When you press Enter, note that it displays your configured MOTD, and that the
prompt includes the configured hostname. Once you have access to the router, execute “sh run” and “sh start” in
Administrator mode to confirm that both the current and saved configurations are correct and the same.
You have now successfully saved the switch configuration and rebooted the switch without losing any of your work. Note
that if you make any more changes to the configuration, the new changes will not be saved until you execute the “copy
run start” command again. Test this by changing something about the current configuration (either hostname or MOTD)
and then “sh start” and “sh run” to confirm that the outputs are different.
ccna_swin#erase startup-config
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
Press Enter to confirm deleting the saved configuration, then execute “sh start” to confirm it no longer exists.
WARNING: If you miss-spell “startup-config”, the device will ask you if you wish to delete the FLASH, if you
confirm, this will result in you deleting the OS and the device will no longer be usable. As such, you need to read the
confirmation carefully before confirming. To be sure you have not made a mistake, it is best to type: Switch#erase
sta<tab>
Pressing <tab> will cause the router to complete the filename automatically and without spelling mistakes. If it does not
complete, then you have a spelling mistake in the first three characters.
NOTICE: Saving configurations is very important on a production router or switch. The device forms part of a real
network and in the case of a power outage, you want it to work properly after the power returns. In the lab, saving
configurations only annoys other users who have to use the equipment after you have finished with it. After today's lab,
you should NOT execute “copy run start” again.
USEFUL TIP: Relating to mistyped commands. When you type a word into a Cisco device that is not a command, the
device will assume that you wish to telnet to the device name you typed in. As such, the device will attempt to perform a
DNS lookup on that mistyped command. This will result in the router or switch being unresponsive until the DNS lookup
[9]
TNE10006 Networks and Switching Lab 2
fails (it will fail because your device is not connected to a real network with a functioning DNS server). To stop the DNS
lookup attempt – therefore letting you continue immediately – enter the following in the main configuration mode.
ccna_swin(config)#no ip domain lookup
ccna_swin(config)#end
You can enter the “ip domain lookup” command to re-enable this functionality
User Mode Password – Needs to be entered at the console before you can login to the device in User Mode
Administrator Mode Password – Needs to be entered after typing “enable” before entering “Administrator mode
Telnet Password – Needs to be entered when telnetting to the device before your login at the User Mode
These passwords can be the same, or different. By default, they do not exist. There are other passwords that can be
configured on the device to achieve different tasks. In CCNA, we will only concern ourselves with these three passwords.
Sets the password required to access this terminal in User Mode. In this
ccna_swin(config-line)#password ccna
case the password is set to “ccna”.
Setting the password is not enough, we now have to tell the router that
ccna_swin(config-line)#login the user needs to login by using the password. This is done using the
“login” command.
Note when you log back in you are asked for a password, you need to enter “ccna” to continue. Use “sh run” to confirm
that the current configuration has your configured password settings. Note that the password is displayed in plaintext.
Anybody who has Administrator access to the switch or router will be able to see the console password.
ccna_swin(config)#line console 0
ccna_swin(config-line)#password new_password
ccna_swin(config-line)#end
[10]
TNE10006 Networks and Switching Lab 2
ccna_swin(config)#line console 0
ccna_swin(config-line)#no password
ccna_swin(config-line)#no login
ccna_swin(config-line)#end
To set the Administrator User Mode password, enter the following commands at Global configuration mode:
ccna_swin(config)#enable secret cisco
ccna_swin(config)#exit
The password set will be “cisco”, the word “secret” means that the password will not be displayed when typing “sh
run”, type “sh run” now to confirm you cannot read the password. The password is stored as a hash of the password.
Confirm that the password works by logging out and logging back in again. You should be asked for the User Mode
password (unless you deleted it). You should then be asked for the Administrator password when you enter the “ ena”
command.
We can enable the Telnet server on the Switch/Router using the following commands:
[11]
TNE10006 Networks and Switching Lab 2
Enabling the Telnet server – via both the “password” and “login” commands – immediately allows remote systems to
access the switch via the Telnet port (port 23). You will get a warning that telnet access is not enabled until you also
set the password. On some switches/routers, you will also get a warning when enabling telnet when there is no
Administrator password, you can ignore this warning. When an application connects to TCP port 23 on the device:
• The device will connect the input and output of the TCP connection to the output and input of the first
available vty terminal of the sixteen on the switch (five for the router). All input from the network is sent to
the virtual terminal, all output from the terminal is sent over the network.
• The telnet application on the PC becomes the monitor/keyboard to access the device configuration mode.
• Up to seventeen people can concurrently configure the switch (6 on the router), one on the console port
(Local access) and sixteen via telnet (remote access through Ethernet connection).
NOTICE: Passwords are an extremely important feature on a production switch or router for security purposes. In the lab,
passwords are annoying, especially as the router will automatically log you out if you haven't configured it for some time.
[12]
TNE10006 Networks and Switching Lab 2
In the lab exams there is a requirement NOT to use console or enable passwords. After today's lab, you should NOT set
any passwords on a switch or router again.
USEFUL TIP: To stop the switch from logging you out, you can enter the following in the console line sub-configuration
mode:
ccna_swin(config-line)#exec-timeout 0 0
ccna_swin(config-line)#end
Numbers other than zero signify how long the device will wait with no activity before logging out the user. Zero
values tell the device not to log the user out automatically
For this lab we are going to connect the PC1 to the Fa0/8 interface and PC2 to the Fa0/24 interface. PC1 will be
configured with the IP address (192.168.0.8 255.255.255.0) and PC2 with the IP address (192.168.0.24 255.255.255.0).
Question: What other IP addresses will be in the LAN running on the switch?
Interface Status
If displaying “Administratively down”, then you have entered the “shutdown” command on this interface
(interface disabled). If “up”, then the interface is enabled
Protocol Status
Indicates the Layer 2 status of the interface. “down” indicates that the Layer 2 network is not functional, while
“up” means that all is OK. For an Ethernet network, the Layer 2 network does not need any configuration other
than turning the Interface on, so if the protocol is down, that means there is nothing plugged into the Interface,
or whatever is plugged into the Interface is switched off. When we look at Serial Interfaces, we will see that we
need to configure Layer 2 settings to make the Interface come up.
Due to the nature of how the switch operates, it is highly unlikely you will see anything other than the following
combinations of status:
Enter the interface sub-configuration mode for the interface f0/1. This is
ccna_switch(config)#interface f0/1
indicated by the change in prompt.
ccna_switch(config-if)#shutdown Disable the interface. To re-enable it, enter the command “no shutdown”
ccna_switch(config-if)#end Exit back to Administrator mode
ccna_switch(config)#interface f0/1
ccna_switch(config-if)#no shutdown
ccna_switch(config-if)#end
ccna_switch(config)interface f0/24
ccna_switch(config-if)#description Connected to PC2
ccna_switch(config-if)#end
Verification Note: The interface configuration can be verified through viewing the running-configuration file, “sh run” at
Administrator Mode. Now look at the output of “sh run”. Note that the interface is configured with
the description. Note that if an interface is disabled, then “ sh run” will output “shutdown”, but if it is
enabled, “no shutdown” will be displayed in the output.
Now configure the IP addresses of the two PCs as specified in the previous section.
1. From PC2, try to ping PC1 – ping 192.168.0.8
2. From PC1, try to ping PC2 – ping 192.168.0.24
What you get? What does it mean?
[14]
TNE10006 Networks and Switching Lab 2
Unlike network layer devices, a Switch only needs one IP address, and it is theoretically reachable on all its interfaces but
not actually allocated to a physical interface. On Cisco devices, this is done by configuring the Management Interface.
You will have noticed when you previously ran the “sh ip int brief” command that an interface called “VLan1”
existed. This virtual interface is the management interface on the switch.
NOTICE: By default, Cisco Switches connect all ports to VLAN1 and run the management interface on VLAN1 as well.
Later in the semester we will discover how to create multiple VLANs and how to move the management interface and the
physical interfaces to a different VLAN. For now, we will keep things simple and just use VLAN1.
Let’s set the IP address on the management interface to 192.168.0.1/24. Why can’t we use 192.168.57.1? (refer to the PPT
note given on CANVAS in week 1 to figure out the issue)
You should now be able to ping the switch via the management interface IP address from either of your two PCs.
Similarly, you should also be able to run the ping command from the switch interface to ping your PCs. If you are unable
to do this, please try and troubleshoot before asking the instructor.
Change and delete the IP Address and interface description on a virtual interface
There can only be one IP Address on an interface, this includes the management interface. To modify a configured IP
address, you enter the “ip address” command again. To un-configure the interface, you can execute the “no ip address”
command in the Interface sub-configuration mode. Similarly, you can change the interface description by re-executing the
“description” command and delete a description by typing the “no description” command.
Cleaning Up
If you have finished, feel free to continue exploring the user interface of the switch and the commands you have
learnt. When you are ready to finish, make sure you complete the following steps:
1. Clear the switch configuration with “erase sta<tab>” and make sure the switch is clean with “sh start”
2. Unplug all cables from the switches and return them
3. Return the switches and cables where you took them from initially.
Chapter Challenge:
(1) Reboot the Switch with default configuration.
(2) Set hostname of the switch to SWINBURNE01
(3) Add the MOTD.
(4) Configure the console line with EXEC level password – CCNA1TUT
(5) Configure the Telnet access with a password – CCNA_TEL
(6) Assign a PRIVILEGE EXEC level password to the device – AUTH0123
(7) Encrypt the passwords for console and telnet link. (find the command using command “?”. It is not
inside the text above – search through the internet).
(8) Shutdown ports 3,4,9,17-24.
(9) Put a description on each interface.
(10) Verify the configuration and save it to the permanent storage in the switch.
(11) Reboot the switch and verify again if all your configuration is still intact.
(12) Verify the telnet access to the switch so that you can access the CLI.
[15]