Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
19 views7 pages

1-CN - IT2050 - P1 - Self Study Meterial

Uploaded by

ajithbandara1211
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)
19 views7 pages

1-CN - IT2050 - P1 - Self Study Meterial

Uploaded by

ajithbandara1211
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/ 7

IT2050 - Computer Networks

Self-Study Material for Lab 1

What if we need to send some files from a one computer to another? Simply we can use a LAN cable to
connect them together and transfer files between two computers with some network adapter
configurations in both computers.

But things get complicated when we need to communicate with more than 1 computer because we
have only one network port in our computers.

To overcome this kind of situations a “Switch” can be used which logically connects all the devices
connected to it together in mesh topology. Then all the computers need to be given a unique name so
they can be identified separately. In this context, the names are going to be IP addresses.
Assigning an IP address to a PC
To assign an IP address to a PC, click on the PC and then go to the Desktop Tab. There you can see the
icon for ‘IP Configuration’. Click on it and then provide the IP address and the subnet mask for the PC.

This setup is sufficient to communicate between the 4 PCs given in the example below. (After assigning
IP addresses of your choice to the PCs, try using “Add simple PDU” tool to check the communication
between 2 computers)

PC0 PC1

PC3 PC2
To add a simple PDU, click on the highlighted icon and then click on a computer to specify the source
and then click on another computer to specify the destination.

You should see the following result in the bottom right corner panel.

Note: If the panel is not visible click on the small arrow in bottom right corner to make the panel visible.

What if we need to connect this network to an another network? Then we are going to need a “Router”
which is basically capable of directing the network traffic from a network to the relevant destination
network. A single router can be connected with several networks at the same time.
Adding a Router to the setup

In the above example 2 networks are connected to a router. The networks address of 2 networks are,
192.168.0.0/24 and 10.0.0.0/8 . The number after the forward slash represents the subnet mask of the
network. For example in the first network subnet mask is 255.255.255.0 and the other network’s subnet
mask is 255.0.0.0. The ports of the router which are connected with 2 network cables from the switches
are also known as interfaces.

As you can see initially the interfaces are in the down state (triangles are in red colour). Which means
we need to configure the interfaces of the router (FastEthernet 0/0 and 0/1) to make the
communication possible between the 2 networks.

Configuring router interfaces (ports)


When configuring a router ,it is a norm to
assign the first IP address of the network to
the interface of router which is connected
with that specific network. For example for
the fastEthernet0/0 the IP address
192.168.0.1 is assigned. Likewise for Fa0/1 IP
address is 10.0.0.1.

To assign an IP address to an interface, first


click on the router and then click on CLI tab
and press enter to get the prompt.

A router have several interfaces built in it


(Depends on the router modal being used).
So first we need to access the required
interface and then assign the IP address and
the subnet mask for that interface.

Initially the router is in ‘User mode’. You can


check that by looking at the prompt. While in
the user mode the prompt is like Router>
Then type the command ‘enable’ and
press enter to go to ‘Privilaged mode’.
The prompt will be changed to Router#

To assign an IP address to an interface


you have to be in ‘Global configuration
mode’. To enter the global configuration
mode, while you are in privilaged mode
type ‘configure terminal’ and press enter.
The prompt will change to
Router(config)#

If you want to go back to a previous mode


you can type ‘exit’ and press enter.

Assigning IP addresses to router interfaces


Now that we are in the global
configuration mode, to assign an IP
address to an interface, first we need to
access that specific interface. To do so
excute the following command,

‘interface fastEthernet 0/0’

which will bring you to configuration


mode of the specified interface. Then to
assign an IP address execute the
following command which contains the
ip addesss and the subnet mask.

‘ip address 192.168.0.1 255.255.255.0’

By default the interface is in down


state. To turn on the interface you have
to execute the command

‘no shutdown’
Note: Mind that when executing commands, partialy typed commands are also accepted (‘en’ instead of
‘enable’). To auto complete a partially typed command you can press tab key on your keyboard. If
you don’t remember a command, you can type question mark ‘?’ to view the commands you can
execute in the given context.

When you execute the above set of commands, the red color triangle that was on the configured
interface will turn green after several seconds.

To assign the IP address to fastEthernet0/1 interface, you have to execute the same set of commands
but with a minor modification; the IP address and the subnet mask. The procedure and the command
are shown in the below image.
Keep in mind that in this configuration, unlike in the begining of this document, now the PCs need to
have proper IP addresses, subnet masks and default gateways which belongs to the network they are in.
Accordingly following IP addresses, subnet masks and default gateways should be assigned.

Device/Interface IP Address Subnet Mask Default gateway


Router Fa0/0 192.168.0.1 255.255.255.0
Router Fa0/1 10.0.0.1 255.0.0.0
PC0 192.168.0.2 255.255.255.0 192.168.0.1
PC1 192.168.0.3 255.255.255.0 192.168.0.1
PC2 10.0.0.2 255.0.0.0 10.0.0.1
PC3 10.0.0.3 255.0.0.0 10.0.0.1

As the name suggests the default gateway is the gate to go out from the current network. For example if
a data packet from PC0 of left side network want to reach the PC2 of the right side network, first the
data packet from PC0 must leave its current network. Once the data packet reaches the router, it can be
considered as it left its source network. Now the router knows from which interface it should send out
this data packet to reach its destination because the destination network is also directly connected to
the same router.

You might also like