You are on page 1of 48

1

IT-31012 Data Communication and Computer Networking


Lab Manual for First Semester

Lab I: Introduction to Packet Tracer


Packet Tracer is a protocol simulator developed by Dennis Frezzo and his team at Cisco
Systems. Packet Tracer (PT) is a powerful and dynamic tool that displays the various protocols used
in networking, in either Real Time or Simulation mode. This includes layer 2 protocols such as
Ethernet and PPP, layer 3 protocols such as IP, ICMP, and ARP, and layer 4 protocols such as TCP
and UDP. Routing protocols can also be traced. Before starting to follow the procedures below you
should:
1. Download Packet Tracer Simulation Tool on your PC.
2. To get familiar with the Packet Tracer environment, watch this video named "Interface
Overview" from the Help Tutorials.

Introduction to the Packet Tracer Interface using a Hub Topology

Step 1: Start Packet Tracer and Entering Simulation Mode


2

Step 2: Choosing Devices and Connections

Several types of devices and network connections can be used. For this lab, we will use End
Devices, Switches, Hubs, and Connections. Single click on each group of devices and connections,
to display the various choices.

Step 3: Building the Topology – Adding Hosts

 Single click on the End Devices.

 Single click on the Generic host.

Move the cursor into topology area. You will notice it turns into a plus “+” sign. Single click in the
topology area and it copies the device.
3

 Add three more hosts

Step 4: Building the Topology – Connecting the Hosts to Hubs and Switches

 Adding a Hub: Select a hub, by clicking once on Hubs and once on a Generic hub.
4

 Connect PC0 to Hub0 by first choosing Connections.


 Click once on the Copper Straight-through cable.

Perform the following steps to connect PC0 to Hub0:


1. Click once on PC0
2. Choose Fast Ethernet
3. Drag the cursor to Hub0
4. Click once on Hub0 and choose Port0
5. Notice the green link lights on both the PC0 Ethernet NIC and the Hub0 Port0 showing that
the link is active.
5

Repeat the steps above for PC1 connecting it to Port1 on Hub0. (The actual hub port you choose
does not matter.)

Adding a Switch
Select a switch, by clicking once on Switches and once on a 2950-24 switch. Add the switch
by moving the plus sign "+" below PC2 and PC3 and click once.

 Connect PC2 to Switch0 by first choosing Connections.


 Click once on the Copper Straight-through cable.
 Perform the following steps to connect PC2 to Switch0:
1. Click once on PC2
2. Choose FastEthernet
6

3. Drag the cursor to Switch0


4. Click once on Switch0 and choose FastEthernet0/1
5. Notice the green link lights on PC2 Ethernet NIC and amber light Switch0 FastEthernet0/1
port. The switch port is temporarily not forwarding frames, while it goes through the stages
for the Spanning Tree Protocol (STP) process.
6. After about 30 seconds the amber light will change to green indicating that the port has
entered the forwarding stage. Frames can now be forwarded out the switch port.

 Repeat the steps above for PC3 connecting it to Port3 on switch0 on port FastEthernet0/2. (The
actual switch port you choose does not matter.)

 Move the cursor over the link light to view the port. Fa means FastEthernet, 100 Mbps Ethernet.

Step 5: Configuring IP Addresses and Subnet Masks on the Hosts


Before we can communicate between the hosts, we need to configure IP Addresses and
Subnet Masks on the devices.
7

 Click once on PC0.


 Choose the Config tab. It is here that you can change the name of PC0. It is also here where you
would enter a Gateway IP Address, also known as the default gateway. This would be the IP address
of the local router. If you want, you can enter the IP Address 192.168.1.1.

 Click on FastEthernet. Add the IP Address to 192.168.1.10. Click once in the Subnet Mask field to
enter the default Subnet Mask 255.255.255.0.
8

Also, notice this is where you can change the Bandwidth (speed) and Duplex of the Ethernet
NIC (Network Interface Card). The default is Auto (auto negotiation), which means the NIC will
negotiate with the hub or switch. The bandwidth and/or duplex can be manually set by removing the
check from the Auto box and choosing the specific option:

Bandwidth – Auto
If the host is connected to a hub or switch port which can do 100 Mbps, then the Ethernet
NIC on the host will choose 100 Mbps (Fast Ethernet). Otherwise, if the hub or switch port can only
do 10 Mbps, then the Ethernet NIC on the host will choose 10 Mbps (Ethernet).

Duplex – Auto
Hub: If the host is connected to a hub, then the Ethernet NIC on the host will choose Half Duplex.

Switch: If the host is connected to a switch, and the switch port is configured as Full Duplex (or
Autonegotiation), then the Ethernet NIC on the host will choose Full Duplex. If the switch port is
configured as Half Duplex, then the Ethernet NIC on the host will choose Half Duplex. (Full Duplex
is a much more efficient option.) The information is automatically saved when entered.
9

 Repeat these steps for the other hosts. Use the information below for IP Addresses and Subnet
Masks.

 Verify the information: To verify the information that you entered, move the Select tool (arrow)
over each host.

 Deleting a Device or Link: To delete a device or link, choose the Delete tool and click on the item
you wish to delete.

Step 6: Connecting Hub0 to Switch0


 To connect like-devices, like a Hub and a Switch, we will use a Cross-over cable. Click once the
Cross-over Cable from the Connections options.

 Move the Connections cursor over Hub0 and click once.


10

 Select Port2 (actual port does not matter).

 Move the Connections cursor to Switch0.

 Click once on Switch0 and choose FastEthernet0/3 (actual port does not matter).

The link light for switch port FastEthernet0/3 will begin as amber and eventually change to
green as the Spanning Tree Protocol transitions the port to forwarding.
11

Network Simulation
In this part, we are going to use the simulator to simulate traffic between hosts. For this
scenario, delete the switch and host PC3, then connect host PC2 to the hub.

Task 1 Observe the flow of data from PC0 to PC1 by creating network traffic.
a) Switch to Simulation Mode by selecting the tab that is partially hidden behind the Real Time
tab in the bottom right-hand corner. The tab has the icon of a stopwatch on it.

NOTE: When Simulation Mode is chosen, a Simulation Panel will appear on the right side of the
screen. This panel can be moved by moving the cursor at the top of the panel until it changes and
then double-clicking on it. The panel can be restored to the original location by double-clicking on
the Title bar. If the panel is closed, click on the Event List button.

b) Click on Edit Filters, and then select All/None to deselect every filter. Then choose ARP and
ICMP and click in the workspace to close the Edit Filters window.

c) Select a Simple PDU by clicking the closed envelope in the Common Tools Bar on the right.

Move to PC0 and click to establish the source. Move to PC1 and click to establish the
destination. Notice that two envelopes are now positioned beside PC0. This is referred to as a data
traffic scenario. One envelope is an ICMP packet, while the other is an ARP packet. The Event List
in the Simulation Panel will identify exactly which envelope represents ICMP and which represents
an ARP.
12

A scenario may be deleted by clicking on the Delete button in the Scenario panel.

Multiple scenarios can be created by clicking on the New button in the Scenario panel. The
scenarios can then be toggled between without deleting.

d) Select Auto Capture / Play from the Simulation Panel Play Controls. Below the Auto
Capture / Play button is a horizontal bar, with a vertical button that controls the speed of the
simulation. Dragging the button to the right will speed up the simulation, while dragging is to
the left will slow down the simulation.
e) Choose the Reset Simulation button in the Simulation window.

Notice that the ARP envelope is no longer present. This has reset the simulation but has not
cleared any configuration changes or MAC / ARP table entries.
13

f) Choose the Capture / Forward button.

Notice that the ICMP envelope moved forward one device and stopped. The Capture /
Forward button will allow you to move the simulation one step at a time.
g) Choose the Power Cycle Devices button on the bottom left, above the device icons.
h) Choose Yes
Notice that both the ICMP and ARP envelopes are now present. The Power Cycle Devices
will clear any configuration changes not saved and clear the MAC / ARP tables.

Task 2 View ARP Tables on each PC.


a) Choose the Auto Capture / Play button and allow the simulation to run completely.
b) Click on PC-0 and select the Desktop tab.

c) Select the Command Prompt and type the command arp -a.
d) Notice that the MAC address for PC2 is in the ARP table (to view the MAC address of PC2,
click on PC2 and select the Config tab).
e) To examine the ARP tables for PC1 and PC2 in another way, click on the Inspect Tool.

Then click on PC1 and the ARP table will appear in a new window.
14

Note that PC2 does not have an entry in the ARP table yet. Close the ARP Table window.
f) Click on PC2 to view the ARP table. Then close the ARP Table window.

NOTE: To deactivate the Inspect Tool, click on the Select Tool


15

Lab II: Cisco Router Configuration with Packet Tracer

1. Cisco Router Introduction

A Cisco router is as a special-purpose computer. It has its own operating system, which is
called the Internetwork Operating System (IOS), as well as files and file systems. Cisco routers use
flash memory, rather than disks, for storing information. Flash storage media is significantly more
expensive and slower than disk storage, but the amount of storage needed to run a router is relatively
small compared to the amount needed to run a general-purpose computer.
Flash storage is similar to Random Access Memory (RAM), but it does not need power to
retain information, so it is called non-volatile RAM (NVRAM). There are other types of non-volatile
solid state storage, such as Erasable Programmable Read Only Memory (EPROM).On most Cisco
routers, the NVRAM area is somewhere between 16 and 256 KB, depending on the size and function
of the router.
There are two important configuration files on any router:
running-config – describes the current running state of the router.
startup-config – is used by router to boot.

show running- show version show protocols


config (show hardware)
(write terminal) show memory

RAM (running-config Programme Running


configuration file buffer)

Flash memory ROM (ROMMON NVRAM


(IOS) miniOS) (startup-config)

show flash show interface show startup-config


(show configuration)

Figure 1. Router’s Component, and Show Commands


16

2. Adding Routers and Installing Modules


a) In the Network Component Box, click on the router.

b) Select an 1841 router.

c) Move the cursor to the Logical Workspace and click on the desired location.

NOTE: If multiple instances of the same device are needed press and hold the Ctrl button, click on
the desired device, and then release the Ctrl button. A copy of the device will be created and can
now be move to the desired location.

d) Click on the router to bring up the Configuration Window. This window has three modes:
Physical, Config, and CLI (Physical is the default mode).
17

The Physical mode is used to add modules to a device, such as a WAN Interface Card (WIC).
The Config mode is used for basic configuration. Commands are entered in a simple GUI format,
with actual equivalent IOS commands shown in the lower part of the window. The CLI mode allows
for advanced configuration of the device. This mode requires the user to enter the actual IOS
commands just as they would on a live device.

e) In the Physical mode, click on the router power switch to turn the device off.

f) Select the WIC-2T module and drag it to Slot 0 on the router. Then drag a WIC Cover to
Slot1.

g) Power the device back on.


h) Click on the Network Component Box and select Connections. Then select a Copper
Straight-through connection to connect the router to the hub.
18

NOTE: The Smart Connection can be used to automatically select the appropriate cable type.
However, the user will have no choice as to which interface the connection is assigned to; it will take
the first available appropriate interface.

i) Click on the hub and choose Port 3. Then click on the router and choose interface
FastEthernet 0/0.

3. Basic Router Configuration


a) Click on the Config mode tab of Router0 to begin configuring the device.
b) After the device has finished booting, change the display name of the router to CISCO_1.
Changing the display name does not affect the configuration.

NOTE: If the device hangs up in the booting process, save the activity. Then close the application
and reopen the file.
c) Click in the Hostname field and type CISCO_1, and then press the TAB key. Note the
equivalent IOS command is entered in the lower portion of the window.
d) Click on interface FastEthernet 0/0 and assign the IP address 192.168.1.1, then press the
TAB key. Enter the subnet mask 255.255.255.0.
e) Click the Port Status to On to enable the port (no shutdown).
19

4. Cisco IOS Modes


The Cisco IOS command-line interface is organized around the idea of modes. Each mode
has a set of commands available in that mode, and some of these commands are only available in that
mode. In any mode, typing a question mark will display a list of commands available in that mode.
After you have been selected a router, click the router. Then, a window with three modes will
appear and select the CLI mode to configure the router with IOS command line interface. Press
RETURN to get started!
1. If everything is fine, you should see the prompt shown below. This is the User EXEC
mode.
Router1>

2. To see which commands are available in this mode, type ?:


Router1> ?

3. To view and change system parameters of a Cisco router, you must enter the Privileged
EXEC mode by typing:
Router1> enable
Router1#

4. Type the following command to disable the Privileged EXEC mode

Router1# disable
or
Router1# exit

5. To modify system wide configuration parameters, you must enter the global configuration
mode. This mode is entered by typing:
Router1# configure terminal
Router1(config)#

6. To make changes to a network interface, enter the interface configuration mode, with the
command:

Router1(config)# interface FastEthernet0/0


Router1(config-if)#
20

The name of the interface is provided as an argument. Here, the network interface that is
configured is FastEthernet0/0.
7. To return from the interface configuration to the global configuration mode, or from the
global configuration mode to the Privileged EXEC mode, use the exit command:

Router1(config-if) # exit
Router1(config)# exit
Router1#

The exit command takes you one step up in the command hierarchy. To directly return to
the Privileged EXEC mode from any configuration mode, use the end command:

Router1(config-if) # end
Router1#

8. To terminate the console session from the User EXEC mode, type logout or exit:

Router1> logout
Router1 con0 is now available
Press RETURN to get started.

Router1> exit
Router1 con0 is now available
Press RETURN to get started.

5. Login Configuration
5.1. Privileged Password
To assign the privileged level password, use enable password command

Router1(config)#enable password cisco


Router1(config)# exit
Router1# exit
Router1>en
Password:
21

However, you can see the password by show running-config.

Router1# show running-config



Enable password cisco

To enable strong, nonreversible encryption of the privileged password, use the enable secret
command.

Router1(config)#enable secret ciscosecret


Router1(config)# exit
Router1# exit
Router1>en
Following command shows what the “enable secret” and “enable password” command in the router’s
Password:cisco
configuration file.
Password:ciscosecret

Router1# show running-config | include enable


enable secret 5 $1$mERr$q.MA2tj.WFptzvbifq/1i.
enable password cisco

You can remove privileged and secret passwords by the following commands:

Router1(config)# no enable password


Router1(config)# no enable secret

5.2. Encrypting Passwords


You need to encrypt passwords so that they do no appear in plain-text in the router
configuration file as “enable password”, and line connection as VTY, console, and AUX.

Router1(config)# service password-encryption


22

5.3. Console
Without a console password, the connection can be made via the console connection without
password. To configure the console password,

Router1(config)# enable secret admin

Router1(config)# line console 0


Router1(config-line)# password ciscoconsole
Router1(config-line)#login
Router1(config-line)#exit

Router1(config)#

Router1#sh run

!
line con 0
password ciscoconsole
login
line aux 0
line vty 0 4

!
end

The console password must be encrypted by the following command.

Router1(config)# service password-encryption

Increase the console session timeout, so the connection will not be disconnected.

Router1#conf t
Router1(config)# line console 0
Router1(config-line)# exec-timeout 0 0
Router1(config-line)#exit

Router1(config)#
23

5.4. Telnet
To accept the telnet connection, configure enable secret (or enable password), and
the login must be configured on the VTY.

Router1#conf t
Router1(config)# line vty 0 4
Router1(config-line)# password ciscovty

Router1(config-line)#login
Router1(config-line)#exit

Router1(config)#

The VTY password must be encrypted by the following command.

Router1(config)# service password-encryption


Increase the telnet session timeout, so the connection will not be disconnected.

Router1(config)# line vty 0 4


Router1(config-line)# exec-timeout 0 0

Router1(config-line)#exit

Router1(config)#

Router1#sh run
!

line vty 0 4
exec-timeout 0 0
password 7 070C285F4D060F110E
login
!

Now, test the telnet connection from router Router0 to Router1. Create the fastethernet link
between router Router0 and Router1
24

Now telnet to the router Router1 from Router0.

Router0#telnet 192.168.1.2
Trying 192.168.1.2 … Open
User Access Verfication

Password: ciscovty
Router1>
Password:admin

Router1#

6. Create a Copy of the Existing Router Complete with WIC Modules Already in Place
a) Make sure that the existing router is selected (it will be grayed out).
b) In the Main Tool Bar click on the Copy tool.

c) Click on the Paste tool and the copied device will appear in the work area.

d) Drag the new device to the desired location.


e) Click on the Network Component Box and select Connections. Then select the Serial DCE
connection.

f) Click on the RouterA router and connect to the Serial 0/0/0 interface.
25

g) Click on the new router (copy RouterA) and connect to the Serial 0/0/0 interface.

a) Click on the RouterA router and select the Config mode


b) Select interface Serial 0/0/0
c) Configure the interface Serial 0/0/0 with the IP address 192.168.2.1, then press the
TAB key and enter the subnet mask 255.255.255.0 on the interface.
d) Set the clock rate to 64000
e) Click the Port Status to On to enable the port (no shutdown).
f) Click on the new router and select the Config mode.
g) Change the Display Name and Hostname to RouterB.
h) Configure the interface Serial 0/0/0 with the IP address 192.168.2.2, then press the
TAB key and enter the subnet mask 255.255.255.0 on the interface.
i) Click the Port Status to On to enable the port (no shutdown).
NOTE: The link lights on the serial link should change from red to green to indicate the link is
active.

You can remove assigned ip address at interface fast Ethernet f0/0 of router 0 (R0), by the
following command:

R0(config)#interface fastethernet 0/0


R0(config-if)#no ip address
26

Lab III: Routing Basics


The term routing is used for taking a packet from one device and sending it through the
network to another device on a different network. To be able to route packets, a router must know at
least the following.
 Destination address
 Neighbor routers to all remote networks
 Possible routes to all remote networks
 The best route to each remote network
 How to maintain and verify routing information
The router learns about remote networks from neighbor routers or from an administrator. The
router then builds a routing table (a map of the internetwork) that describes how to find the remote
networks. If a network is directly connected, then the router already knows how to get to it.
If a network is not directly connected to the router, the router must learn how to get to the
remote network in one of two ways:
Static Routing: Someone must hand type all network locations into the routing table. The
administrator is responsible for updating all changes by hand into all routers.
Dynamic Routing: A protocol on one router communicates with the same protocol running on
neighbor routers. The routers then update each other about all networks they know about and place
this information into the routing table.
Typically, in a large network, a combination of both dynamic and static routing is used.

Static Routing
The command “ip route” is used to configure static route information for a router to possibly
use in its routing table.
# ip route [destination_network] [mask] [next-hop_address or exitinterface]

Table 1: Static Routing Commands and Options


Options Meaning
destination_network The network you are placing in the routing table.
mask The subnets mask being used on the network.
next-hop_address The address of the next-hop router that will receive the packet and
forward it to the remote network. This is a router interface that’s on
27

a directly connected network.


exitinterface Used in place of the next-hop address if you want and shows up as
a directly connected route.

Task 1. Communication across a Simple Routed Network


In the below figure, a single router connects to networks 192.168.0.0/16 and 10.0.0.0/8.
Without configuring anything else on this router, it is already capable of routing data between
network 192.169.0.0 and network 10.0.0.0. That’s why? After assigning a Cisco router IP addresses,
it knows about the networks that is directly connected to, and the command “ip routing” is enabled
by default.

Figure 3.1 – Simple Routed Network with one Host on Each Network

Configuration of router, R0:

Router>en
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R0
R0(config)#enable secret router
R0config)#line console 0
R0(config-line)#password cisco
R0(config-line)#login
R0(config-line)#line vty 0 4
R0(config-line)#password cisco
R0(config-line)#login
R0(config-line)#exec-timeout 0 0
R0(config-line)#interface fastethernet 0/0
R0(config-if)#ip address 192.168.0.1 255.255.255.0
R0(config-if)#no shutdown

R0(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
28

R0(config-if)#interface fastethernet 0/1


R0(config-if)#ip address 10.0.0.1 255.0.0.0
R0(config-if)#no shutdown

R0(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

R0(config-if)#exit
R0(config)#exit
R0#
%SYS-5-CONFIG_I: Configured from console by console

R0#write memory
Building configuration...
[OK]
R0#

To view the IP routing table on a Cisco router, use the “show ip route” command, as shown below.

R0#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR


P - periodic downloaded static route

Gateway of last resort is not set

C 192.168.0.0/16 is directly connected, FastEthernet0/0


C 10.0.0.0/8 is directly connected, FastEthernet0/1
29

Configuration of IP address, subnet mask, and default gateway of HostA:


30

Configuration of IP address, subnet mask, and default gateway of HostB:


31

Check connectivity by pinging to 192.168.0.1, 10.0.0.1 and 10.0.0.100 from HostA.

C:\>ping 192.168.0.1
Pinging 192.168.0.1 with 32 bytes of data:
Reply from 192.168.0.1: bytes=32 time=1ms TTL=255
Reply from 192.168.0.1: bytes=32 time<1ms TTL=255
Reply from 192.168.0.1: bytes=32 time<1ms TTL=255

C:\>ping 10.0.0.1
Pinging 10.0.0.1 with 32 bytes of data:
Reply from 10.0.0.1: bytes=32 time=1ms TTL=255
Reply from 10.0.0.1: bytes=32 time<1ms TTL=255
Reply from 10.0.0.1: bytes=32 time<1ms TTL=255

C:\>ping 10.0.0.100
Pinging 10.0.0.100 with 32 bytes of data:
Reply from 10.0.0.100: bytes=32 time=1ms TTL=127
Reply from 10.0.0.100: bytes=32 time<1ms TTL=127
Reply from 10.0.0.100: bytes=32 time=1ms TTL=127

Check connectivity by pinging to 10.0.0.1, 192.168.0.1 and 192.168.0.99 from HostB.

C:\>ping 10.0.0.1

Pinging 10.0.0.1 with 32 bytes of data:

Reply from 10.0.0.1: bytes=32 time=1ms TTL=255


Reply from 10.0.0.1: bytes=32 time<1ms TTL=255

C:\>ping 192.168.0.1

Pinging 192.168.0.1 with 32 bytes of data:

Reply from 192.168.0.1: bytes=32 time=1ms TTL=255


Reply from 192.168.0.1: bytes=32 time<1ms TTL=255

C:\>ping 192.168.0.99

Pinging 192.168.0.99 with 32 bytes of data:

Reply from 192.168.0.99: bytes=32 time=1ms TTL=127


Reply from 192.168.0.99: bytes=32 time<1ms TTL=127
Reply from 192.168.0.99: bytes=32 time<1ms TTL=127

Ping statistics for 192.168.0.99:


32

Task 2. Communication across a More Complex Routed Network


Cisco routers know about the networks to which it is directly connected. For now, we are
going to assume to setting up static routing on our simple network. We really need to accomplish
three main goals:
 Configure RA with a way to get to networks 10.0.3.0/24 and 10.0.4.0/24
 Configure RB with a way to get to networks 10.0.1.0/24 and 10.0.4.0/24
 Configure RC with a way to get to networks 10.0.1.0/24 and 10.0.2.0/24

Figure 3.2 – Complex Routed Network

Configuration of router, RA:

Router>en
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname RA
RA(config)#enable secret router
RA(config)#line console 0
RA(config-line)#password cisco
RA(config-line)#login
RA(config-line)#line vty 0 4
RA(config-line)#password cisco
RA(config-line)#login
RA(config-line)#exec-timeout 0 0
RA(config-line)#interface fastethernet 0/0
RA(config-if)#ip address 10.0.1.1 255.255.255.0
RA(config-if)#no shutdown
RA(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
RA(config-if)#interface fastethernet 0/1
RA(config-if)#ip address 10.0.2.1 255.255.255.0
RA(config-if)#no shutdown
33

RA(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
RA(config-if)#exit
RA(config)#exit
RA#
%SYS-5-CONFIG_I: Configured from console by console
RA#write memory
Building configuration...
[OK]

Configuration of router, RB:

Router>en
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname RB
RB(config)#enable secret router
RB(config)#line console 0
RB(config-line)#password cisco
RB(config-line)#login
RB(config-line)#line vty 0 4
RB(config-line)#password cisco
RB(config-line)#login
RB(config-line)#exec-timeout 0 0
RB(config-line)#int f0/0
RB(config-if)#ip address 10.0.2.2 255.255.255.0
RB(config-if)#no shutdown

RB(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

RB(config-if)#interface fastethernet 0/1


RB(config-if)#ip address 10.0.3.1 255.255.255.0
RB(config-if)#no shutdown

RB(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

RB(config-if)#exit
RB(config)#exit
RB#
%SYS-5-CONFIG_I: Configured from console by console
34

RB#write memory
Building configuration...
[OK]
RB#

Configuration of router, RC:

Router>en
Router#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname RC
RC(config)#enable secret router
RC(config)#line console 0
RC(config-line)#password cisco
RC(config-line)#login
RC(config-line)#line vty 0 4
RC(config-line)#password cisco
RC(config-line)#login
RC(config-line)#exec-timeout 0 0
RC(config-line)#interface fastethernet 0/0
RC(config-if)#ip address 10.0.3.2 255.255.255.0
RC(config-if)#no shutdown

RC(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

RC(config-if)#interface fastethernet 0/1


RC(config-if)#ip address 10.0.4.1 255.255.255.0
RC(config-if)#no shutdown

RC(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

RC(config-if)#exit
RC(config)#exit
RC#
RC#write mem

See the routing table by “show ip route” command at each router.


35

RA#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 2 subnets
C 10.0.1.0 is directly connected, FastEthernet0/0
C 10.0.2.0 is directly connected, FastEthernet0/1

RB#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set


10.0.0.0/24 is subnetted, 2 subnets
C 10.0.2.0 is directly connected, FastEthernet0/0
C 10.0.3.0 is directly connected, FastEthernet0/1

RC#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/24 is subnetted, 2 subnets


C 10.0.3.0 is directly connected, FastEthernet0/0
C 10.0.4.0 is directly connected, FastEthernet0/1
36

We’ll need to add a static route on RA, telling it that network 10.0.3.0/24 and 10.0.4.0/24 can
be reached via the next hop address of 10.0.2.2.

RA(config)#ip route 10.0.3.0 255.255.255.0 10.0.2.2


RA(config)#ip route 10.0.4.0 255.255.255.0 10.0.2.2
RA(config)#exit
RA#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/24 is subnetted, 4 subnets


C 10.0.1.0 is directly connected, FastEthernet0/0
C 10.0.2.0 is directly connected, FastEthernet0/1
S 10.0.3.0 [1/0] via 10.0.2.2
S 10.0.4.0 [1/0] via 10.0.2.2

Again, We need to add a static route on RB, telling it that network 10.0.1.0/24 can be reached
via the next hop address of 10.0.2.1 and 10.0.4.0/24 can be reached via the next hop address of
10.0.3.2.

RB(config)#ip route 10.0.1.0 255.255.255.0 10.0.2.1


RB(config)#ip route 10.0.4.0 255.255.255.0 10.0.3.2
RB(config)#exit
RB#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set


37

10.0.0.0/24 is subnetted, 4 subnets


S 10.0.1.0 [1/0] via 10.0.2.1
C 10.0.2.0 is directly connected, FastEthernet0/0
C 10.0.3.0 is directly connected, FastEthernet0/1
S 10.0.4.0 [1/0] via 10.0.3.2

Again, we need to add a static route on RB, telling it that network 10.0.1.0/24 and 10.0.2.0/24
can be reached via the next hop address of 10.0.3.1.

RC(config)#ip route 10.0.1.0 255.255.255.0 10.0.3.1


RC(config)#ip route 10.0.2.0 255.255.255.0 10.0.3.1
RC#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/24 is subnetted, 4 subnets


S 10.0.1.0 [1/0] via 10.0.3.1
S 10.0.2.0 [1/0] via 10.0.3.1
C 10.0.3.0 is directly connected, FastEthernet0/0
C 10.0.4.0 is directly connected, FastEthernet0/1

RC#

Notice that a new entry has been added to the routing table, and is preceded by an “S”. This
designates the route as static.
In order to remove a static route, use the “no” version of the ip route command, followed by
the network address and subnet mask of the route you wish to remove. For example, to remove the
static route to network 10.0.1.0/24 from router C, RC, you would enter:

RC(config)#no ip route 10.0.1.0 255.255.255.0


38

Task 3. Default Routing


 In the same way that you can set a default gateway on your desktops and servers, you can
also set a default gateway of sorts on your Cisco router – the gateway of last resort. While the
name is different, the function is the same.
 If we specify a gateway of last resort, a router will forward traffic for networks that it doesn’t
know about to the destination router address we specify.

Figure 3.3. Default Routing with 3 routers and 2 hosts

 In the figure, RouterA is connected to many different networks. RouterB, on the other hand,
is only connected to two networks. In order to allow RouterB to get to all of the other
networks shown, we would either need to configure a routing protocol (like RIP or IBRP) or
define static routes to each network.
 In this scenario, it might be easier to use default routing to allow RouterB to reach those two
networks. In order to have RouterB forward all traffic destined for other networks to
RouterA, we should configure a gateway of last resort on RouterB. This involves a single
routing table entry, with a destination network of 0.0.0.0 which address literally means “all
networks”. In other words, we are saying that all other networks can be reached via RouterA.
 You can only configure default routing on a router that is connected to a stub network, which
means that there is no another router on the connected networks. In other words, there is only
one way in and out.
39

Configuration of RouterA:

Router>en
Router#conf ter
Router(config)#hostname RouterA
RouterA(config)#enable secret router
RouterA(config)#line console 0
RouterA(config-line)#password cisco
RouterA(config-line)#login
RouterA(config-line)#line vty 0 4
RouterA(config-line)#password cisco
RouterA(config-line)#login
RouterA(config-line)#exec-timeout 0 0
RouterA(config-line)#interface fastethernet 0/0
RouterA(config-if)#ip address 10.0.10.1 255.255.255.0
RouterA(config-if)#no shutdown
RouterA(config-if)#interface serial 0/0/0
RouterA(config-if)#ip address 10.0.20.1 255.255.255.0
RouterA(config-if)#no shutdown
RouterA(config-if)#interface serial 0/0/1
RouterA(config-if)#ip address 10.0.30.1 255.255.255.0
RouterA(config-if)#clock rate 64000
RouterA(config-if)#no shutdown
RouterA(config-if)#exit
RouterA(config)#ip route 10.0.40.0 255.255.255.0 10.0.30.2
RouterA(config)#exit
RouterA#write memory
Building configuration...
[OK]
40

Configuration of RouterB:

Router>en
Router#conf ter
Router(config)#hostname RouterB
RouterB(config)#enable secret router
RouterB(config)#line console 0
RouterB(config-line)#password cisco
RouterB(config-line)#login
RouterB(config-line)#line vty 0 4
RouterB(config-line)#password cisco
RouterB(config-line)#login
RouterB(config-line)#exec-timeout 0 0
RouterB(config-line)#interface serial 0/0/0
RouterB(config-if)#ip address 10.0.30.2 255.255.255.0
RouterB(config-if)#no shutdown
RouterB(config)#interface fastethernet 0/0
RouterB(config-if)#ip address 10.0.40.1 255.255.255.0
RouterB(config-if)#no shutdown
RouterB(config-if)#exit
RouterB(config)#exit
RouterB#write memory
Building configuration...
[OK]
RouterB#

To configure the gateway of last resort on RouterB, use the “ip route” command, as shown below.

RouterB#conf ter
RouterB(config)#ip route 0.0.0.0 0.0.0.0 10.0.30.1

If you look at the routing table, you’ll see only the two directly connected networks plus and
*
S , which indicates this entry is a candidate for a default route.
41

RouterB(config)#do sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is 10.0.30.1 to network 0.0.0.0

10.0.0.0/24 is subnetted, 2 subnets


C 10.0.30.0 is directly connected, Serial0/0/0
C 10.0.40.0 is directly connected, FastEthernet0/0
S* 0.0.0.0/0 [1/0] via 10.0.30.1

Configuration of RouterC:

Router>en
Router#conf ter
Router(config)#hostname RouterC
RouterC(config)#enable secret router
RouterC(config)#line console 0
RouterC(config-line)#password cisco
RouterC(config-line)#login
RouterC(config-line)#line vty 0 4
RouterC(config-line)#password cisco
RouterC(config-line)#login
RouterC(config-line)#exec-timeout 0 0
RouterC(config-line)#interface serial 0/0/0
RouterC(config-if)#ip address 10.0.20.2 255.255.255.0
RouterC(config-if)#no shutdown
RouterC(config-if)#clock rate 64000
RouterC(config-if)#exit
RouterC(config)#ip route 0.0.0.0 0.0.0.0 10.0.20.1
RouterC(config)#exit

Configuration of Host A and Host B:

 Click on HostA and select the Config tab. Enter the ip address 10.0.10.100, subnet mask
255.255.255.0 and the default gateway address 10.0.10.1.
42

 Click on HostB and select the Config tab. Enter the ip address 10.0.40.100, subnet mask
255.255.255.0 and the default gateway address 10.0.40.1.

Lab IV: Network Address Translation


The challenge to the private network is that private addresses cannot be publicly routed.
Hence, address translation is implemented. Address translation provides not only a method of
conserving public address space, but also an additional level of protection for internal nodes because
there is no way to router to a private address from the internet.
 Dynamic address translation: Translate multiple local addresses into a limited number of global
public addresses or possibly a single global address. This is called dynamic address translation.
 Network Address Translation (NAT): Translate multiple local addresses into a limited
number of global public addresses or possibly a single global address.
 Port Address Translation (PAT): PAT is also called IP-Masquerading, Network
Masquerading, Network Address Port Translation (NAPT), or often just called NAT
translating multiple local addresses to a single global address.
 Static translation: Allows for a one-to-one translation of local to global addresses. Static
translation is commonly used when the internal node must be accessed from the Internet. Web
servers and mail servers must have static addresses so that users on the Internet can connect to
then via their global address.

Global or live IP address = 177.77.77.1-177.77.77.7/30


Local IP addresses = 192.168.44.1 – 192.168.44.14/28
Number of inside-hosts = 14

Figure 4.1: NAT Configuration


43

Task 1: Configure IP addresses and setting a static default route.


Access the CLI and specify the following IP address configuration on both routers
Router1 Configuration:

Router1(config)#int fa0/0
Router1(config-if)#ip address 177.77.77.10 255.255.255.0
Router1(config-if)#no shutdown
Router1(config)#int fa0/1
Router1(config-if)#ip address 203.10.123.1 255.255.255.0
Router1(config-if)#no shutdown
Router1(config)#ip route 192.168.44.0 255.255.255.0 177.77.77.1

Router0 configuration:

Router0(config)#int fa0/1
Router0(config-if)#ip address 177.77.77.1 255.255.255.0
Router0(config-if)#no shut
Router0(config)#int fa0/0
Router0(config-if)#ip address 192.168.44.1 255.255.255.0
Router0(config-if)#no shut
Router0(config)#ip route 200.10.123.0 255.255.255.0 177.77.77.10
Router0(config)#exit

Task 2: Configure NAT on Router0


Step 1: Access the CLI on the Router0
Step 2: Configure a standard access list using an access list id of 1 and permit any device on subnet
192.168.44.0 /24

Router0(config)#access-list 1 permit 192.168.44.0 0.0.0.255

Here access list is used to identify which source IPs are going to be translated using NAT,
and this example allows any device from the 192.168.44.0 network.
Step 3: Create a dynamic NAT IP-address pool, this will hold a list of inside global addresses.
Name of Pool: NAT-POOL
Starting IP address 192.168.44.1
Ending IP address 192.168.44.14
Network mask 255.255.255.240
44

Complete this configuration with following commands:

Router0(config)#ip nat pool NAT-POOL 177.77.77.1 177.77.77.7 netmask 255.255.255.240


Router0(config)#ip nat inside source list 1 pool NAT-POOL

For network address translations, we require to identify at least two interfaces to be our inside
and outside.
Interface fa0/0 will be our inside interface
Interface fa0/1 our outside interface
You can use the following commands for configuring inside and outside interfaces.

Router0(config)#int fa0/0
Router0(config-if)#ip nat inside
Router0(config-if)#int fa0/1
Router0(config-if)#ip nat outside

Step4: Testing NAT translation: When we ping from PC1 to PC0 to R1 our original IP address will
be translated from a 192.168.44.x to 177.77.77.x
You can verify it after the successful ping from PC1 to PC0 and then use the command
“show IP nat translation”.

Router0#sh ip nat translations


Pro Inside global Inside local Outside local Outside global
icmp 177.77.77.1:10 192.168.44.5:10 200.10.123.5:10 200.10.123.5:10
icmp 177.77.77.1:1 192.168.44.5:1 200.10.123.5:1 200.10.123.5:1
icmp 177.77.77.1:2 192.168.44.5:2 200.10.123.5:2 200.10.123.5:2
icmp 177.77.77.1:3 192.168.44.5:3 200.10.123.5:3 200.10.123.5:3
icmp 177.77.77.1:6 192.168.44.5:6 200.10.123.1:6 200.10.123.1:6
icmp 177.77.77.1:7 192.168.44.5:7 200.10.123.5:7 200.10.123.5:7
icmp 177.77.77.1:8 192.168.44.5:8 200.10.123.5:8 200.10.123.5:8
icmp 177.77.77.1:9 192.168.44.5:9 200.10.123.5:9 200.10.123.5:9

The command “show ip nat statistics” shows the total number of active translations, NAT
configuration parameters and how many addresses are in the pool, and how many have been
allocated.
45

Router0#sh ip nat statistics


Total translations: 0 (0 static, 0 dynamic, 0 extended)
Outside Interfaces: FastEthernet0/1
Inside Interfaces: FastEthernet0/0
Hits: 10 Misses: 14
Expired translations: 11
Dynamic mappings:
-- Inside Source
access-list 1 pool NAT-POOL refCount 0
pool NAT-POOL: netmask 255.255.255.240
start 177.77.77.1 end 177.77.77.7
type generic, total addresses 7 , allocated 0 (0%), misses 0

Lab V: Virtual LAN (VLAN)


A local network should be designed using small broadcast domains. A broadcast domain is a
set of devices that can all hear each other’s broadcast frames. A broadcast frame is a frame that is
sent to the MAC address FF:FF:FF:FF:FF:FF. By default, switches do not divide broadcast domains.
To accomplish this, virtual LANs are necessary.
A virtual LAN (VLAN) is an emulation of a standard LAN that allows data transfer to take
place without the traditional physical limitation placed on a network. A VLAN is a set of LAN
devices that belong to an administrative group. Members of a VLAN communicate with each other
as if they were on the same wire or hub, when in fact they may be located on different physical LAN
segments. Because VLANs are based on logical instead of physical connections, they are extremely
flexible.
46

Figure 5.1: VLAN Configuration

PC Configuration:
Devices IP address VLAN Default Gateway
PC0 10.0.0.2 10 10.0.0.1
PC1 10.0.0.3 20 20.0.0.1
PC2 10.0.0.4 10 10.0.0.1
PC3 20.0.0.2 20 20.0.0.1
PC4 20.0.0.3 10 10.0.0.1
PC5 20.0.0.4 20 20.0.0.1

Creating VLAN on Switch0:

Switch0(config)#vlan 10

Switch0(config-vlan)#exit

Switch0(config)#vlan 20

Switch0(config-vlan)#exit

Assigning VLAN Membership


VLAN can be assigned statically or dynamically. switchport access vlan [vlan number]
command is used to assign VLAN to the interface.
47

Switch0:

Switch0(config)#interface fastEthernet 0/1


Switch0(config-if)#switchport access vlan 10
Switch0(config)#interface fastEthernet 0/2
Switch0(config-if)#switchport access vlan 20
Switch0(config)#interface fastEthernet 0/3
Switch0(config-if)#switchport mode trunk
Switch0(config)#interface fastEthernet 0/24
Switch0(config-if)#switchport mode trunk

Switch1:

Switch1(config)#interface fastEthernet 0/1


Switch1(config-if)#switchport access vlan 10
Switch1(config)#interface fastEthernet 0/2
Switch1(config-if)#switchport access vlan 20
Switch1(config)#interface fastEthernet 0/24
Switch1(config-if)#switchport mode trunk
Switch1(config)#interface fastEthernet 0/23
Switch1(config-if)#switchport mode trunk

Switch2:

Switch2(config)#interface fastEthernet 0/1


Switch2(config-if)#switchport access vlan 10
Switch2(config)#interface fastEthernet 0/2
Switch2(config-if)#switchport access vlan 20
Switch2(config)#interface fastEthernet 0/23
Switch2(config-if)#switchport mode trunk

We have successfully assigned VLAN membership. It’s time to test our configuration. To test
this configuration, we will use ping command. ping command is used to test connectivity between
two devices. As per our configuration, devices from same VLAN can communicate. Devices from
different VLANs must not be able to communicate with each other without router.
48

In VLAN10, three PCs with IP addresses 10.0.0.2, 10.0.0.3, and 10.0.0.4 can communicate
with each other’s. At this point, PCs from VLAN10 should not be allowed to access PCs from
VLAN20.
Same as VLAN10, PCs from VLAN20 must be able to communicate with other PCs of same
VLAN while they should not be able to access VLAN10.
Typically routers are configured to receive data on one physical interface and forward that
data from another physical interface based on its configuration. Each VLAN has a layer 3 address
that should be configured as default gateway address on all its devices. In our scenario, we reserved
IP address 10.0.0.1 for VLAN10 and 20.0.0.1 for VLAN20.
With default configuration we need two physical interfaces on router to make this intra
VLAN communication. Due to price of router, it’s not a cost effective solution to use a physical
interface of router for each VLAN. To deal with situation, we use Router on Stick. Router on Stick is
router that supports trunk connection and has an ability to switch frames between the VLANs on this
trunk connection. On this router, single physical interface is sufficient to make connection between
both VLANs.

Configuration of Router0:
Router>en
Router#conf ter
Router(config)#int fa0/0
Router(config-if)#no ip address
Router(config-if)#no shut down
Router(config-if)#exit
Router(config)#interface fa0/0.10
Router(config-subif)#
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip address 10.0.0.1 255.0.0.0
Router(config-subif)#exit
Router(config)#int fa 0/0.20
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip address 20.0.0.1 255.0.0.0
Router(config-subif)#exit

*****Now we can test different VLAN communications.*****

You might also like