0% found this document useful (0 votes)
45 views11 pages

CCN Lab 05

Uploaded by

Asmara Minhas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views11 pages

CCN Lab 05

Uploaded by

Asmara Minhas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

UNIVERSITY OF CHAKWAL

DEPARTMENT OF COMPUTER SCIENCE


(Computer Communication Networks CS-324)(LAB)

LAB 05

Configuration of Routers and


switches using command line
interface

Page 1 of 11
1. Introduction:

1.1. Command line interface:

Packet tracer is a network simulator used for configuring and creating the virtual
cisco devices and network. There is also some other similar software but Cisco IOS
output will be same on all simulators.

To configure any device in packet tracer you are required to open or access its
CLI. You can do it by clicking any device and then navigating to CLI tab. Once you
are at CLI you can perform all Cisco Commands here.

Cisco IOS supports numerous command modes which can be practice with packet
tracer, followings are the main command modes of cisco CLI with specific commands
to navigate from one mode to other.

IOS commands are not case sensitive it means that you can use them in
uppercase, lowercase, or mixed case, but passwords are case sensitive. Therefore,
make sure you type it in correctly. In any mode, you can obtain a list of commands
available on that mode by entering a question mark (?).

1.2. Router:
In technical terms, a router is a Layer 3 network gateway device, meaning that it
connects two or more networks and that the router operates at the network layer of
the OSI model. Routers contain a processor (CPU), several kinds of digital memory,
and input-output (I/O) interfaces. They function as special-purpose computers, one
that does not require a keyboard or display.

1.3. Switch:
A network switch (also called switching hub, bridging hub, officially MAC
bridge[1]) is a computer networking device that connects devices together on a
computer network by using packet switching to receive, process, and forward data
to the destination device.

A network switch is a multiport network bridge that uses hardware addresses to


process and forward data at the data link layer (layer 2) of the OSI model. Some
switches can also process data at the network layer (layer 3) by additionally
incorporating routing functionality. Such switches are commonly known as layer-3
switches or multilayer switches.

1.4. Hub:
A hub, also called a network hub, is a common connection point for devices in a
network. Hubs are devices commonly used to connect segments of a LAN. The hub

Page 2 of 11
contains multiple ports. When a packet arrives at one port, it is copied to the other
ports so that all segments of the LAN can see all packets.
2. Tools required:

CISCO Packet tracer

3. Objective of the Experiment:

After completing this Lab student should able to:


 Configure router in cisco packet tracer.
 Set password and hostname of router.
 Set password and hostname of switch.
 Use the command line interface in cisco packet tracer.

4. Modes of router in command line interface:

Command for
Mode Symbol How to access this mode
leaving this mode
Default mode after booting.
User EXEC Mode Router > Use exit command
Press enter for accessing this.

Use enable command from


Privileged EXEC
Router # user exec mode for entering exit
mode
into this mode

Global Use configure terminal


Exit or Ctrl+Z for user
Configuration Router(config)# command from privileged
EXEC mode
mode exec mode

Use interface <interface


Interface name+number> command Use exit command to
Router(config-if)#
Configuration from global configuration return in global mode
mode

Enter reload command from


privileged exec mode. Press
ROMMON ROMMON > CTRL + C key combination Use exit command.
during the first 60 seconds of
booting process.

Page 3 of 11
5. Walk-through Tasks:
5.1. Creating a topology
Creating a topology in which one router is connected with two pc’s and configure
the router using command line interface

For creating this topology, you have to do following steps:

1. Click on the network devices tab and add a generic router.


2. Click on the End devices to add two pc’s in work space.
3. Click on the connections and connect PC0 with router using copper cross wire.
4. Connect pc1 with router using copper cross wire.
5. Until now you will see topology like this in your work space

Figure 1: connect two PC with router

6. Connection lights are red because until now router is not configured.
7. To configure router, click on the router you see a window where you have to
press CLI tab to open command line interface which will look like:

Page 4 of 11
Figure 2: Router CLI

8. Press enter in command line interface.


9. Write En or enable command to get privileged for router configuration and
press enter.
10. Write config t or configure terminal command for get into configuration
mode.
11. Write command hostname Give your hostname and press enter for changing
the name of router. ( Figure-3)

Figure 3: Router CLI, hostname command

12. Now before you configure the interfaces of routers, add note on your
workspace on both sides of the router indicating IP address, Subnet mask and
default gateway, which will look like:

Page 5 of 11
Figure 4: IP addresses to be assigned to Router ports

13. Open CLI and write command interface fastEthernet 0/0 for telling interface of
router you want to configure.
14. Then write command ip add 192.168.1.1 255.255.255.0 to provide IP
address along with subnet mask of the interface.
15. Write command no shut, press enter and exit for doing the state of the
interface in upstate, after this red light of this interface should turn to green one.
16. Configuration of the CLI will look like this:

Page 6 of 11
Figure 5: Router CLI, IP address configuration 47
17. Do the same thing for other interface which is fa1/0 to configure it by using
above commands.
18. Write command Copy run start to save configuration of the router.(or wr
command is also used to save the configuration)
19. Now when you have done this, both of the interface’s lights should turn to
green.
20. After when you have configured interfaces, now you have to configure both
of the Pc’s using proper IP addresses, subnet masks and default gateway.
21. For testing this topology, you have to do ping from any one of the PC’s IP
addresses to others PC’s Ip address as follow by going into command prompt of
the PC

Figure 6: command prompt of the PC

22. Above here you can see ping is successful which shows your topology is
correctly configured.

5.2. Setting up password in router:


For setting login password in router, you have to write following commands:

Page 7 of 11
To set user mode password, follow below steps
1. Click on the router and open CLI of the router.
2. Come to privileged mode by writing command En.
3. Come in configuration setting by writing command config t.
4. Write command line console 0 and press enter to make cursor to come
on initial line.
5. Write command Password give your password and press enter.
6. Write command login and press enter.
7. Write command exit and press enter.
8. Write again command exit and press enter.
9. Write again command exit and press enter.
10. Now enter your password to access user mode.

To set privilege mode password, follow below steps


1. Come to privileged mode by writing command En.
2. Come in configuration setting by writing command config t.
3. Write command enable password <your password> and press
enter.(Now privilege mode password has been set at this stage).
4. Write command exit and press enter.
5. Write again command exit and press enter.
6. Now enter your user mode password to access user mode.
7. To access privileged mode, write command En.
8. Enter your privilege mode password to access privilege mode

5.3. Setting up secret password in router:


For setting secret password in router you have to write following commands:

1. Click on the router and open CLI of the router.


2. Come to privileged mode by writing command En.
3. Come in configuration setting by writing command config t.
4. Write command enable secret give your password and press enter.

Page 8 of 11
5. Write command exit and press enter.
6. This will set the privileged mode password which also encrypted,
which can be seen using command Show running-config.
7. Write command Copy run start to save your configurations.

5.4. Setting up banner while login in router:


For setting up any message before you give password in form of banner of
some welcome note or some instruction you can done it by executing
commands:
1. Click on the router and open CLI of the router.
2. Come to privileged mode by writing command En.
3. Come in configuration setting by writing command config t.
4. Write command Banner motd # Your message#.
5. Write command Exit and press enter.

5.5. Setting up password and secret password in switch:

For setting up password and secret password in switch, you have to execute
these commands:
1. Click on the switch and open CLI of the router.
2. Come to privileged mode by writing command En.
3. Come in configuration setting by writing command config t.
4. Write command line console 0 and press enter to make cursor to came
on initial line.
5. Write command Password give your password and press enter.
6. Write command login and press enter.
7. Write command exit and press enter.
8. Come in configuration setting by writing command config t.
9. Write command enable secret give your password and press enter.
10. Write command Copy run start to save your configurations.
11. You switch setting will shows like this:

Page 9 of 11
Figure 7: Router CLI, enable secret command

Page 10 of 11
6. Practice tasks:

Task 1

Construct a network topology which have one router connected with 3 computers
and assign them proper IP addresses, subnet mask and default gateways, configure
router using command line interface and ping one PC to other and show the results.

Task 2

Give hostname to the router with your name like “Muhammad ALI”, apply login
password on the router and also enable secret password to it, show banner of “NO
ACCESS” before login on the router, after doing this show the results.

Task 3

Construct a network topology which have one router connected with 5 computers
and assign them proper IP addresses, subnet mask and default gateways, configure
router using command line interface and ping one PC to other and show the results.

Task 4

Construct a network topology which have one router connected with 3 computers
and assign them proper IP addresses, subnet mask and default gateways, and also
connect one switch, which is further connected to 5 PC’s, enable password on router
as well as switch, also implement some kind of banner on it and show the results.

Page 11 of 11

You might also like