Computer Networks Lab Guide
Computer Networks Lab Guide
CORSE CODE:CSE-312
Course Code:312
Credit: 1.5
Content
2|Page
SL Descriptions Page
NO
1 Overview of Networks and layered communications, understanding of
Network equipment, wiring in details
2 Ethernet cabling process- CAT6 UTP EIA/TIA 568A/B straight and cross-
over wiring, testing
3|Page
Lab Marks Distribution
Lab reports 40% Attendance/Viva 20% Final Exam 40% Total Full marks
100%
Overall Objective:
The lab works in this course provides hands on training and knowledge about the analysis,
design, troubleshooting, modeling, testing and evaluation of computer networks. Students shall
have access to real test-bed networks, virtual and simulated network with the tools like tcp dump,
wireshark, ip scanner, packet tracer, opnet, mininet, visio, Bosom, NetSim etc.. to fulfill the
objectives set forth on each lab. At the end, student shall be able to perform the network and
server administration like addressing management, switching (VLAN, VTP), routing and remote
administration (SSH, Telnet, Hyper terminal), TCU/UDP/IP packet analysis, configuring of web,
dns, dhcp and ftp servers over linux/unix OS. Students will gain the opportunity to design and
develop networking model, simulation and testing with sufficient security measures.
For Students:
Students have to complete at least 10 to 12 lab activities throughout the semester to fulfill the
objectives of the course Computer Network at Bachelor of engineering and computer science.
Each lab manual is designed with lab objective, basic theoretical background, and sample
example with necessary steps to operate with the networking tools and exercise. Before
appearing into the lab, all are requested to learn the relevant activities in summary and explore
theory/practical concepts of corresponding lab. Students have to do the exercise provided and
submit the report into the next lab. Lab report to be submitted should include at least the
following topics.
1. Cover page
2. Title
3. Objective(s)
4. Apparatus
Lab 1
4|Page
Overview of Networks and layered communications, understanding of Network equipment,
wiring in details .
Objective(s):
* To feel and know the networking equipment (repeater, hub, bridge, switch, router, crimper,
UTP, Fiber cable, connectors, patch panel, cable managers, racks, CAT6 straight and crossover
wiring standards, LAN meter/tester, RJ-45)
Network Hardware: Crimper/clamper, RJ-45 jack male/female, LAN/Cable tester, UTP, Fiber
cable, HUB/Switch/Router/Bridge, patch panel, cable manager....
Repeaters are simple devices that work at the physical layer of the OSI. They regenerate signals
(active hubs does that too).
Hubs are used to build a LAN by connecting different computers in a star/hierarchal network
topology, the most common type on LANs now a day. A hub is a very simple (or dumb) device,
once it gets bits of data sent from computer A to B, it does not check the destination, instead, it
forwards that signal to all other computers (B, C, D…) within the network. B will then pick it up
while other nodes discard it. This amplify that the traffic is shared.
2. Active: The signal is amplified, so they work as repeaters. In fact they have been called
multiport repeaters. Hub is a multiport repeater. Hubs can be connected to other hubs using an
uplink port to extend the network. Hubs work on the physical layer (lowest layer). That’s the
reason they can’t deal with addressing or data filtering.
Switches on the other hand are more advanced. Instead of broadcasting the frames everywhere, a
switch actually checks for the destination MAC address and forwards it to the relevant port to
reach that computer only. This way, switches reduce traffic and divide the collision domain into
segments, this is very sufficient for busy LANs and it also protects frames from being sniffed by
other computers sharing the same segment. They build a table of which MAC address belongs to
which segment. If a destination MAC address is not in the table it forwards to all segments
except the source segment. If the destination is same as the source, frame is discarded. Switches
have built-in hardware chips solely designed to perform switching capabilities, therefore they are
fast and come with many ports. Sometimes they are referred to as intelligent bridges or multiport
bridges.
5|Page
1. Cut-through: Directly forward what the switch gets.
2. Store and forward: receive the full frame before retransmitting it. Normal Switches are on the
data link layer (just above physical layer), that’s why they deal with frames instead of bits and
filter them based on MAC addresses. Switches are known to be used for their filtering
capabilities. Intelligent switches works as a router.
VLANs (Virtual LANs) and broadcast domains: Switches do not control broadcast domains by
default, however, if a VLAN is configured in a switch it shall have its own broadcast domain.
VLAN is a logical group of network devices located on different LAN physical segments.
However they are logically treated as if they were located on a single segment.
Bridges are used to extend networks by maintaining signals and traffic. Bridges are on the data
link layer so in principle they are capable to do what switches do like data filtering and
separating the collision domain, but they are less advanced. They are known to be used to extend
distance capabilities of networks.
In a comparison with switches, bridges are slower because they use software to perform
switching. They do not control broadcast domains and usually come with less number of ports.
Multiport bridges are generally termed as switch.
Routers are used to connect different LANs or a LAN with a WAN (e.g. the internet). Routers
control both collision domains and broadcast domains. If the packet’s destination is on a
different network, a router is used to pass it the right way, so without routers, the internet could
not functions. Routers use NAT (Network Address Translation) in conjunction with IP
Masquerading to provide the internet to multiple nodes in the LAN under a single IP address.
Routers work on the network layer so they can filter data based on IP addresses. They have
routing tables to store network addresses and forward packets to the right port.
Gateways are very intelligent devices or else can be a computer running the appropriate software
to connect and translate data between networks with different protocols or architecture, so their
work is much more complex than a normal router. For instance, allowing communication
between TCP/IP clients and IPX/SPX or AppleTalk. Gateways operate at the network layer and
above, but most of them at the application layer. There is an important rule to obey while using
repeaters/hubs to extend a local network and is called the 5-4-3. The rule forces that in a single
collision domain there shouldn’t be more than 5 segments, 4 repeaters between any two hosts in
the network and only 3 of the segments can be populated (contain user connections). This rule
ensures that a signal sent over the network will reach every part of it within an acceptable length
of time. If the network is bigger, the collision domain can be divided into two parts or more
using a switch or a bridge.
Exercise:
6|Page
1. What are physical layer devices?
2. What are the differences between Repeater and Hub? Hub and Switch?, Bridge and Switch?,
Switch and Router?
Lab-2
Ethernet cabling process- CAT6 UTP EIA/TIA 568A/B straight and cross-over wiring, testing
Objective(s):
Apparatus: UTP CAT6 cable (1M), Crimper, LAN tester Background: RJ-45 connectors
intended for use with CAT-6 cable are larger than their CAT-5 counterparts. Begin by stripping
the outer covering from the end of the cable. Remove about an inch of covering. Eventually
you'll have to cut down the amount of exposed cable, but the process of installing the RJ-45
connector will be easier if you have plenty of exposed cable to work with (but not too much).
Once you remove the outer cover, you'll see that some of the pairs of wire are twisted together
(hence the name twisted-pair cable). Untwist these wires. Once all the wires have been separated,
pull them backward so you can cut off the exposed plastic core, as shown below. Remove as
much of this core as you can. Be careful not to accidentally cut the wires in the process.
Now that the core has been removed, your next task is to straighten the wires that were
previously twisted. The easiest way to do this is by using two pairs of tweezers. Use one set of
tweezers to firmly hold the wire just beneath a bend, and the other pair to straighten the bend.
The wires don't have to be perfectly straight, but the straighter they are, the easier your job will
be. Once you've straightened the wires, your next task is to arrange them in the order they'll be
placed into the RJ-45 connector. Working from left to right, the order of the wires shall be set
with EIA 568 A or B standard as follows:
7|Page
568 B standards (wiring sequence) 568 A standards (wiring sequence)
Partial Orange (Orange with white stripe), Partial Green (Green with white stripe), Solid
Solid Orange, Partial Green, Solid Blue, Partial Green, Partial Orange, Solid Blue, Partial Blue,
Blue, Solid Green, Partial Brown, Solid Brown Solid Orange, Partial Brown, Solid Brown
8|Page
Crossover cabling
9|Page
Remember for normal wiring:
Odd Number Always holds the partial color while even number holds the solid color.
Only 1-3, 2-6 pair of number required to be adjust for A and B standard. Orange and Green
are interchangeable.
Let's start wiring by B standard. Since the leftmost wire is the orange with the white stripe,
there's a natural tendency to start with this wire on the left. Although it's possible to get the wires
in the correct order using this technique, getting the wires to stay in order when you insert the
RJ-45 connector becomes very difficult. Rather than starting with the orange and white wire,
lining up the wires is a lot easier if you start with the green wire with the white stripe, and then
work on lining up the blue, partial blue, and green wires. When all is said and done, the wires
will still have to be in the correct order, but starting with the partial green wire forces you to turn
the cable a different direction than if you were initially working with the partial orange. This
seems to make all the difference in the world for getting the wires lined up in a way that
facilitates easy installation of the RJ-45 connector.
10 | P a g e
Crimping Tools
Now that the wires are in the correct order, hold the RJ-45 connector next to the cable, as shown
below, to determine how much wire needs to be cut off, as shown below. You'll want to make
the cut so that the ends of the wires line up evenly. The proper length can be determined by
looking at the cable's outer insulation. The insulation should stop just inside of the RJ-45
connector. It's better to make a series of small cuts to determine the appropriate cable length than
to try to get it exactly right on the first cut. Test-fit the RJ-45 connector between each cut. If you
try to get the length exactly right on the first cut, you risk cutting the wires too short. The easiest
way to slide the RJ-45 connector onto the cable is to use your thumb to apply pressure to the
cable in the spot where the wires are first exposed from beneath the insulation. This will help
11 | P a g e
keep the wires in order. When the cable is finally cut to the correct length, you should check a
few things before crimping the cable. First, make sure the wires go all the way to the end of the
RJ-45 connector. The easiest way to do this is to look at the end of the connector and make sure
you see copper in each wire slot. You should also verify that the wires are still in the correct
order. It's easy for the wires to get out of order when installing the cable end. A quick check at
this point will keep you from having to cut the cable end off and starting over later. Assuming
the wires are in order, you can go ahead and crimp the cable. When you've finished crimping
both cable ends, you can use a cable tester to verify that the ends were installed correctly.
Your Task:
Using one meter CAT6 cable develop either cross-over or a straight cable, test and verify it.
Exercise:
Lab-3
Overview of IP Addressing and sub-netting, static ip setting on Linux machine, testing.
Objective(s):
To understand IP address setting and testing in Linux machine (Ubuntu) Apparatus: Linux OS
(Ubuntu) on virtual machine Background: If definitions are helpful to you, use these vocabulary
terms to get you started:
IPv4 address: a 32-bit number, usually written in dotted decimal form, that uniquely identifies
an interface of some computer
Network: a group of hosts, all of which have an identical beginning position of their ip
addresses.
Network Number: a 32-bit number that represent a network and it can't be assigned as ip
address of a host
12 | P a g e
Broadcast address: a 32-bit number that is used to address all hosts in the network. It can't be
assigned as an ip address of a host.
Subnet: a group of hosts, all of which have an identical portion of their ip addresses, a subnet
differs from a network in that a subnet is a further subdivision of a network.
Subnet number: a 32-bit number that represent a subnet. It can't be assigned as ip address of
host.
Subnet broadcast address: a 32-bit number that is used to address all hosts in the subnet. It
can't be assigned into a host’s IP address.
Subnet mask: A 32-bit combination used to describe which portion of an address refers to the
subnet and which part refers to the host.
Network mask: 32-bit number. The mask is used by computers to calculate the network
number of a given IP address by performing a Boolean AND operation of the address and mask.
Address mask: another term for a mask
0 1 0 0 0 0 0 1 0 64 0 0 0 0 0 1 (0+64+0+0+0+0+0+1=65)
And this sample shows an IP address represented in both binary and decimal.
13 | P a g e
00001010.00000001.00010111.00010011 (binary)
These octets are broken down to provide an addressing scheme that can accommodate large and
small networks. There are five different classes of networks, A to E. This document focuses on
addressing classes A to C, since classes D and E are reserved and discussion of them is beyond
the scope of this document. Note: Also note that the terms "Class A, Class B" and so on are used
in this document to help facilitate the understanding of IP addressing and subnetting. These
terms are rarely used in the industry anymore because of the introduction of Variable Length
Subnet Masking (VLSM) & Classless Inter-Domain Routing (CIDR). IP address classes Given
an IP address, its class can be determined from the three high-order bits. Figure 1 shows the
significance in the three high order bits and the range of addresses that fall into each class. For
informational purposes, Class D and Class E addresses are also shown. In a Class A address, the
first octet is the network portion, so the Class A example in Figure 1 has a major network
address of 10. Octets 2, 3, and 4 (the next 24 bits) are for the network manager to divide into
subnets and hosts as he/she sees fit. Class A addresses are used for networks that have more than
65,536 hosts (actually, up to 16777214 hosts!). In a Class B address, the first two octets are the
network portion, so the Class B example in Figure 1 has a major network address of 172.16.
Octets 3 and 4 (16 bits) are for local subnets and hosts. Class B addresses is used for networks
that have between 256 and 65534 hosts. In a Class C address, the first three octets are the
network portion. The Class C example in Figure 1 has a major network address of 193.18.9.
Octet 4 (8 bits) is for local subnets and hosts - perfect for networks with less than 254 hosts.
Bit-wise representation
In the following bit-wise representation,
Class A
0. 0. 0. 0 = 00000000.00000000.00000000.00000000
127.255.255.255 = 01111111.11111111.11111111.11111111
0nnnnnnn.HHHHHHHH.HHHHHHHH.HHHHHHHH
Class B
128. 0. 0. 0 = 10000000.00000000.00000000.00000000
191.255.255.255 = 10111111.11111111.11111111.11111111
10nnnnnn.nnnnnnnn.HHHHHHHH.HHHHHHHH
Class C
14 | P a g e
192. 0. 0. 0 = 11000000.00000000.00000000.00000000
223.255.255.255 = 11011111.11111111.11111111.11111111
110nnnnn.nnnnnnnn.nnnnnnnn.HHHHHHHH
Class D
224. 0. 0. 0 = 11100000.00000000.00000000.00000000
239.255.255.255 = 11101111.11111111.11111111.11111111
1110XXXX.XXXXXXXX.XXXXXXXX.XXXXXXXX
Class E
240. 0. 0. 0 = 11110000.00000000.00000000.00000000
255.255.255.255 = 11111111.11111111.11111111.11111111
1111XXXX.XXXXXXXX.XXXXXXXX.XXXXXXXX
Network Masks A network mask helps you know which portion of the address identifies the
network and which portion of the address identifies the node. Class A, B, and C networks have
default masks, also known as natural masks, as shown here: Class A: 255.0.0.0 Class B:
255.255.0.0 Class C: 255.255.255.0 An IP address on a Class A network that has not been
subnetted would have an address/mask pair similar to: 8.20.15.1 255.0.0.0. To see how the mask
helps you identify the network and node parts of the address, convert the address and mask to
binary numbers.
15 | P a g e
Each data link on a network must have a unique network ID, with every node on that link being a
member of the same network. If you break a major network (Class A, B, or C) into smaller
subnetworks, it allows you to create a network of interconnecting subnetworks. Each data link on
this network would then have a unique network/subnetwork ID. Any device, or gateway,
connecting n networks/subnetworks has n distinct IP addresses, one for each network /
subnetwork that it interconnects. In order to subnet a network, extend the natural mask using
some of the bits from the host ID portion of the address to create a subnetwork ID. For example,
given a Class C network of 204.17.5.0 which has a natural mask of 255.255.255.0, you can
create subnets in this manner: 204.17.5.0 - 11001100.00010001.00000101.00000000
255.255.255.224 - 11111111.11111111.11111111.11100000
--------------------------|sub|----
By extending the mask to be 255.255.255.224, you have taken three bits (indicated by "sub")
from the original host portion of the address and used them to make subnets. With these three
bits, it is possible to create eight subnets. With the remaining five host ID bits, each subnet can
have up to 32 host addresses, 30 of which can actually be assigned to a device since host ids of
all zeros or all ones are not allowed (it is very important to remember this). So, with this in mind,
these subnets have been created.
Note: There are two ways to denote these masks. First, since you are using three bits more than
the "natural" Class C mask, you can denote these addresses as having a 3-bit subnet mask. Or,
secondly, the mask of 255.255.255.224 can also be denoted as /27 as there are 27 bits that are set
in the mask. This second method is used with CIDR. Using this method, one of these networks
can be described with the notation prefix/length. For example, 204.17.5.32/27 denotes the
network 204.17.5.32 255.255.255.224. The network sub-netting scheme in this section allows for
eight subnets, and the network might appear as:
16 | P a g e
Notice that each of the routers in Figure 2 is attached to four subnetworks, one subnetwork is
common to both routers. Also, each router has an IP address for each subnetwork to which it is
attached. Each subnetwork could potentially support up to 30 host addresses. This brings up an
interesting point. The more host bits you use for a subnet mask, the more subnets you have
available. However, the more subnets available, the less host addresses available per subnet. For
example, a Class C network of 204.17.5.0 and a mask of 255.255.255.224 (/27) allows you to
have eight subnets, each with 32 host addresses (30 of which could be assigned to devices). If
you use a mask of 255.255.255.240 (/28), the break down is: 204.17.5.0 -
11001100.00010001.00000101.00000000 255.255.255.240 -
11111111.11111111.11111111.11110000 --------------------------|
sub |--- Since you now have four bits to make subnets with, you only have four bits left for host
addresses. So in this case you can have up to 16 subnets, each of which can have up to 16 host
addresses (14 of which can be assigned to devices). Take a look at how a Class B network might
be subnetted. If you have network 172.16.0.0, then you know that its natural mask is 255.255.0.0
or 172.16.0.0/16. Extending the mask to anything beyond 255.255.0.0 means you are subnetting.
You can quickly see that you have the ability to create a lot more subnets than with the Class C
network. If you use a mask of 255.255.248.0 (/21), how many subnets and hosts per subnet does
this allow for? 172.16.0.0 - 10101100.00010000.00000000.00000000 255.255.248.0 -
11111111.11111111.11111000.00000000
-----------------|sub|--------
You are using five bits from the original host bits for subnets. This allows you to have 32 subnets
(25). After using the five bits for subnetting, you are left with 11 bits for host addresses. This
allows each subnet so have 2048 host addresses (211), 2046 of which could be assigned to
devices. Note: In the past, there were limitations to the use of a subnet 0 (all subnet bits are set to
zero) and all ones subnet (all subnet bits set to one). Some devices would not allow the use of
these subnets. Cisco Systems devices allow the use of these subnets when the ip subnet zero
command is configured.
Examples
17 | P a g e
Given the network number and a mask, how many subnets are there and how many h osts per
subnet.
Given an address and mask, what is the subnet broadcast address and valid ip address on the
subnet
Sample Exercise
1 Now that you have an understanding of subnetting, put this knowledge to use. In this example,
you are given two address / mask combinations, written with the prefix/length notation, which
have been assigned to two devices. Your task is to determine if these devices are on the same
subnet or different subnets. You can do this by using the address and mask of each device to
determine to which subnet each address belongs.
Device A: 172.16.17.30/20
Device B: 172.16.28.15/20
-----------------| sub|------------
18 | P a g e
subnet = 10101100.00010000.00010000.00000000 = 172.16.16.0 Looking at the address
bits that have a corresponding mask bit set to one, and setting all the other address bits to zero
(this is equivalent to performing a logical "AND" between the mask and address), shows you to
which subnet this address belongs. In this case, Device A belongs to subnet 172.16.16.0
Sample Exercise
2 Given the Class C network of 204.15.5.0/24, subnet the network in order to create the network
in Figure 3 with the host requirements shown.
Looking at the network shown in Figure 3, you can see that you are required to create five
subnets. The largest subnet must support 28 host addresses. Is this possible with a Class C
network? And if so, then how? You can start by looking at the subnet requirement. In order to
create the five needed subnets you would need to use three bits from the Class C host bits. Two
bits would only allow you four subnets (22). Since you need three subnet bits, that leaves you
with five bits for the host portion of the address. How many hosts does this support? 25 = 32 (30
usable). This meets the requirement. Therefore you have determined that it is possible to create
this network with a Class C network.
19 | P a g e
net E: 204.15.5.128/27 host address range 129 to 158
20 | P a g e
21 | P a g e
22 | P a g e
***IP Address Setting on UBUNTU/Linux Temporary IP Address Assignment For temporary
network configurations, you can use standard commands such as ip, ifconfig and route, which
are also found on most other GNU/Linux operating systems. These commands allow you to
configure settings which take effect immediately, however they are not persistent and will be lost
after a reboot. To temporarily configure an IP address, you can use the ifconfig command in the
following manner. Just modify the IP address and subnet mask to match your network
requirements.
To verify the IP address configuration of eth0, you can use the ifconfig command in the
following manner.
#ifconfig eth0
Interrupt:16
To configure a default gateway, you can use the route command in the following manner.
Modify the default gateway address to match your network requirements.
To verify your default gateway configuration, you can use the route command in the following
manner.
#route -n
23 | P a g e
If you require DNS for your temporary network configuration, you can add DNS server IP
addresses in the file /etc/resolv.conf. In general, editing /etc/resolv.conf directly is not
recommanded, but this is a temporary and nonpersistent configuration. The example below
shows how to enter two DNS servers to /etc/resolv.conf, which should be changed to servers
appropriate for your network. A more lengthy description of the proper persistent way to do DNS
client configuration is in a following section.
nameserver 8.8.8.8
nameserver 8.8.4.4
If you no longer need this configuration and wish to purge all IP configuration from an interface,
you can use the ip command with the flush option as shown below.
Flushing the IP configuration using the ip command does not clear the contents of
/etc/resolv.conf.
You must remove or modify those entries manually, or re-boot which should also cause
/etc/resolv.conf, which is actually now a symlink to /run/resolvconf/resolv.conf, to be re-written.
To configure your server to use DHCP for dynamic address assignment, add the dhcp method to
the inet address family statement for the appropriate interface in the file /etc/network/interfaces.
The example below assumes you are configuring your first Ethernet interface identified as eth0.
#auto eth0
By adding an interface configuration as shown above, you can manually enable the interface
through the ifup command which initiates the DHCP process via dhclient.
To manually disable the interface, you can use the ifdown command, which in turn will initiate
the DHCP release process and shut down the interface.
24 | P a g e
Static IP Address Assignment
To configure your system to use a static IP address assignment, add the static method to the inet
address family statement for the appropriate interface in the file /etc/network/interfaces. The
example below assumes you are configuring your first Ethernet interface identified as eth0.
Change the address, netmask, and gateway values to meet the requirements of your network.
auto eth0
address 10.0.0.100
netmask 255.255.255.0
gateway 10.0.0.1
By adding an interface configuration as shown above, you can manually enable the interface
through the ifup command.
# sudo ifup eth0 To manually disable the interface, you can use the if down command.
Your Task: set IPv4 address at your VM and test by pinging to your friend’s machine.
Exercise:
1. Create your own DHCP server and put the ip range (10.200.100.10-10.200.10.90) in the pool.
2. What is IPv6 address? What are its features? 3. Discuss IPv6 addresses and its types. 4. How
do you set IPv6 address on your Linux machine? Explain
25 | P a g e
Objective :
Use variable-length subnet mask (VLSM) to support more efficient use of the assigned IP
addresses and to reduce the amount of routing information at the top level.
Background/Preparation
To calculate VLSM subnets and the respective hosts allocate the largest requirements first from
the address range. Requirements levels should be listed from the largest to the smallest. In this
example Perth requires 60 hosts. Use 6 bits since 26 – 2 = 62 usable host addresses. Thus 2 bits
will be used from the 4th octet to represent the extended-network-prefix of /26 and the remaining
6 bits will be used for host addresses.
Step 1 The first step in the subnetting process is to divide the allocated address of
192.168.10.0/24 into four equal size address blocks. Since 4 = 22, 2 bits are required to identify
each of the 4 subnets. Next, take subnet #0 (192.168.10.0/26) and identify each of its hosts.
26 | P a g e
Step 2
Allocate the next level after all the requirements are met for the higher level or levels. Kuala
Lumpur requires 28 hosts. The next available address after 192.168.10.63/26 is
192.168.10.64/26. Note from the above table that this is subnet number 1. Since 28 hosts are
required, 5 bits will be needed for the host addresses, 25 –2 = 30 usable host addresses. Thus 5
bits will be required to represent the hosts and 3 bits will be used to represent the extended-
networkprefix of /27. Applying VLSM on address 192.168.10.64/26 gives:
27 | P a g e
Step 3
Now Sydney and Singapore require 12 hosts each. The next available address starts from
192.168.10.96/27. Note from Table 2 that this is the next subnet available. Since 12 hosts are
required, 4 bits will be needed for the host addresses, 24 = 16, 16 – 2 = 14 usable addresses.
Thus 4 bits are required to represent the hosts and 4 bits for the extended-network-prefix of /28.
Applying VLSM on address 192.168.10.96/27 gives:
28 | P a g e
Step 4
Since Singapore also requires 12 hosts, the next set of host addresses can be derived from the
next available subnet (192.168.10.112/28).
29 | P a g e
Step 5
Now allocate addresses for the WAN links. Remember that each WAN link will require two IP
addresses. The next available subnet is 192.168.10.128/28. Since 2 network addresses are
required for each WAN link, 2 bits will be needed for host addresses, 22 –2 = 2 usable addresses.
Thus 2 bits are required to represent the links and 6 bits for the extended-network-prefix of /30.
Applying VLSM on 192.168.10.128/28 gives.
30 | P a g e
Lab-4
Linux OS (Ubuntu/CentOS) installation, practice on basic Linux commands and Networking
commands (ifconfig, tcpdump, netstat, dnsip, hostname, route...)
Objective(s):
To understand basic command line operation with Linux operating system and network
configuration, testing and verification. Apparatus: Oracle virtual box, or VMware Workstation,
Ubuntu or CentOS disk images Basic Linux Commands.
31 | P a g e
32 | P a g e
To Start vi
To use vi on a file, type in vi filename. If the file named exists, then the first page (or screen) of
the file will be displayed; if the file does not exist, then an empty file and screen are created into
which you may enter text.
33 | P a g e
Exercise:
34 | P a g e
Lab -5
Introduction to Packet Tracer, creating of a LAN and connectivity test in the LAN, creation of
VLAN and VLAN trunking.
Objective(s):
To understand LAN networking, creation of VLAN, IP addressing in the VLAN and VLAN
Trunk.
Background :
Packet Tracer is a powerful network simulator that can be utilized in training for network
certification like and learning by allowing students to create networks with an almost unlimited
number of devices and to experience troubleshooting without having to buy real Cisco routers or
switches. The tool is created by Cisco Systems. The purpose of Packet Tracer is to offer students
a tool to learn the principles of networking. Packet tracer allows us to create network by just
dragging and dropping devices and connection to specific port of the devices so that necessary
configuration shall be performed on each device and test as per the requirement. Group of
computers are connected to switch and are assigned ip addresses of same network in which each
computer in the network are directly reachable. These interconnected group of computers and its
infrastructure is called Local Area Network (LAN). A switch, suppose having 48 ports can be
divided into different switches like 3 switches of each 16 ports or 4 switches of each 12 ports. It
means virtually a single switch or switches are grouped with respect to multiple virtual switch
where one virtual switch shall form a LAN is called Virtual LAN (VLAN) (Packet tracer
overview and LAN topology creation credits on this lab: Rick Graziani) Definition: 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.
Step 2: Choosing Devices and Connections We will begin building our network topology by
selecting devices and the media in which to connect them. Several types of devices and network
connections can be used. For this lab we will keep it simple by using End Devices, Switches,
Hubs, and Connections. Single click on each group of devices and connections to display the
various choices. The devices you see may differ slightly.
35 | P a g e
36 | P a g e
37 | P a g e
Perform the following steps to connect PC2 to Switch0:
2. Choose FastEthernet
38 | P a g e
3. Drag the cursor to Switch0
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 a about 30 seconds the amber light will change to green indicating that the port has
entered the forwarding stage. Frames can now forwarded out the switch port.
39 | P a g e
# Creating A VLAN --
Procedure: Step 1: This experiment we complete using Packet tracer simulation software.
First we have to take two switch(2960), Cross/ straight through cable & PC. After proper connect
the connection than we should configure the switch for VLAN.
Switch1:
Switch>
Switch>en
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 2
40 | P a g e
Switch(config-vlan)#name IT
Switch(config-vlan)#exit
Switch(config)#vl
Switch(config)#vlan 3
Switch(config-vlan)#name HR
Switch(config-vlan)#exit
Switch(config)#exit
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#switchport access vlan 2
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/2
Switch(config-if)#switchport access vlan 2
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/3
Switch(config-if)#switchport access vlan 3
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/4
Switch(config-if)#switchport access vlan 3
Switch(config-if)#exit
Switch(config)#exit
Switch(config)#interface fastEthernet 0/5
Switch(config-if)#switchport mode trunk
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state
to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state
to up
Switch(config-if)#exit
Switch(config)#interface range fastEthernet 0/1 -4
Switch(config-if-range)#exit
41 | P a g e
Switch(config)#
Switch2:
Switch>
Switch>en
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 2
Switch(config-vlan)#na
Switch(config-vlan)#name IT
Switch(config-vlan)#exit
Switch(config)#vl
Switch(config)#vlan 3
Switch(config-vlan)#name HR
Switch(config-vlan)#exit
Switch(config)#exit
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#switchport access vlan 2
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/2
Switch(config-if)#switchport access vlan 2
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/3
Switch(config-if)#switchport access vlan 3
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/4
Switch(config-if)#switchport access vlan 3
Switch(config-if)#exit
Switch(config)#exit
Switch(config)#interface fastEthernet 0/5
42 | P a g e
Switch(config-if)#switchport mode trunk
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state
to down
Switch(config-if)#exit
Switch(config)#interface range fastEthernet 0/1 -4
Switch(config-if-range)#exit
Switch(config)#
Testing and verification : When we send message through VLAN 2 to VLAN 3 the message
has failed though same switch but VLAN 2 to VLAN 2 & VLAN 3 to VLAN 3 message has
successfully send.
When we ping from VLAN 2 to VLAN 3 pc they can't reply but VLAN2 to
VLAN2 & VLAN3 to VLAN3 reply .
43 | P a g e
Conclusion: VLAN2 network 192.168.10.0 & VLAN3 Network 192.168.11.0
When we ping from VLAN 2 to VLAN 3 pc they can't reply but VLAN2 to
VLAN2 & VLAN3 to VLAN3 reply though VLAN2 & VLAN 3 live in same
switch.
44 | P a g e
Lab-06
Deliverables: - Design the network connectivity diagram (using VISIO) of the Campus network
showing the physical connection status. - report the logical address distribution status. -
summarize the knowledge what you gain in the field visit. - comment if any for the efficient
design of the campus network.
Lab-07
Basic Router Configuration, Static Routing Implementation
Objective(s)
Background Static routing is useful in small network where numbers of routes are limited. In
static routing we need to add route manually with IP route command. Like other routing methods
static routing also has its pros and cons. Advantage of static routing It is easy to implement.
It is most secure way of routing, since no information is shared with other routers. It puts no
overhead on resources such as CPU or memory.
1. Configure the Computer terminal software The terminal software in not correctly configured
on the laptop. You have to change the settings to 9600 / 8 / None to connect to the router's
console.
45 | P a g e
PC properties
46 | P a g e
2. Configure the router's name
Router(config)#hostname CAMPUSGW
3. Configure the enable password and secret to "cisco" CAMPUSGW (config)#enable password
cisco CAMPUSGW (config)#enable secret cisco 4. Configure password encryption for this
router CAMPUSGW (config)#service password-encryption 5. Configure the console access
CAMPUSGW (config)#line console 0 CAMPUSGW (config-line)#password cisco
CAMPUSGW (config-line)#login CAMPUSGW (config-line)#logging synchronous
CAMPUSGW (config-line)#exec-timeout 2 45 CAMPUSGW (config-line)#history size 10
1. Consider the following diagram and assign IP address to the corresponding interfaces as
follows: Device Connected from Connected to IP Address PC0 FastEthernet0 Router0's
FastEthernet0/0 10.0.0.2/8 Router0 FastEthernet0/0 PC0's FastEthernet0 10.0.0.1/8 Router0
Serial 0/0/0
47 | P a g e
Router1 Serial 0/0/0/ Router0's serial0/0/0 192.168.0.254/30 Router1 FastEthernet0/0 PC1's
FastEthernet0 20.0.0.1/8 PC1 FastEthernet0 Router1's FastEthernet0/0 20.0.0.2/8
2. Assign IP address to each PC 3. Assign IP address to interfaces of router Double click Router0
and click CLI and press Enter key to access command prompt of router. Two interfaces
FastEthernet0/0 and Serial0/0/0 of Router0 are used in this topology. By default interfaces on
router are remain administratively down during the start up. We need to configure IP address and
other parameters on interfaces before we could actually use them for routing. Interface mode is
used to assign IP address and other parameters. Interface mode can be accessed from global
configuration mode. Following commands are used to access global configuration mode.
Router>enable
Router#configure terminal //Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# From global configuration mode we can enter in interface mode. From there we
can configure the interface. Following commands will assign IP address on FastEthernet0/0.
Router(config-if)#no shutdown
Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface serial 0/0/0
Router(config-if)#bandwidth 64
Router(config-if)#no shutdown
Router(config-if)#exit
48 | P a g e
Router#configure terminal //Command is used to enter in global configuration mode.
Router(config)#interface serial 0/0/0 //Command is used to enter in interface mode.
Router(config-if)#ip address 192.168.0.253 255.255.255.252 //Command assigns IP address to
interface. For serial link we usually use IP address from /30 subnet.
Router>enable
Router#configure terminal
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config-if)#no shutdown
Router(config-if)#exit
IP route command is used to configure the static route. In this section we will explain static route
command in detail. We have two commands to configure the static route.
49 | P a g e
destination_network_#[subnet_mask]: This is the first parameter. It specifies the destination
network address. We need to provide subnet mask if we are using sub-network. Sub-networks
are the smaller network created from one large network in subnetting. If we are not using sub-
network then we can omit the subnet mask value. It will parse automatically.
IP_address_of_next_hop_neighbor / interface_to_exit : This parameter provides a way to reach
the destination network. Both commands use separate way to assign this value. First command
provides the IP address of next hop neighbor. It tells router that if it receives a packet for
destination [that we set in previous parameter], forward that packet to this next hop neighbor IP
address. Second command also do the same job but in different way. It specifies exit interface
instead of next hop IP address. It tells router that if it receives a packet for the destination
specified by previous parameter then exits that packet from this interface. Device attached on
other end of this interface will take care of the packet. administrative_distance Administrative
distance is the trustworthiness of route. Route with the lowest AD value will be chosen while
forwarding the packet. By default static route has two AD values depending on the previous
parameter. If you have used next hop neighbor IP address, then the default AD value will be 1. If
you have used exit interface, then the default AD value will be 0. This parameter allows us to
create multiple static routes for the same destination. For example we can create primary and
backup path for the destination network. To create backup path, we need to set AD value to
higher than default, such as 2 or 3. With this configuration router will use primary path. Due to
some reason if primary route fails, the router will start using backup route automatically.
permanent When a route goes down router will remove that from routing table. Permanent
parameter will keep this route in routing table even if it goes down. Its optional parameter we can
omit it. If we omit it, router will remove this route from routing table if it goes down. You might
use this parameter for security reason if you never want packets to take another path. Configure
Default Route By default when a packet arrives in interface, router checks destination filed in
packet and compare it with routing table. If it finds a match for destination network then it will
forward that packet from related interface. If it does not find a match in routing table then it will
discard that packet. This is the default behavior of router. Default route allows us to override this
behavior. Default route is a way to deal with all unmatched packets. If no match for destination
network found in routing table then it would be forwarded to the default route.
50 | P a g e
Router0 Router(config)#ip route 20.0.0.0 255.0.0.0 192.168.0.254 Router1 Router(config)#ip
route 10.0.0.0 255.0.0.0 192.168.0.253 That's all we need to switch packet from one network to
another. To verify the result we can use ping command. Access the command prompt of PC1 and
use ping command to test the connectivity from PC0. Your Task: consider the following diagram
with IP address assignment, configure static routing and show the ping result between PC0 and
PC4, PC1 and PC5.
Exercise: 1. What is adaptive and non-adaptive routing? Unicast and multicast routing? Distance
vector and link state routing? 2. What are routed and routing protocols? 3. Discuss VLSM with
example. Also explain the CIDR with example.
Lab-08
Objective(s): Understand the basic operation(s) of dynamic interior and exterior routing
protocols.
Background: Distance Vector Routing: Distance vector protocols (a vector contains both
distance and direction), such as RIP, determine the path to remote networks using hop count as
the metric. A hop count is defined as the number of times a packet needs to pass through a router
to reach a remote destination. For IP RIP, the maximum hop is 15. A hop count of 16 indicates
an unreachable network. Two versions of RIP exist: version 1 and version 2. IGRP is another
51 | P a g e
example of a distance vector protocol with a higher hop count of 255 hops. A higher hop counts
allows your network to scale larger. One of the drawbacks of protocols, such as RIP and IGRP, is
convergence time, which is the time it takes for routing information changes to propagate
through all your topology. Table 2-2 describes the characteristics of distance vector protocols.
The name distance vector is derived from the fact that routes are advertised as vectors of
(distance, direction), where distance is defined in terms of a metric and direction is defined in
terms of the next-hop router. For example, "Destination A is a distance of 5 hops away, in the
direction of next-hop router X." As that statement implies, each router learns routes from its
neighboring routers' perspectives and then advertises the routes from its own perspective.
Because each router depends on its neighbors for information, which the neighbors in turn may
have learned from their neighbors, and so on, distance vector routing is sometimes facetiously
referred to as "routing by rumor."
Common Characteristics A typical distance vector routing protocol uses a routing algorithm in
which routers periodically send routing updates to all neighbors by broadcasting their entire
route tables. The preceding statement contains a lot of information. Following sections consider
it in more detail. Periodic Updates Periodic updates means that at the end of a certain time
period, updates will be transmitted. This period typically ranges from 10 seconds for AppleTalk's
RTMP to 90 seconds for Cisco's IGRP. At issue here is the fact that if updates are sent too
frequently, congestion may occur; if updates are sent too infrequently, convergence time may be
unacceptably high. Neighbors In the context of routers, neighbors always means routers sharing
a common data link. A distance vector routing protocol sends its updates to neighboring routers4
and depends on them to pass the update information along to their neighbors. For this reason,
distance vector routing is said to use hop-by-hop updates. Broadcast Updates When a router first
becomes active on a network, how does it find other routers and how does it announce its own
presence? Several methods are available. The simplest is to send the updates to the broadcast
address (in the case of IP, 255.255.255.255). Neighboring routers speaking the same routing
protocol will hear the broadcasts and take appropriate action. Hosts and other devices
uninterested in the routing updates will simply drop the packets. Full Routing Table Updates
Most distance vector routing protocols take the very simple approach of telling their neighbors
everything they know by broadcasting their entire route table, with some exceptions that are
covered in following sections. Neighbors receiving these updates glean the information they
need and discard everything else.
Characteristic Description Periodic updates Periodic updates are sent at a set interval. For IP
RIP, this interval is 30 seconds. Broadcast updates Updates are sent to the broadcast address
255.255.255.255. Only devices running routing algorithms listen to these updates. Full table
updates When an update is sent, the entire routing table is sent. Triggered updates Also known
as Flash updates, these are sent when a change occurs outside the update interval. Split horizon
You use this method to stop routing loops. Updates are not sent out an outgoing interface from
which the source network was received. This saves on bandwidth as well. Count to infinity This
52 | P a g e
is the maximum hop count. For RIP, it is 15 and for IGRP, it is 255. Algorithm One algorithm
example is Bellman-Ford for RIP. Examples RIP and IGRP are examples of distance vector
protocols.
Bellman-Ford Algorithm The Bellman-Ford Algorithm computes the cost of the cheapest paths
from a starting node to all other nodes in the graph. Thus, he can also construct the paths
afterwards. The algorithm proceeds in an interactive manner, by beginning with a bad estimate of
the cost and then improving it until the correct value is found.
The first estimate is: The starting node has cost 0, as his distance to itself is obviously 0.
All other node have cost infinity, which is the worst estimate possible. Afterwards, the
algorithm checks every edge for the following condition: Are the cost of the source of the edge
plus the cost for using the edge smaller than the cost of the edge's target? If this is the case, we
have found a short-cut: It is more profitable to use the edge which was just checked, than using
the path used so far. Therefore the cost of the edge's target get updated: They are set to the cost
of the source plus the cost for using the edge (compare example on the right). Looking at all
edges of the graph and updating the cost of the nodes is called a phase. Unfortunately, it is not
sufficient to look at all edges only once. After the first phase, the cost of all nodes for which the
shortest path only uses one edge have been calculated correctly. After two phases all paths that
use at most two edges have been computed correctly, and so on.
The green path from the starting node is the cheapest path. It uses 3 edges.
How many phases ware necessary? To answer this question, the observation that a shortest path
has to use less edges than there are nodes in the graph. Thus, we need at most one phase less than
the number of nodes in the graph. A shortest path that uses more edges than the number of nodes
would visit some node twice and thus build a circle.
Construction of the shortest path Each time when updating the cost of some node, the algorithm
saves the edge that was used for the update as the predecessor of the node.
At the end of the algorithm, the shortest path to each node can be constructed by going
backwards using the predecessor edges until the starting node is reached.
53 | P a g e
A cheapest path had to use this circle infinitely often. The cost would be reduced in each
iteration. If the graph contains a circle with a negative sum of edge weights – a Negative Circle,
the algorithm probably will not find a cheapest path. As can be seen in the example on the right,
paths in this case can be infinitely cheap – one keeps on going through the circle. This problem
occurs if the negative circle can be reached from the starting node. Luckily, the algorithm can
detect whether a negative circle exists. This is checked in the last step of the algorithm. A
negative circle can be reached if and only if after iterating all phases, one can still find a short-
cut. Therefore, at the end the algorithm checks one more time for all edges whether the cost of
the source node plus the cost of the edge are less than the cost of the target node. If this is the
case for an edge, the message "Negative Circle found" is returned. One can even find the
negative circle with the help of the predecessor edges: One just goes back until one traversed a
circle (that had negative weight). Link-state Routing: Link-state routing protocols, such as OSPF
and IS-IS, create a topology of the network and place themselves at the root of the tree. Link-
state protocols implement an algorithm called the shortest path first (SPF, also known as
Dijkstra's Algorithm) to determine the path to a remote destination. There is no hop count limit.
(For an IP datagram, the maximum time to live ensures that loops are avoided.) Hello packets are
used to discover neighboring routers, so when changes occur updates can be sent immediately.
Hello packets are used to establish and maintain neighbors. OSPF uses the Class D multicast
addresses in the range 224.0.0.0 through 239.255.255.255. The two most important reserved
addresses are 224.0.0.5 for all OSPF routers and 224.0.0.6 for all DRs and BDRs. Any new
OSPF-enabled routers immediately transmit a multicast Hello packet by using the OSPF routers
multicast address of 224.0.0.5. DRs use the multicast address 224.0.0.6 to send updates to all
other OSPF routers. Therefore, two reserved multicast addresses are vital for maintaining OSPF
adjacencies across any broadcast media, such as Ethernet or Token Ring. The OSPF database is
populated with link-state advertisements (LSAs) from neighboring routers. The LSA packets
contain information, such as cost and the advertising router or the router ID, which is the highest
IP address configured on the local router. Typically, OSPF administrators configure loopback
interfaces to ensure that the OSPF process is not prone to failures.
54 | P a g e
OSPF is a link-state routing protocol, as we’ve said. Think of this as a distributed map of the
network. To get this information distributed, OSPF does three things. First, when a router
running OSPF comes up it will send hello packets to discover its neighbors and elect a
designated router. The hello packet includes link-state information, as well as a list of neighbors.
Providing information about your neighbor to that neighbor serves as an ACK, and proves that
communication is bi-directional. OSPF is smart about the layer 2 topology: if you’re on a point-
to-point link, it knows that this is enough, and the link is considered “up.” If you’re on a
broadcast link, the router must wait for an election before deciding if the link is operational. The
election ballot can be stuffed, with a Priority ID, so that you can ensure that your beefiest router
is the DR. Otherwise, the largest IP address wins. The key idea with a DR and backup DR
(BDR) is that they are the ones to generate LSAs, and they must do database exchanges with
other routers in the subnet. So, non-designated routers form adjacencies with the DR. The whole
DR/BDR design is used to keep the protocol scalable. The only way to ensure that all routers
have the same information is to make them synchronize their databases. If you have 21 routers,
and want to bring another one up, then you’d have to form 21 new adjacencies. If you centralize
the database, with a backup (just in case), then adding more becomes an easy to manage linear
problem. The database exchange is part of bringing up adjacencies after the hello packets are
exchanged, and it’s very important. If the databases are out of sync, we could risk routing loops,
black holes and other perils. The third part of bringing up an adjacency is Reliable Flooding, or
LSA exchange.
55 | P a g e
The details of an LSA, as well as a more advanced discussion of areas will be the topic of the
next Networking 101. For now, just know that area zero is special, and if you have multiple
areas, they must all touch area zero. This is also called the Backbone Area. There are different
types of areas in OSPF, and it can get really crazy when you throw in Virtual Links to allow two
areas to speak without hitting area zero. Alas, there also are different types of routers in OSPF.
ABR An Area Border Router is a router that is in area zero, and one or more other areas. DR,
BDR A Designated Router, as we said, is the router that keeps the database for the subnet. It
sends and receives updates (via multicast) from the other routers in the same network. ASBR
The Autonomous System Boundary Router is very special, but confusing. The ASBR connects
one or more AS, and exchanges routes between them. The ASBR’s purpose is to redistribute
routes from another AS into its own AS. The concept of redistribution finally rears its head: let’s
say we have a router, an internal-only router (not a BR), and we wish to connect it to a new
network that we don’t control. After this connection is made, we have a few options. We can fire
up a non-IGP routing protocol, like BGP, to exchange routes. Alternatively, we could decide that
a summary route is good enough, and hard-code a static route to the new network in this router.
Anything directly using this router for this destination would be able to get to the new network,
but OSPF doesn’t know about it. To make that happen, we ‘redistribute” the miscellaneous
information into OSPF. We wouldn’t want to feed 200K+ routes from BGP into OSPF, but if we
went the static route, we’d definitely want to propagate that information so everyone in our AS
could get to the new place. As soon as we tell our internal router that it should redistribute static
routes into OSPF, it becomes an ASBR, and the entire network can reach the new network.
Consider the following topology with IP address distribution, test the connectivity between Pc0
and PC1.
56 | P a g e
57 | P a g e
58 | P a g e
Lab-09
Objective(s): Understand the router firewall: Access Control Lists (ACLs). Background: Packet
filtering at the network level can be achieved by applying the Access Control Lists (ACLs)1 at
the router called router firewall. ACLs at the router filter the inbound traffic while it permit or
deny packets based on source IP/network and destination IP/network, IP, TCP,UDP protocol
information. Generally we use the ACLs to provide a basic level of security for accessing our
network. Access lists can allow one host to access a part of network and prevent another host
from accessing the same area. A standard ACL can be used for several purpose. In this lab we
will see how it can be used in controlling the unwanted network traffic. With standard ACL, we
can define certain conditions for the network traffic passing through the router. By default router
does not filter any traffic unless we manually put an ACL. There are two types of ACLs:
1. Standard ACL: permits or denies packets based on source and destination IP address and also
based on IP protocol information. Valid ACL ID range is: 1 - 99 or a string. Standard ACL shall
be created in three ways viz. i) Classic Numbered ii) Modern Numbered iii) Modern Named This
lab tutorial presents the creation of all three Standard ACLs. 2. Extended ACL: it permits or
denies packets based on source and destination IP address and also based on IP protocol
information. Valid Extended ACL ID range is: 100 - 199 or a string.
When creating an access list, we define criteria that are applied to each packet that is processed
by the router; the router decides whether to forward or block each packet on the basis of whether
or not the packet matches the criteria. By default when a router receives a packet in interface, it
takes following actions:
59 | P a g e
Tutorial Steps: Consider the case scenario as follows: IOE Pulchowk Campus network is divided
into four cluster with its own routing domain and Autonomous system Number (say: 3245). We
need to configure routers and network with the APNIC provided IP block as: 202.70.91.0/24. For
each network section a separate ACL is required. The IP block distributions are as follows (Ref:
http://www.computernetworkingnotes.com/ccna-study-guide/configure-standard-access-control-
list-step-by-stepguide.html ).
60 | P a g e
61 | P a g e
Based on the ip distribution and network topology sketched, 1) create network
topology in your packet tracer tool 2) Assign essential IP addresses as shown in
above table with given network. 3) Configure RIPv2 protocol in R1, R2 and R2 for
IP routing. The ACL requirement shall be as follows.
1. COMPLEX network section should be able to access only NCR. It should not be
able to access other networks (QUASD & CIMISH). 1. One user (PC1) from
CIMISH network section should not be able to access anything except its own
section.
2. One user (Laptop1) from CIMISH network section should be able to access all
other networks but not COMPLEX network section. (at complex acl: deny
202.70.91.150 0.0.0.0)
It is assumed that you are able to configure each device ip address in the given
network topology and also able to enable RIP practiced in previous labs that is the
pre-requisite for this lab. You are now provided with tips about how to enable ACL
in the network based on the above requirements.
62 | P a g e
Now apply the ACL in to the corresponding interfaces with inbound and outbound
settings. On router 0, in configuration mode, issue the following acl
# ip access-group 10 out
# ip access-group 20 out
#ctrl+z
#wr
63 | P a g e
Lab-10
DNS, Web, DHCP, FTP server configuration
First, let’s install the DNS server: Yum –y install bind9 //sudo-apt-get install
bind9 --for ubuntu cd /etc/bind
Add a new forward and backward lookup zone to config file. It is assuming that
the IP you want to resolve example.com site is 192.168.0.50. In real life this would
be your external IP address which is serving your website/email. We are also
creating reverse zone. Reverse zone name is created by removing the last umber
from the IP (50 in our case) and reversing the rest. Then “in-addr.arpa” is added.
So for 192.168.0.50 IP the reverse zone will be 0.168.192.in-addr.arpa. Right, let’s
go for it! Edit /etc/bind/named.conf.local (e.g. vi /etc/bind/named.conf.local) and
put this in the end of the file:
zone "example.com" {
type master;
file "/etc/bind/zones/example.com.db"; };
zone "0.168.192.in-addr.arpa" {
64 | P a g e
type master;
file "/etc/bind/zones/rev.0.168.192.in-addr.arpa";
};
Now save the file and let’s create the actual zones.
#mkdir /etc/bind/zones
#cd /etc/bind/zones
#vi example.com.db
65 | P a g e
This means that example.com, www.example.com and mail.example.com as well
as ns.example.com will resolve to the same address of 192.168.0.50. I have also
added SPF and TXT records which hold the spf mail filtering rules. It is quite
simple in fact and doesn’t require any changes on your mail server whatsoever.
The above spf lines should be rad as follows:
The remote servers upon receiving mail (if they have spf-checks implemented) will
lookup your spf records and then compare them with who actually sent them email
from “@example.com”. This ensures that no-one can send email from a forged IP
stating their FROM email address is “@example.com”. This way you ensure no
spam mail will be sent from your domain name, even from remote servers. And it
is just adding 2 lines to your DNS zone.
66 | P a g e
As the zone already tells the server it is a 192.168.0 starting IP address (from
0.168.192.in-addr.arpa domain), we only put the last number (50 in this case) of
the IP address and the corresponding reverse lookup records. You should always
have reverse zones for domains that receive and send email addresses as some mail
servers are very strict on this and might blacklist you otherwise.
That should do the trick and this DNS server should soon respond to queries to
example.com with an actual IP Now a very important step is to stop this server
from being an open DNS server. To the outside world it should only respond to
queries for domains it is configured as an authoritative server. Otherwise, anyone
can use your DNS server like opendns :/
vi /etc/bind/named.conf.options
# at the end of the file, just above the enclosure "};" which ends the options part,
insert this line
# this is assuming you want to allow all lookups from your internal network
67 | P a g e
Restart BIND and do some tests:
# if that hangs, ctrl+c the restart. Then run the below 2 commands: NMD=`ps -A |
grep named |grep -v grep |cut -d " " -f 1`; kill -9 $NMD /etc/init.d/bind9 start
# test new configuration. you should get your 192.168.0.50 dig @localhost
example.com dig @localhost -x 192.168.0.50
# configure machine to use our DNS server as the main one vi /etc/resolv.conf
# add the below line as the first nameserver entry nameserver 127.0.0.1
# save the file, no need to restart anything One final test: dig example.com dig -x
192.168.0.50
And we are done. BIND is configured and setup to serve example.com domain.
Now you should login to your DNS provider and point the name servers to your
server if you want to handle DNS resolution for your domain. If you want to have
your DNS server to actually respond you will need to open port 53 UDP and TCP
to the internet (as DNS listens on these ports). If you followed my manual on
setting up your sshdfilter and firewall, then to open port 53, do this:
68 | P a g e
Second, one or more DHCP servers respond with a DHCPOffer, which offers
configuration information for the client.
The client then broadcasts a DHCPRequest message to, by default, the nearest
DHCP server. This accepts the offered configuration information.
A DHCP client will send a DHCPRelease to relinquish its IP address and end
its lease. This request is sent to the DHCP server that issued the lease.
These clients may be new to a network or subnet, or their lease expired after being
unable to renew. The initial lease request follows this process:
2. If the client succeeds in finding the DHCP server responsible for its subnet, it
answers with a DCHPOffer message, which offers an IP address. Often, more than
one server will be able to respond. The server(s) will temporarily reserve the IP
address in anticipation of acceptance.
69 | P a g e
3. When the client receives the DHCP offer or offers, it will choose one and
accept it by broadcasting a DHCPRequest. By default, the client will accept the
offer of the DHCP server closest to it. Since it is a broadcast, all other servers will
know that the client has accepted one of the offers. 4. The DHCP server creates a
lease for the address it offered, makes the appropriate changes to its database of
available and leased IP addresses, and confirms the IP address assignment with a
DHCPAck message.
Lease Renewals
When a DHCP client powers on or connects to the network, it will confirm that it
can continue to use its currently assigned address. If so, the lease is renewed and
the expiration date extended. If not, they will try to renew after 50 percent of the
lease time has expired. This renewal time value is referred to as T1.
If the T1 attempt fails, the client will try again after 87.5% of the lease has expired.
If unsuccessful, it will broadcast a DHCPDiscover request to receive an IP address
from any DHCP server on its network. This binding time value is referred to as T2.
If a client cannot reach a DHCP server before its lease expires, it will attempt to
acquire a new IP address through the Initial Release process.
dhcpd.conf File
You can define your server configuration parameters in the dhcpd.conf file which
may be located in the /etc the /etc/dhcpd or /etc/dhcp3 directories depending on
your version of Linux.
Note: The skeleton dhcp.conf file that is created when you install the package may
vary in its completeness. In Ubuntu / Debian, the skeleton dhcpd.conf file is
extensive with most of the commands deactivated with a # sign at the beginning. In
70 | P a g e
Fedora / RedHat / CentOS an extensive sample is also created with activated
commands. It is found in the following location which you can always use as a
guide.
/usr/share/doc/dhcp*/dhcpd.conf.sample
Note: The dhcpd.conf configuration file formats in Debian / Ubuntu and Redhat /
Fedora are identical.
[bash]# vi /etc/dhcpd.conf
lease-file-name "/var/lib/dhcpd/dhcpd.leases";
authoritative;
71 | P a g e
option ntp-servers 192.168.1.1;
host wkstn1 {
fixed-address 192.168.1.5; }
Setting Daemon Options The DHCP daemon can be configured with command line
options by using the /etc/sysconfig/dhcpd file. For security, DHCP can be bound to
an interface so the allocation of addresses are only available to the private internal
network.
[bash]# vi /etc/sysconfig/dhcpd
Setting this option provides queries and assignment only through this interface.
There are many more options statements you can use to configure DHCP. These
include telling the DHCP clients where to go for services such as finger and IRC.
Check the dhcp-options man page after you do your install:
Fedora / RedHat / CentOS: The /etc/sysconfig/dhcpd file must be edited and the
DHCPDARGS variable edited to include the preferred interface. In this example
interface eth0 is preferred.
72 | P a g e
Configuring a DHCP Client
Setting up a Linux for dhcp can be done by editing file using a text editor such as
vi: # vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:19:D1:2A:BA:A8
IPADDR=10.10.29.66
NETMASK=255.255.255.192
ONBOOT=yes
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:19:D1:2A:BA:A8
ONBOOT=yes
The parameters specified in the above sample file are explained below. For more
detailed information about the configuration options available, type "man
dhcpd.conf" or "man dhcp-options" at the command prompt.
73 | P a g e
Find out: What is the IP address of PC0, PC1 and PC2 acquired from DHCP?
74 | P a g e