You are on page 1of 74

SYBSc.I.

T
Semester III

Computer Networks

Practical Manual
2021-2022

Prepared By:-
Ms. Sadaf Shaikh–Model College (Autonomous)

Page | 1
Practical No.1
Q 1 A. IPv4 Addressing and Subnetting
Given an IP address and network mask, determine other information about the IP address
such as:
• Network address
• Network broadcast address
• Total number of host bits
• Number of hosts

Given : IP Address :- 70.12.100.132


Network Mask :- 255.255.255.192
To find: Network address :-First address = (any address) AND (network mask)
= 70.12.100.132 AND 255.255.255.192
= 70.12.100.128

Network broadcast address :-Last address = (any address) OR [NOT (network mask)]
= 70.12.100.132 OR 0.0.0.63
= 70.12.100.191

Total number of host bits:- 32-26 = 6 bits


Number of hosts :-N = 232- nin which n is the prefix length and N is the number of addresses in the block.
= 26= 64 hosts

Q 1 B. Given an IP address, network mask, and subnetwork mask, determine other information
about the IP address such as:
• The subnet address of this subnet
• The broadcast address of this subnet
• The range of host addresses for this subnet
• The maximum number of subnets for this subnet mask
• The number of hosts for each subnet
• The number of subnet bits
• The number of this subnet

Example:--

Consider class a ip address 10.0.0.0 the its default subnet mask is 255.0.0.0 which means we can represent it by
10.0.0.0/8 the “/” factor indicates the CIDR value

If we decide to block some of the bits to minimize no of host in any given subnet then that technique is called as
variable length subnet masking (VLSM)

Let us see the example where we borrow some bits from host part and minimize the count to an extent and
create small independent N/W’s of big N/W .Or even we can say that we want 8 N/W out of 1 big n/w then we
will observer following N/W created with their VLSM 255.224.0.0 and no of hosts per subnet 2 21=2097152 -
2=2097150

ID Subnetwork Broadcast First Host Last Host

1 10.0.0.010.31.255.255 10.0.0.110.31.255.254

2 10.32.0.0 10.63.255.255 10.32.0.1 10.63.255.254

Page | 2
3 10.64.0.0 10.95.255.255 10.64.0.1 10.95.255.254

4 10.96.0.0 10.127.255.255 10.96.0.1 10.127.255.254

5 10.128.0.0 10.159.255.255 10.128.0.1 10.159.255.254

6 10.160.0.0 10.191.255.255 10.160.0.1 10.191.255.254

7 10.192.0.0 10.223.255.255 10.192.0.1 10.223.255.254

8 10.224.0.0 10.255.255.255 10.224.0.1 10.255.255.254

Page | 3
Practical No.2

Q2) USE OF PING AND TRACERT / TRACEROUTE AND ARP UTILITIES

Diagnostic commands help you detect TCP/IP networking problems. Some of the diagnostic commandsarearp,
hostname,ipconfig,,netstat, ping, route, and tracert .

i) arp
This diagnostic command displays and modifies the IP-to-Ethernet or Token Ring physical address translation
tables used by the Address Resolution Protocol (ARP).

Syntax

arp -a [inet_addr] [-N [if_addr]]


arp -dinet_addr [if_addr]
arp -sinet_addrether_addr [if_addr]

Parameters

-a Displays current ARP entries by querying TCP/IP. If inet_addr is specified, only the IP and physical
addresses for the specified host are displayed.

-d Deletes the entry specified by inet_addr

-s Adds an entry in the ARP cache to associate the IP address inet_addrwith the physical address ether_addr.
The physical address is given as 6 hexadecimal bytes separated by hyphens. The IP address is specified using
dotted decimal notation. The entry is static. It will not be automatically removed from the cache after the
timeout expires and will not exist after a reboot of your computer.

-N [if_addr] Displays the ARP entries for the network interface specified by if_addr. ether_addr Specifies a
physical address. if_addr Specifies, if present, the IP address of the interface whose address translation table
should be modified. If not present, the first applicable interface will be used. inet_addr Specifies an IP address
in dotted decimal notation.

Page | 4
ii) hostname
This diagnostic command prints the name of the host on which the command is used.

Syntax

hostname -- This command has no parameters.

iii) ipconfig
This diagnostic command displays all current TCP/IP network configuration values. This command is useful on
computers running DHCP because it enables users to determine which TCP/IP configuration values have been
configured by DHCP. If you enter only ipconfigwithout parameters, the response is a display of all of the
current TCP/IP configuration values, including IP address, subnet mask, and default gateway.

Syntax

ipconfig [/all | /renew [adapter] | /release [adapter]]

Parameters

all Produces a full display. Without this switch, ipconfig displays only the IP address, subnet mask, and default
gateway values for each network card.

renew [adapter] Renews DHCP configuration parameters. This option is available only on computers running
the DHCP Client service. To specify an adapter name, type the adapter name that appears when you use
ipconfig without parameters.

Page | 5
release [adapter] Releases the current DHCP configuration. This option disables TCP/IP on the local computer
and is available only on DHCP clients. To specify an adapter name, type the adapter name that appears when
you use ipconfig without parameters.

Page | 6
iv) netstat
This diagnostic command displays protocol statistics and current TCP/IP network connections.

Syntax

netstat [-a] [-e][-n][-s] [-p protocol] [-r] [interval]

Parameters

-a Displays all connections and listening ports; server connections are usually not shown. -e Displays Ethernet
statistics. This can be combined with the -s option. -n Displays addresses and port numbers in numerical form
(rather than attempting name lookups). -s Displays per-protocol statistics. By default, statistics are shown for
TCP, UDP, ICMP, and IP; the -p option can be used to specify a subset of the default.

-p protocol Shows connections for the protocol specified.

-r Displays the contents of the routing table.

Interval Redisplays selected statistics, pausing interval seconds between each display.

Page | 7
Page | 8
v) ping
This diagnostic command verifies connections to one or more remote computers.

Syntax

ping [-t] [-a] [-n count] [-l length] [-f] [-i ttl] [-v tos] [-r count] [-s count]
[[-j host-list] | [-k host-list]] [-w timeout] destination-list

Parameters

-t Pings the specified host until interrupted.

-a Resolves addresses to host names.

-n count Sends the number of ECHO packets specified by count. The default is 4.

-l length Sends ECHO packets containing the amount of data specified by length. The default is 64 bytes; the
maximum is 8192.

-f Sends a Do Not Fragment flag in the packet. The packet will not be fragmented by gateways on the route.

-ittl Sets the time to live field to the value specified by ttl.

-v tos Sets the type of service field to the value specified by tos.

Page | 9
-r count Records the route of the outgoing packet and the returning packet in the record route field. A minimum
of 1 to a maximum of 9 hosts must be specified by count.

-s count Specifies the timestamp for the number of hops specified by count.

-j host-list Routes packets via the list of hosts specified by host-list. Consecutive hosts can be separated by
intermediate gateways (loose source routed). The maximum number allowed by IP is 9.

-k host-list Routes packets via the list of hosts specified by host-list. Consecutive hosts cannot be separated by
intermediate gateways (strict source routed). The maximum number allowed by IP is 9.

-w timeout Specifies a timeout interval in milliseconds.

destination-list Specifies the remote hosts to ping.

Page | 10
vi) route
This diagnostic command manipulates network routing tables.

Syntax

route [-f] [command [destination] [MASK netmask] [gateway] [METRIC metric]]

Parameters

-f Clears the routing tables of all gateway entries. If this parameter is used in conjunction with one of the
commands, the tables are cleared prior to running the command.

command Specifies one of four commands.

Command Purpose

print Prints a route

add Adds a route

Page | 11
Command Purpose

delete Deletes a route

change Modifies an existing route

destination Specifies the host to send command.

MASK Specifies, if present, that the next parameter be interpreted as the netmask parameter.

netmask Specifies, if present, the subnet mask value to be associated with this route entry. If not present, this
parameter defaults to 255.255.255.255.

gateway Specifies the gateway.

METRIC Specifies the route metric (cost) for the destination.

vii ) tracert
This diagnostic utility determines the route taken to a destination by sending Internet Control Message Protocol
(ICMP) echo packets with varying time-to-live (TTL) values to the destination. Each router along the path is
required to decrement the TTL on a packet by at least 1 before forwarding it, so the TTL is effectively a hop
count. When the TTL on a packet reaches 0, the router is supposed to send back an ICMP Time Exceeded
message to the source computer.

Tracert determines the route by sending the first echo packet with a TTL of 1 and incrementing the TTL by 1
on each subsequent transmission until the target responds or the maximum TTL is reached. The route is
determined by examining the ICMP Time Exceeded messages sent back by intermediate routers. Notice that
some routers silently drop packets with expired TTLs and will be invisible to tracert.

Syntax

tracert[-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name

Page | 12
Parameters

-d Specifies not to resolve addresses to host names.

-h maximum_hops Specifies maximum number of hops to search for target.

-j host-list Specifies loose source route along host-list.

-w timeout Waits the number of milliseconds specified by timeout for each reply.

target_name Name of the target host.

Page | 13
Practical No.3
Q3) Configure IP static routing.

Static Route Configuration


Static Route
1.Static routing method is most trusted by a router.

2.Static routing is not really a routing protocol.

3.Static routes do not dynamically adapt to network changes, are not particularly scalable,
and require manual updating to reflect changes.

Static routing has the following advantages


1. There is no bandwidth usage between routers, which means you could possibly save
money on WAN links.

2. There is no overhead on the router CPU, which means you could possibly buy a cheaper
router than you would use if you were using dynamic routing.

3. It adds security because the administrator can choose to allow routing access to certain
networks only.

Static routing has the following disadvantages


1. Static routes don’t dynamically adapt to network change.

2. If a network is added to the internetwork, the administrator has to add a route to it on


all routers—by hand.

3. It’s not feasible in large networks because maintaining it would be a full-time job in
itself.

4. With static routing, as your network grows, it can be difficult just keep adding static
routes makes sure everybody can still get everything.

5. The administrator must really understand the internetwork and how each router is
connected in order to configure routes correctly.

There are two different styles to configure an “ip route” command:

1. Using a next hop IP address

2. Using an outgoing interface

Syntax:
ip route [destination_network] [mask] [next_hop_address or
exit_interface][administrative_distance][permanent]
We can break the above syntax:
ip route [destination_network] [mask] [next_hop_address]
ip route [destination_network] [mask] [exit_interface/next_hop_address]
network - the destination network
mask - is the subnet mask for that network
address - IP address of the next hop router
interface - the interface the traffic is to leave by
distance - (optional) the administrative distance of the route

Example: 1

Page | 14
Router(config)#ip route 10.0.0.0 255.0.0.0 131.108.3.4 110

10.0.0.0 is the destination network/remote destination network/final destination.


255.0.0.0 is the subnet mask for that network and 131.108.3.4 is the next hop ip.
110 is the administrative distance.
The AD is the trustworthiness of a route, where 0 is best and 255 is worst.
The default administrative distance of static route is 1.

Example: 2

Router0(config)#ip route 10.10.3.0 255.255.255.0 10.10.0.3(using next hop ip)


Router0(config)#ip route 10.10.3.0 255.255.255.0 fa0/1(using exit interface)

We can use the exit interface instead of next hop ip address. Functionally, next hop ip and
exit interface work exactly the same. But, it is preferred to use next_hop_ip_address for
troubleshoot easier way.

Why Static Route Need Tutorial

There is a golden rule of routing: If the router cannot find the route, it will drop the packet and send an
ICMP "Destination Unreachable" message to the original sender.
The only way a router knows about a route (destination network) is one of 3 ways:
1.It is directly connected to that network
2. It learns about the remote (not directly connected) route from another router - it does this by both
routers speaking the same routing protocol.

3. An administrator MANUALLY enters a static route in the router. The problem with #3 is that you
have to enter EVERY route on EVERY router. This very quickly becomes tedious and is prone to
error.
Static routing is a good choice IF the following are true:
1.You only have a few routers.

Page | 15
2. You have NO redundant paths (routes).

3. You don't want the routers to use up precious bandwidth by using routing protocols.
Above discussion taken from "Chrys Thorsen", from facebook of "Zambia CCNA Study
Group".

Putting two IP addresses, subnet mask and default gateway to PC1 and PC2.
Click PC1/ Desktop/IP Configuration /Static

Click PC2/ Desktop/IP Configuration /Static


In this scenario, PC1 can ping router R1’s f0/0(10.1.0.1/24) interface and f0/1(10.2.0.1/24) interface.

Page | 16
But PC1 can not ping router R2’s f0/1(10.2.0.2/24) interface.
Configure R1 rourer.
Router>enable
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R1
R1(config)#int f0/0
R1(config-if)#ip addess 10.1.0.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#int f 0/1
R1(config-if)#ip add 10.2.0.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#^Z
R1#

Configure R2 rourer.
Router>en
Router>enable
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R2
R2(config)#int f0/1
R2(config-if)#ip address 10.2.0.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#int f0/0
R2(config-if)#ip address 10.3.0.1 255.255.255.0
R2(config-if)#no shut
R2(config-if)#^Z
R2#

Let's ping from PC1 to R1’s interfaces.


PC>ping 10.1.0.1
Pinging 10.1.0.1 with 32 bytes of data:
Reply from 10.1.0.1: bytes=32 time=40ms TTL=255
Reply from 10.1.0.1: bytes=32 time=20ms TTL=255
Reply from 10.1.0.1: bytes=32 time=20ms TTL=255
Reply from 10.1.0.1: bytes=32 time=20ms TTL=255
PC>
PC>ping 10.2.0.1
Pinging 10.2.0.1 with 32 bytes of data:
Reply from 10.2.0.1: bytes=32 time=20ms TTL=255
Reply from 10.2.0.1: bytes=32 time=20ms TTL=255
Reply from 10.2.0.1: bytes=32 time=12ms TTL=255
Reply from 10.2.0.1: bytes=32 time=4ms TTL=255
PC>

Let's ping from PC1 to R2's interfaces.


Let's ping from PC1 to R2's interfaces.PC>ping 10.2.0.2
Pinging 10.2.0.2 with 32 bytes of data:
Request timed out.

Page | 17
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
PC>

Ping is a echo request goes to the router and then router sends the echo reply back to the pc.
Why PC1 can not ping router R2?
Let’s see R1’s routing table.
R1#sh ip rou
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.0.0 is directly connected, FastEthernet0/0
C 10.2.0.0 is directly connected, FastEthernet0/1
R1#

Let's see R2's routing table.


R2#sh ip route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 2 subnets
C 10.2.0.0 is directly connected, FastEthernet0/1
C 10.3.0.0 is directly connected, FastEthernet0/0
R2#

This R1 router knows about two routes. It knows about the 10.1.0.0/24 and 10.2.0.0/24 networks.
When pings from PC1, router R1 knows how to send packet to router R2’s interface f0/1(10.2.0.2/24).
So, packet actually arrives at router R2’s f0/1 interface. The problem is, echo-reply never returns.
Router R2 knows about 10.2.0.0.0/8 and 10.3.0.0/8 networks. When router R2 tries to send packet
back to 10.1.0.1/24 network, to PC1(10.1.0.2), he does not has 10.1.0.0/24 network in his routing
table. So R2 has no idea about 10.1.0.0/24 network.
So, if we put a static route(10.1.0.0/24) to router R2, whole thing start working.
R2#conf t
R2(config)#ip route 10.1.0.0 255.255.255.0 10.2.0.1
R2(config)#

Now ping will work.


Let's ping from PC1 to R2's interfaces.
PC>ping 10.2.0.2
Pinging 10.2.0.2 with 32 bytes of data:
Reply from 10.2.0.2: bytes=32 time=40ms TTL=254
Reply from 10.2.0.2: bytes=32 time=40ms TTL=254
Reply from 10.2.0.2: bytes=32 time=40ms TTL=254
Reply from 10.2.0.2: bytes=32 time=40ms TTL=254
PC>

Static Route Lab with Packet Tracer Tutorial

Page | 18
Static Route Lab with Packet Tracer
Configure Static Route on Cisco Routers with following information:
Network: 172.16.0.0/16, 192.168.0.0/24, 10.0.0.0/8
Gateway Address: 172.16.0.1/16, 192.168.0.1/24, 10.0.0.1/8

Putting three IP addresses, subnet mask and default gateway to three PCs.

Click PC1/ Desktop/IP Configuration /Static

Page | 19
Click PC2/ Desktop/IP Configuration /Static

Click PC3/ Desktop/IP Configuration /Static

Configure Router R1

Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R1
R1(config)#int fa 0/1
R1(config-if)#ip address 172.16.0.1 255.255.0.0
R1(config-if)#no shut
R1(config-if)#int fa 1/0
R1(config-if)#ip address 192.168.0.1 255.255.255.0
R1(config-if)#no shut
R1(config)#int fa 0/0
R1(config-if)#ip address 100.0.0.1 255.255.255.252
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#

Page | 20
Configure Router R2

Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R2
R2(config)#int fa 0/0
R2(config-if)#ip address 100.0.0.2 255.255.255.252
R2(config-if)#no shut
R2(config)#int fa 0/1
R2(config-if)#ip address 10.0.0.1 255.0.0.0
R2(config-if)#no shut
R2(config-if)#exit
R2(config)#

Configure Static Route to router R1

Go to config mode, type ip route command, the subnet number, followed by the mask, and next hop ip
address.

R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ip route 10.0.0.0 255.0.0.0 100.0.0.2
R1(config)#^Z

See routing table of router R1

R1#show ip route

Gateway of last resort is not set

S 10.0.0.0/8 [1/0] via 100.0.0.2


100.0.0.0/30 is subnetted, 1 subnets
C 100.0.0.0 is directly connected, FastEthernet0/0
C 172.16.0.0/16 is directly connected, FastEthernet0/1
C 192.168.0.0/24 is directly connected, FastEthernet1/0
R1#

Note a static route added to the routing table. The character S means static route.
It references 10.0.0.0 subnet and it says to get there via100.0.0.2. via means that
the next hop router’s IP address.

Now check IP connectivity


Click PC-1/ Desktop/Command Prompt

Page | 21
PC>ping 10.0.0.2

Pinging 10.0.0.2 with 32 bytes of data:

Request timed out.


Request timed out.
Request timed out.
Request timed out.

Ping statistics for 10.0.0.2:


Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

PC>

However PC-1 can’t ping PC-3 right now, the ping fails.

See routing table of router R2

R2#show ip route

Gateway of last resort is not set

C 10.0.0.0/8 is directly connected, FastEthernet0/1


100.0.0.0/30 is subnetted, 1 subnets
C 100.0.0.0 is directly connected, FastEthernet0/0
R2#

The output confirms that R2 does not have route to reach subnet 172.16.0.2/16, 192.168.0.2/24 or PC-1, PC-2.
As a result, if PC-1 tries to ping PC-3 or PC-3 tries to ping PC-1 right now, the
ping will fail.

So, we have to add a routing protocol(in this case, static route) that points PC-3’s
subnet namely 10.0.0.0/8.
In this way we will tell R1 how to forward packet to 10.0.0.0/8 subnet.
The packet arrives at R2, R2 has a directly connected route PC-3’s subnet.

Configure Static Route to router R2

R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#ip route 172.16.0.0 255.255.0.0 100.0.0.1
R2(config)#ip route 192.168.0.0 255.255.255.0 100.0.0.1
R2(config)#^Z
R2#

Page | 22
Now,see routing table of router R2

R2#show ip route

Gateway of last resort is not set

C 10.0.0.0/8 is directly connected, FastEthernet0/1


100.0.0.0/30 is subnetted, 1 subnets
C 100.0.0.0 is directly connected, FastEthernet0/0
S 172.16.0.0/16 [1/0] via 100.0.0.1
S 192.168.0.0/24 [1/0] via 100.0.0.1
R2#

Now check IP connectivity


Click PC-1/ Desktop/Command Prompt

PC>ping 10.0.0.2

Pinging 10.0.0.2 with 32 bytes of data:

Reply from 10.0.0.2: bytes=32 time=12ms TTL=126


Reply from 10.0.0.2: bytes=32 time=13ms TTL=126
Reply from 10.0.0.2: bytes=32 time=12ms TTL=126
Reply from 10.0.0.2: bytes=32 time=20ms TTL=126

Ping statistics for 10.0.0.2:


Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 12ms, Maximum = 20ms, Average = 14ms

PC>

We can reach 10.0.0.0 network.

Click PC-2/ Desktop/Command Prompt


PC>ping 10.0.0.2

Pinging 10.0.0.2 with 32 bytes of data:

Reply from 10.0.0.2: bytes=32 time=12ms TTL=126


Reply from 10.0.0.2: bytes=32 time=14ms TTL=126
Reply from 10.0.0.2: bytes=32 time=24ms TTL=126
Reply from 10.0.0.2: bytes=32 time=11ms TTL=126

Ping statistics for 10.0.0.2:


Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Page | 23
Approximate round trip times in milli-seconds:
Minimum = 11ms, Maximum = 24ms, Average = 15ms

PC>

We can reach 10.0.0.0 network.

Click PC-3/ Desktop/Command Prompt


PC>ping 172.16.0.2

Pinging 172.16.0.2 with 32 bytes of data:

Reply from 172.16.0.2: bytes=32 time=10ms TTL=126


Reply from 172.16.0.2: bytes=32 time=11ms TTL=126
Reply from 172.16.0.2: bytes=32 time=12ms TTL=126
Reply from 172.16.0.2: bytes=32 time=16ms TTL=126

Ping statistics for 172.16.0.2:


Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 10ms, Maximum = 16ms, Average = 12ms

PC>

We can reach 172.16.0.0 network.

PC>ping 192.168.0.2
Pinging 192.168.0.2 with 32 bytes of data:

Reply from 192.168.0.2: bytes=32 time=12ms TTL=126


Reply from 192.168.0.2: bytes=32 time=11ms TTL=126
Reply from 192.168.0.2: bytes=32 time=22ms TTL=126
Reply from 192.168.0.2: bytes=32 time=10ms TTL=126

Ping statistics for 192.168.0.2:


Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 10ms, Maximum = 22ms, Average = 13ms

PC>

We can reach 192.168.0.0 network.

Page | 24
Practical No.4

Q4) Configure IP routing using RIP.

Routing Information Protocol - RIP

There are two versions of RIP: RIPv1 and RIPv2.

Comparing between RIPv1 and RIPv2

1. Both RIPv1 and RIPv2 have the Administrative distance 120.

2. Both RIPv1 and RIPv2 are distance vector routing protocol.

Both RIPv1 and RIPv2’s metric is hop count.


Maximum hop count = 15. Max routers = 16.

For example, all routers are running RIP and network 10.0.0.0 goes down.
After hold timer expires, that network will be advertised by metric 16 and everyone will know that the
network is down and that network will be seen in routing table as possibly down.

4. Both RIPv1 and RIPv2 send routing updates or complete routing table or broadcast every 30 seconds. i.e. The
default routing update period for both version of RIP is 30 seconds. i.e. Both have the same timers.

5. Both RIPv1 and RIPv2 use split horizon to prevent routing loops.

6. Both RIPv1 and RIPv2 are configured with router rip.

7. network command tells both RIPv1 and RIPv2 to send hellos, out an interface, to find neighbors and to
advertise routes.

R1(config-router)#network ?
A.B.C.D Network number
R1(config-router)#network 172.16.0.0 ?
<cr>

Page | 25
R1(config-router)#^Z
R1#

8. Both RIPv1 and RIPv2 are verified with show ip protocols.

Router#show ip protocols
R 10.0.0.10[120/3] via 20.0.0.7, 00:00:15, Serial0/0

The first number in the brackets is the administrative distance of the information source.
The second number is the metric for the route.
In this case, the administrative distance is 120, default AD for RIP routes, and the 3 represents the metric,
which is the number of router hops in RIP.

Difference
1. RIPv1 used broadcast. RIPv2 used multicast(224.0.0.9).

2. RIPv1 is a classful.(Classful: all subnet mask must be the same in the network.) RIPv2 is a classless.

3. RIPv1 does not support VLSM. RIPv2 supports VLSM. subnet mask field was added to the RIPv2 message
header by RFC 1723 to add support for VLSM and CIDR.

4. RIPv1 does not allow authentication. RIPv2 allows MD5 authentication

5. RIP enabled interfaces send version 1(RIPv1) updates.Do not send version 2(RIPv2) updates.
RIP enabled interfaces receive any version(RIPv1 and RIPv2).

6. RIPv2 sends the subnet mask in updates and RIPv1 does not. i.e. Subnet mask information is included in
RIPv2 routing updates that is not included in RIPv1.

Advantage of RIPv2 over RIPv1


1. RIPv2 supports MD5 authentication for routing updates. i.e. RIP version 2 supports routing update
authentication.

2. RIPv2 used multicast(224.0.0.9) rather than broadcast.

3. RIPv2 auto summarize advertised routes across classful boundaries.


To disable this behavior, should apply no auto-summary command under the RIP process.

4. RIPv2 is classless routing protocol means that it sends subnet mask information when updates.
By sending the subnet mask information with the updates, RIPv2 can support Variable Length
Subnet Mask(VLSMs) as well as the summarization of network boundaries.

Disadvantage of RIPv1 and RIPv2


1. Both RIPv1 and RIPv2 send full routing tables out every 30 seconds. It’s a lot of overhead, require too much
bandwidth. Sending full routing table is unnecessary.

2. RIPv1 and RIPv2 does not form adjacency.

Page | 26
3. RIPv1 and RIPv2 work only on hop count(not consider the bandwith).

4.RIPv1 and RIPv2 have slow convergence.

5.Not scalable, because hop count is only 15.

RIPv1 Lab with Packet Tracer Tutorial


RIPv1 Lab with Packet Tracer

Configure RIPv1 on Cisco Routers with following information:


Network: 172.16.0.0/16, 192.168.0.0/24, 10.0.0.0/8
Gateway Address: 172.16.0.1/16, 192.168.0.1/24, 10.0.0.1/8

Putting three IP addresses, subnet mask and default gateway to three PCs.

Page | 27
Click PC1/ Desktop/IP Configuration /Static

Click PC2/ Desktop/IP Configuration /Static

Click PC3/ Desktop/IP Configuration /Static

Page | 28
Configure Router R1

Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R1
R1(config)#int fa 0/1
R1(config-if)#ip address 172.16.0.1 255.255.0.0
R1(config-if)#no shut
R1(config-if)#int fa 1/0
R1(config-if)#ip address 192.168.0.1 255.255.255.0
R1(config-if)#no shut
R1(config)#int fa 0/0
R1(config-if)#ip address 100.0.0.1 255.255.255.252
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#

Configure Router R2

Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R2
R2(config)#int fa 0/0

Page | 29
R2(config-if)#ip address 100.0.0.2 255.255.255.252
R2(config-if)#no shut
R2(config)#int fa 0/1
R2(config-if)#ip address 10.0.0.1 255.0.0.0
R2(config-if)#no shut
R2(config-if)#exit
R2(config)#

Configure RIPv1 to router R1Here we put all three network those are connected to R1 router.

A numeric value is required for EIGRP, OSPF. With EIGRP, AS number, with OSPF, the process number, but
RIP, there is no number.

R1(config)#router rip
R1(config-router)#network ?
A.B.C.D Network number
R1(config-router)#network 172.16.0.0 ?
<cr>
R1(config-router)#network 172.16.0.0
R1(config-router)#network 192.168.0.0
R1(config-router)#network 100.0.0.0
R1(config-router)#^Z
R1#

Configure RIPv1 to router R2


Here we put two network those are connected to R2 router.

R2(config)#router rip
R2(config-router)#network ?
A.B.C.D Network number
R2(config-router)#network 100.0.0.0
R2(config-router)#network 10.0.0.0
R2(config-router)#^Z
R2#

See routing table of router R1

R1#show ip route

Gateway of last resort is not set

R 10.0.0.0/8 [120/1] via 100.0.0.2, 00:00:20, FastEthernet0/0


100.0.0.0/30 is subnetted, 1 subnets
C 100.0.0.0 is directly connected, FastEthernet0/0

Page | 30
C 172.16.0.0/16 is directly connected, FastEthernet0/1
C 192.168.0.0/24 is directly connected, FastEthernet1/0
R1#

R1#show ip rip database


10.0.0.0/8
[1] via 100.0.0.2, 00:00:12, FastEthernet0/0
100.0.0.0/30 directly connected, FastEthernet0/0
172.16.0.0/16 directly connected, FastEthernet0/1
192.168.0.0/24 directly connected, FastEthernet1/0
R1#

See routing table of router R2

R2#show ip route

Gateway of last resort is not set

C 10.0.0.0/8 is directly connected, FastEthernet0/1


100.0.0.0/30 is subnetted, 1 subnets
C 100.0.0.0 is directly connected, FastEthernet0/0
R 172.16.0.0/16 [120/1] via 100.0.0.1, 00:00:09, FastEthernet0/0
R 192.168.0.0/24 [120/1] via 100.0.0.1, 00:00:09, FastEthernet0/0
R2#

R2#show ip rip database


10.0.0.0/8 directly connected, FastEthernet0/1
100.0.0.0/30 directly connected, FastEthernet0/0
172.16.0.0/16
[1] via 100.0.0.1, 00:00:19, FastEthernet0/0
192.168.0.0/24
[1] via 100.0.0.1, 00:00:19, FastEthernet0/0
R2#

Now check IP connectivity


Click PC-1/ Desktop/Command Prompt

PC>ping 10.0.0.2

Pinging 10.0.0.2 with 32 bytes of data:

Reply from 10.0.0.2: bytes=32 time=12ms TTL=126


Reply from 10.0.0.2: bytes=32 time=13ms TTL=126

Page | 31
Reply from 10.0.0.2: bytes=32 time=12ms TTL=126
Reply from 10.0.0.2: bytes=32 time=20ms TTL=126

Ping statistics for 10.0.0.2:


Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 12ms, Maximum = 20ms, Average = 14ms

PC>

We can reach 10.0.0.0 network.

Click PC-2/ Desktop/Command Prompt


PC>ping 10.0.0.2

Pinging 10.0.0.2 with 32 bytes of data:

Reply from 10.0.0.2: bytes=32 time=12ms TTL=126


Reply from 10.0.0.2: bytes=32 time=14ms TTL=126
Reply from 10.0.0.2: bytes=32 time=24ms TTL=126
Reply from 10.0.0.2: bytes=32 time=11ms TTL=126

Ping statistics for 10.0.0.2:


Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 11ms, Maximum = 24ms, Average = 15ms

PC>

We can reach 10.0.0.0 network.

Click PC-3/ Desktop/Command Prompt


PC>ping 172.16.0.2

Pinging 172.16.0.2 with 32 bytes of data:

Reply from 172.16.0.2: bytes=32 time=10ms TTL=126


Reply from 172.16.0.2: bytes=32 time=11ms TTL=126
Reply from 172.16.0.2: bytes=32 time=12ms TTL=126
Reply from 172.16.0.2: bytes=32 time=16ms TTL=126

Ping statistics for 172.16.0.2:


Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 10ms, Maximum = 16ms, Average = 12ms

PC>

We can reach 172.16.0.0 network.

Page | 32
PC>ping 192.168.0.2
Pinging 192.168.0.2 with 32 bytes of data:

Reply from 192.168.0.2: bytes=32 time=12ms TTL=126


Reply from 192.168.0.2: bytes=32 time=11ms TTL=126
Reply from 192.168.0.2: bytes=32 time=22ms TTL=126
Reply from 192.168.0.2: bytes=32 time=10ms TTL=126

Ping statistics for 192.168.0.2:


Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 10ms, Maximum = 22ms, Average = 13ms

PC>

We can reach 192.168.0.0 network.

Routing Information Protocol - RIP Command Tutorial


RIP Command

1. The command show ip route followed by the protocol will show that protocol's route from the entire
routing table.

R1#show ip route rip

2. The command show protocols is used to view the RIP routing protocol settings and configuration.

3. The command show ip rip database will display RIP routing updates or RIP routing information as they are
sent and received. But to see the updates in real time, we need command Debug not Show.
But don't do debug ip rip, don't do debug all. It may crash your router.Because all possible debugs will start
and consume router's whole processing and memory.

4. If The command Router(config-router)# version 2 is entered on the routers, only version 2 updates are sent
to 224.0.0.9.

5. If The command Router(config-router)# no version 2 is entered on the routers, version 1 and 2 updates will
be received and the version 2 updates will not be sent.

6. The command debug ip rip shows the routes being advertised in RIP updates and the metrics of these
routes. i.e. debug ip rip will display RIP activity as it occurs on a router.
R1#debug ip rip

7. The command clear ip route * should apply after the command debug ip rip to clear the routing table of its
dynamic routes.

R1#clear ip route *

Page | 33
8. The command undebug all turn off all debugs.

R1#undebug all

9. To turn off specific debugs, run the command no debug followed by the type of debug you want to turn off.

R1#no debug ip rip

Page | 34
Practical No.5
Q5) Configuring Simple
OSPF.
OSPF Terminology

Link: Interface on a router


Link state: Description of an interface and of its relationship to its neighboring routers.
The collection of all the link-states would form a link-state database.

1. OSPF uses cost as a metric, which is the inverse of the bandwidth of a link. OSPF identifies the best route by
use of cost.

2. OSPF uses Dijkstra or SPF(Shortest Path First) algorithm. Dijkstra or SPF is a same algorithm.

3.OSPF provides a loop free topology.

4. OSPF's administrative distance is 110.

5. Before exchanging routing information, OSPF routers find out neighbors.


OSPF routers exchange LSAs, and the OSPF algorithm uses the contents of those LSAs to build their routing
table. In this way, OSPF allows extensive control of routing updates.

6. OSPF is complex to configure and difficult to troubleshoot.

7.OSPF does not support IPX.

8. OSPF requires more memory and faster processors to handle OSPF than distance vector protocol. i.e. OSPF is
a CPU-intensive protocol, and very large OSPF networks can experience routing and update traffic problems
that seriously impact network performance.

9. OSPF confines network instability to a single area of the network.

10.OSPF uses WILDCARD MASK instead subnet mask.

Advantages of OSPF
1. OSPF is an open-standard, purely link-state protocol.
RIP, IGRP and EIGRP are distance-vector (routing by rumor) routing protocols, susceptible to routing loops,
split-horizon, and other issues.

2. OSPF converges very quickly - from the point of recognizing a failure, it often can converge in less than 10
seconds.

3. OSPF sends updates only changed portion or partial updates of a network when link status changes rather
than the complete routing table. In this way, reduces the usage of bandwidth(BW) and decreases routing
overhead by sending triggered updates to announce changes in the network. RIP and IGRP hold-down timers
can cause slow convergence.

4. OSPF supports VLSM and CIDR. OSPF supports route summarization. RIPv1 and IGRP do not.

Page | 35
5. OSPF is a classless protocol, not classful.

6. OSPF uses the concept of areas to implement hierarchical design, not a flat design like RIP.

7. With OSPF, a router does flood its own LSAs when it age reaches 30 minutes. The flooding, however, does
not happened all at once, so the overhead is minimal. RIP sends entire routing table every 30 seconds, IGRP
every 90 seconds.

8.Link state protocol like OSPF doesn't have anything like Hop. i.e. Do not use hops to mark networks as
unreachable.
When an OSPF router does not receive a Hello packet for a specified time period, it assumes that the neighbor
is down. The router then runs the SPF algorithm to calculate new routes.

Routing Overhead
Routing overhead is the amount of information needed to describe the changes in a dynamic network
topology.
All routers in an OSPF area have identical copies of the topology database.
The topology database of one are is hidden from the rest of the areas to reduce routing overhead. Because
fewer routing updates are sent and smaller routing trees are computed.

OSPF Hierarchical Design Tutorial


Hierarchical Design

1.Hierarchical routing speeds up the convergence time for all routers.

2.Hierarchical routing reduces the amount of routing overhead.

3. Hierarchical routing confines network instability to a single area of the network. i.e. Hierarchical routing
hides network instability from routers in other areas.

4. OSPF network can be divided into areas which is logical segmentation of a large network. OSPF supports a
two-layer hierarchical design: 1. backbone (area 0) and 2. areas off of the backbone. Multiple OSPF areas must
connect to area 0. All other areas have at least one connection to area 0, either directly or through the use of
virtual links.
If any area does not have a direct connection to the backbone area 0, then an OSPF virtual link must be
configured.
The backbone area is not a network type, but a collection of OSPF networks links. Area 0 is reserved as the
backbone area, and routers within area 0 may or may not go through the DR/BDR election process, depending
on the network type.

5. If an OSPF network is configured as a single area, then area 0 does not need to be used.
If the network design is hierarchical, then multiple areas do not need. i.e. Hierarchical OSPF network do not
require multiple areas.

Page | 36
6. OSPF allows to summarize networks from one area into another. Instead of routers needing to know about
all the individual networks in another area, they need to know only about the summary route. The fewer
routes result in faster convergence and less routing overhead.

7. Loopback interfaces are created on a router, and the highest IP address on a loopback (logical) interface
becomes the RID of the router but has nothing to do with areas.

8. If a network in an area go down, it will not affect routers in other areas. A small change in the topology of a
single area won't force every router to run the SPF algorithm. Changes in one area are limited to that area
only, not to every router within the entire network.

OSPF Area Tutorial


OSPF Area

1. OSPF uses the concept of areas which helps route summarization.

2.Area 0 is called the backbone area.

3. Multiple OSPF areas must connect to area 0.

4. If you have only one are, it must be called are 0.

5. The area number can be the range from 0 to 4,294,967,295; or 0 to 4.2 million.

6. The backbone area is not a network type, but a collection of OSPF networks links.
Area 0 is reserved as the backbone area, and routers within area 0 may or may not go through the DR/BDR
election process, depending on the network type.

7. If a network in an area goes down, it will not affect routers in other areas.

8. The OSPF command network 0.0.0.0 255.255.255.255 area 0includes all of its interfaces in area 0.

OSPF Adjacency/Neighbor Tutorial

OSPF Adjacency

1. OSPF neighbor relationship table is called an adjacency database.

2. Before exchanging routing information, OSPF routers find out neighbors. Each router discovers its neighbors
on each interface. The list of neighbors is kept in a neighbor table.

3. Each router uses a reliable protocol to exchange topology information with its neighbors.

4. If OSPF is configured correctly, OSPF form neighbor relationships only with the routers directly connected to
it.

5. To share information with another router, they must be neighbors: their area numbers and types, timers,
and passwords must match.

To form a neighbor relationship


The following must match before routers become neighbors:

Page | 37
1. Hello and Dead interval must match on the two routers on the same link or they will not form adjacency.

2. The area type must match on the segments.


i.e.The router that is formed a neighbor relationship must be in the same area.

3. Subnet mask must match on the segments.

4. MTU size must match on the segments.

5. Authentication password.

OSPF Hello
1. OSPF uses Hello packets to create and maintain adjacencies. i.e. A neighbor is discovered dynamically
through reception of Hello packets.
The rules that govern the exchange of OSPF hello packets are called the Hello protocol.

2. the hello packets are addressed to the multicast address 224.0.0.5.


The multicast IP address 224.0.0.5 is known as 'All SPFRouters.'
On point-to-point networks, OSPF hello packets are addressed 224.0.0.5.
Hello packets are always sent to this destination.
Also, certain OSPF protocol packets are sent to this address during the flooding procedure.
RIPv2 multicast to 224.0.0.9
EIGRP multicast to 224.0.0.10

3. Hello packets detect unreachable neighbors.

4. Hello packets ensure two-way communications between neighbors.

5. Hello packets ensure correctness of basic interface parameters between neighbors.

6. Hello packets provide necessary information for the election of the designated router (DR) and a backup
designated router (BDR) on a LAN segment/ On multi-access networks.

7. On a broadcast multi-access and point-to-point networks, such as Ethernet, Hello packets go at every 10
seconds.
On a non-broadcast segment, NBMA networks, such as Frame Relay, Hello packets go at every 30 seconds.

8. When an OSPF router does not receive a Hello packet for a specified time period, it assumes that the
neighbor is down. The router then runs the SPF algorithm to calculate new routes.

OSPF Dead Interval

1. The dead time is four times the hello time.

2. If you change the hello time, dead time will change dynamically.

3.Dead time can not be statically set.

Page | 38
4. The OSPF Hello time can be set with the ip ospf hello-timecommand:ip ospf hello-time 20 . As the Dead
time is 4 times the Hello time, Dead time will be 80 seconds.

5. The OSPF Dead time can be set with the ip ospf dead-timecommand:ip ospf dead-time 80 . As the Dead
time is set to 80 seconds, the Hello time will dynamically change to 20 seconds.

OSPF Cost Metric Tutorial

Cost Metric
1.A cost is associated with the output side of each router interface. This cost is configurable by the system
administrator. The lower the cost, the more likely the interface is to be used to forward data traffic.

2. OSPF identifies the best route by use of cost. OSPF route metrics are referred to as cost.

3. OSPF uses cost as a metric, which is the inverse of the bandwidth of a link. OSPF identifies the best route by
use of cost.

For example,

Above the figure, the value 128 shown in bold is the OSPF cost metric.

4. Cost of a route is the cumulative costs of the outgoing interfaces from this router to the network.

5.Cost is defined as 10^8/bandwidth. i.e. 10^8(100,000,000) is the reference bandwidth.

Cisco's default interface costs:


The cost of a 56 kbps link in OSPF is 1785. 56-kbps serial link = 1785 (10^8/56000)
The cost of a 64k link in OSPF is 1562. 64-kbps serial link = 1562 (10^8/64000)
The cost of a 128k link in OSPF is 781. 128-kbps serial link = 781 (10^8/128000)
The cost of a 1.544 T1 link in OSPF is 64. T1 (1.544-Mbps serial link) = 64 (10^8/1.544*1000000)
The cost of a 2.048-Mbps link in OSPF is 48. E1 (2.048-Mbps serial link) = 48 (10^8/2.048*1000000)
The cost of a 4-Mbps Token Ring in OSPF is 25. 4-Mbps Token Ring = 25 (108/4*1000000)

Page | 39
The cost of a 10MB link in OSPF is 10. 10MB serial link = 10(108/10000000)
Ethernet = 10
Fast Ethernet = 1
Note:
Both sides of the link should have the same bandwidth value.

Example

Two different ways we can go R3 from R1.


We can go through R4 which involves two 512 cable links.
Or, we can go through R2 which involves two T1 links.
The OSPF can be made easily understand the speeds.
RIP is going to see these paths is being equal, because all RIP understand hop count.

OSPF DR BDR
DR/BDR
Which network types have a DR/BDR election occur:

1. No DR is assigned on any type of point-to-point link. On a point to point link, only two routers exist so there
is no need for a DR or BDR.
i.e. Point-to-point segments don’t use DR/BDR.
OrOn Point-to-point segment DRs/BDRs are not elected.

2. In a point-to-point and point-to-multipoint OSPF network type, OSPF will establish router adjacencies but
not perform the DR/BDR election.

3. No DR/BDR is assigned on the NBMA point-to-multipoint due to the hub/spoke topology.

4. DR and BDR are elected on broadcast and non-broadcast multi-access(NBMA) networks.

Frame Relay is a non-Broadcast Multi-Access (NBMA) network by default.

Page | 40
Some key features of OSPF DR/BDR
1. DRs and BDRs assist in sharing topology information.

2. In a hub and spoke OSPF NBMA network, the hub router should be configured as the Designated
Router(DR).

3. DR is responsible for making adjacencies with all neighbors on a multiaccess network, such as Ethernet or
FDDI.

4. DR represents the multiaccess network, in that it ensures that every router on the link has the same
topology database.

5. BDR is the backup to the designated router (DR), in case the DR fails. BDR performs none of the DR
functions while the DR is operating correctly.

6. A router on an OSPF segment that is neither the DR nor the BDR is called DROTHER.
Lets say an broadcast segment, we have 4 routers. One router can be DR, one router can be BDR and other
two routers would be DROTHERS.

7. To determine manually which router will be the DR, it is necessary to set the priority of the router. A router
interface can have a priority of 0 to 255. The value of 0 means that the router cannot be a DR or BDR.

Router(config-if)#ip ospf priority <value>


The number in the priority command can be set between 0-255, where the higher the number, the greater the
likelihood that this router will be selected as the DR.

8. DR and BDR election is done via the Hello protocol. Hello packets are exchanged via IP multicast packets on
each segment.

9. Routers use multicast address 224.0.0.5 to send LSAs to the DR/BDR.


Or
Traffic sent to a DR/BDR pair is multicast to 224.0.0.5.

10. Traffic sent to all routers on a segment has a destination address of 224.0.0.6.

11. Hello messages are sent out every 10 seconds, with a dead interval timer of 40 seconds.
The DR sends a periodic update every 30 minutes.

12.If DR is down and no BDR is configured, then selection of DR starts again automatically.
If there is no BDR, the protocol will restart the process to look for another possible DR in the NBMA network.

Note
Many administrators prefer to use point-to-point or point-to-multipoint for NMBA to avoid the DR/BDR and
full-mesh issues.

Page | 41
OSPF Router ID Tutorial
OSPF Router ID

Router ID – Used to identify the routers in the OSPF network.

1. Each OSPF router has an ID, which is either the highest IP address on a loopback interface, if one exists, or
the highest IP address on an active interface.

2. To configure network instability to one area of the network, OSPF uses router ID(RID) or a 32-bit IP address
selected at the beginning of the OSPF process.

3. If a router’s OSPF RID is hard coded or change a router’s OSPF RID, router reload or clear the OSPF process is
needed.
Or
Changing the OSPF RID, will require to either reload the router or clear your OSPF process.

4. RIDs have no relationship with areas.

Process of selecting RID


1. The highest IP address configured on the router is the router ID, if no loopback exist.
i.e. At the moment of OSPF process startup, the highest IP address on any active interface will be the Router
ID(RID).

2. When loopback interface is created on a router, the IP address of loopback(logical) interface override the IP
address and becomes the RID(router ID).

3. If multiple loopback interfaces are configured, the highest loopback address becomes the RID.

Advantage of using loopback

1. Loopback address provides stability for the OSPF process on router.

2. Loopback address has the advantage of never going down as long as the router is powered on. It
provides greater stability the OSPF process on router and the routing table ,thus diminishing the possibility of
having to re-establish adjacencies.

OSPF-Difference Between RIP and EIGRP Tutorial

Page | 42
1. OSPF is link-state routing protocol.
RIP and EIGRP are distance-vector (routing by rumor) routing protocols, susceptible to routing loops, split-
horizon, and other issues.

2. OSPF has fast convergence.


RIP use hold-down timers can cause slow convergence.

3. OSPF supports VLSM and CIDR.


RIPv1 does not supports VLSM and CIDR.

4. OSPF metric is based on bandwidth.


RIP metric is based on hop count.
EIGRP metric is based on bandwidth, delay, reliability, load.

5. OSPF only sends out changes when they occur. With OSPF, a router does flood its own LSAs when it age
reaches 30 minutes.
RIP sends entire routing table every 30 seconds, IGRP every 90 seconds.

6. OSPF uses the concept of areas to implement hierarchical routing.


There are no hierarchical concept to RIP and EIGRP.

OSPF Commands Tutorial


OSPF Commands
Enable OSPF process or routing

Syntax

Router(config)#router ospf <process-id>

Note
The command router ospf 100 stand for an Process ID. It is not going be advertised down stream routers.

Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router ospf ?
<1-65535> Process ID
Router(config)#router ospf

The command router eigrp 100 stand for an Autonomous system number. Logically create group routers with
AS.
That not only will be advertised to potential neighbor, they have to agree become neighbors.

Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router eigrp ?

Page | 43
<1-65535> Autonomous system number
Router(config)#router eigrp

Define an interface on which OSPF runs and define the area ID for that interface

Syntax

Router(config-router)#network address <wildcard-mask>< area><area-id>

Configure loopback

Syntax

Router(config)#interface loopback number

DR/BDR election

Syntax

Router(config)#interface <interface>
Router(config-if)#ip ospf priority <0-255>

By default all links are equal with a priority of 1.


In a hub-and-spoke network to become the DR, don’t raise the OSPF interface priority of hub router – lower
the OSPF interface priority of the soke routers.
The command ip ospf priority is commonly used in hub-and-spoke network on the spoke only.
The command ip ospf priority 0 disqualifies from taking part of DR, BDR election for that particular segment.
For example,

R2#conf t
R2(config)# int so.123
R2(config-subif)# ip ospf priority 0

Modify bandwdth

Syntax

Router(config-if)#bandwidth kbps

Explicitly specify the cost of sending a packet on an OSPF interface

Syntax

Router(config-if)#ip ospf cost <cost>

Page | 44
Specify or modify Hello/Dead time

Syntax

Router(config-if)#ip ospf hello-interval <seconds>


Router(config-if)#ip ospf dead-interval <seconds>

Specify the authentication type for an interface


Authentication (Plain)

Syntax

Router(config-router)#area <area> authentication


Authentication (md5)
Router(config-router)#area <area> authentication message-digest

Enable OSPF MD5 authentication. Assign a password to be used by neighboring OSPF routers

Syntax

Router(config-if)#ip ospf <authentication-key><passwd>


Router(config-if)#ip ospf <message-digest-key><key-id> <md5><password>

Verify OSPF

To see the detail information of all OSPF routing process enabled on a router

Router#show ip ospf

To display interface-specific OSPF information

Syntax

Router#show ip ospf interface [int]

For example, the command show ip ospf interface serial 0 will display the serial interface of OSPF
information. Such as: Hello and dead interval timers, Priority of the router, Cost of the interface, display the
router ID of both the DR and the BDR on the network segment.
You can not see Process and router ID using the command show ip ospf interface .

Router#show ip ospf database


Router#debug ip ospf packet

Page | 45
Router#debug ip ospf hello
Router#debug ip ospf adj

Display all OSPF neighbors

Router#show ip ospf neighbor


Example:
Router#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
192.168.1.2 0 FULL/ - 00:00:38 192.168.1.2 Serial1/0
Router#

Neighbor ID: The neighbor ID that is the OSPF RID of the neighbor.
Pri: Short for “priority”, that’s the interface priority of the neighbor.
State: That’s the OSPF adjacency state and role of the router – DR, BDR, or DROTHER.
Dead Time: Time remaining until the adjacency is torn down. Receipt of a valid hello packet will reset this
timer.
Address: The IP address of the neighbor’s interface through which the adjacency has formed. It can be same
as the neighbor ID.
Interface: The interface through which the adjacency has formed.

OSPF ip ospf hello-interval Command Tutorial

ip ospf hello-interval Command

Configure Router R1

Page | 46
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R1
R1(config)#int f0/0
R1(config-if)#ip add 192.168.1.1 255.255.255.252
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#

Configure Router R2

Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R2
R2(config)#int f0/0
R2(config-if)#ip add
R2(config-if)#ip address 192.168.1.2 255.255.255.252
R2(config-if)#no shut
R2(config-if)#exit
R2(config)#

Configure OSPF on router R1

R1(config)#router ospf 1
R1(config-router)#network 192.168.1.0 0.0.0.3 area 0
R1(config-router)#^Z
R1#
Configure OSPF on router R2
R2(config)#router ospf 1
R2(config-router)#network 192.168.1.0 0.0.0.3 area 0
R2(config-router)#
00:09:35: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.1.1 on FastEthernet0/0 from LOADING to FULL, Loading
Done

R1#
00:09:38: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.1.2 on FastEthernet0/0 from LOADING to FULL, Loading
Done

R1 and R2 formed adjacency over their fast Ethernet interfaces.

To see the default dead time on the fa0/0 interface of router R1:

Page | 47
R1#sh ip ospf int fa0/0
FastEthernet0/0 is up, line protocol is up
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

R1#

From the output, we see that the Hello time is 10 seconds, dead time is 40 seconds.
We want to double this Dead value using the command ip ospf dead-interval or ip osfp hello-interval.
By default, the dead time is four times of hello times in ospf.
So, if we double the hello time, dead time will be dynamically be doubled.
Since hello time is 10 seconds on a broadcast segment, we could put 20 here.

R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int fa0/0
R1(config-if)#ip ospf hello-interval 20
R1(config-if)#^Z
R1#
R1#sh ip ospf int fa0/0
Timer intervals configured, Hello 20, Dead 80, Wait 80, Retransmit 5
R1#

R2#
00:24:30: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.1.1 on FastEthernet0/0 from FULL to DOWN, Neighbor
Down: Dead timer expired

00:24:30: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.1.1 on FastEthernet0/0 from FULL to Down: Interface
down or detached
R2#

From the output, we see that the dead time is double now.
Now we have a problem with adjacency.

R1#sh ip ospf neighbor


R1#

The adjacency went down,because we have configured hello time which effected on router R2.
To see the default dead time on the interface fa0/0 of R2 router:

R2#sh ip ospf int fa0/0


Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
R2#

Using the command ip ospf hello on R2’s fa0/0 interface to double the hello time:

Page | 48
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#int fa0/0
R2(config-if)#ip ospf hell
R2(config-if)#ip ospf hello-interval 20
R2(config-if)#^Z
R2#
%SYS-5-CONFIG_I: Configured from console by console

00:35:40: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.1.1 on FastEthernet0/0 from EXCHANGE to FULL,


Exchange Done

R2#

R2#sh ip ospf int fa0/0


Timer intervals configured, Hello 20, Dead 80, Wait 80, Retransmit 5
R2#

Note, both hello and dead timer now have changed.


R1#
00:35:44: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.1.2 on FastEthernet0/0 from EXCHANGE to FULL,
Exchange Done

And we see that, adjacency again formed between R1 and R2 routers.

Page | 49
Practical No.6

Configure DHCP.(Using Packet Tracer)


Four steps occur sequentially when a client requests addressing information:

1. When client wants to get ip address via DHCP, it generates dhcp discover.
The client broadcasts a DHCPDISCOVER message on its local physical subnet.
The DHCPDISCOVER message may include options that suggest values for the network address and lease
duration.
DHCPDISCOVER is a UDP broadcast message type.
2. One or more servers may answer on it with dhcp offer.
Each server may respond with a DHCPOFFER message that includes an available network address in the
"ipaddr" field (and other configuration parameters in DHCP options).
The server unicasts the DHCPOFFER message to the client (using the DHCP/BOOTP relay agent if
necessary) if possible, or may broadcast the message to a broadcast address (preferably 255.255.255.255)
on the client's subnet.
3. When client choice from what server it want ip address, and generate dhcp request, in which set ip address
selected server.
The client chooses one reply and responds to the server with aDHCPREQUEST.
DHCPREQUEST is a UDP broadcast message type.
4. The server acknowledges the request with a DHCPACK.

Features of DHCP:

1. DHCP messages from a client to a server are sent to the DHCP server port (UDP port 67), and DHCP
messages from a server to a client are sent to the DHCP client port (UDP port 68).
2. DHCP is used to provide IP information to hosts on your network. DHCP can provide a lot of information,
but the most common is IP address, subnet mask, default gateway, and DNS information.
3. The DHCP Discover message uses UDP as it is the transport layer protocol. i.e. DHCP is connectionless.
4. DHCP also called the Host-to-Host layer.
5. The DHCP Discover message uses FF-FF-FF-FF-FF as the Layer 2 destination address.

Page | 50
6. A client that sends out a DHCP Discover message in order to receive an IP address sends out a broadcast at
both layer 2 and layer 3. The layer 2 broadcast is all Fs in hex, or FF:FF:FF:FF:FF:FF. The layer 3
broadcast is 255.255.255.255, which means all networks and all hosts.
7. DHCP clients lease their IP addresses from DHCP servers. When this lease expires, that IP address can no
longer be utilized by the DHCP client. For that reason, DHCP client must periodically renew their IP
address leases, preferably before the lease has expired or is about to expire.
The default lease period is 30 days.The default ping timeout is 500 milliseconds.
8. DHCP allows for both private and public addressing.
9. A DHCP server uses a ping to detect address conflicts.

DHCP Commands:

1. ipdhcp pool command creates a DHCP address pool.


Or
To create a DHCP server pool, use the ipdhcp pool command.
2. network command is used to specify the range of addresses.
3. ip address dhcp command is used to acquire a DHCP address on a router’s interface.
4. showipdhcp binding command is used to see the assigned DHCPaddresses.
5. clearipdhcp binding * command is used to clear DHCPaddresses on the server.
6. DHCP's other commands domain-name, dns-server, netbios-name-server,defaultrouter, and lease.
7. ipconfig/release command is used to terminate a PC’s DHCP-assigned lease.

DHCP Lab with Packet Tracer

Configure DHCP services on a Cisco Router with following information


Network: 192.168.10.0 255.255.255.0
Gateway Address: 192.168.10.1
DNS Server: 4.2.2.2

Page | 51
DHCP pool: 192.168.10.2 to 192.168.10.4
Excluded Address: 192.168.10.5 to 192.168.10.80

Configure router

Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#intfa 0/0
Router(config-if)#ip address 192.168.10.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit

Configure DHCP

Router(config)#ipdhcp ?
excluded-address Prevent DHCP from assigning certain addresses
pool Configure DHCP address pools
Router(config)#ipdhcp pool ?
WORD Pool name
Router(config)#ipdhcp pool mypool
Router(dhcp-config)# network 192.168.10.0 255.255.255.0
Router(dhcp-config)#default-router ?
A.B.C.D Router's IP address
Router(dhcp-config)#default-router 192.168.10.1 ?
<cr>
Router(dhcp-config)#default-router 192.168.10.1
Router(dhcp-config)#dns-server ?
A.B.C.D Setip address of DNS server
Router(dhcp-config)#dns-server 4.2.2.2
Router(dhcp-config)#exit

Router(config)#ipdhcp ?
excluded-address Prevent DHCP from assigning certain addresses
pool Configure DHCP address pools
Router(config)#ipdhcp excluded-address ?
A.B.C.D Low IP address
Router(config)#ipdhcp excluded-address 192.168.10.1
Router(config)#ipdhcp excluded-address 192.168.10.5 ?
A.B.C.D High IP address
<cr>
Router(config)#ipdhcp excluded-address 192.168.10.5 192.168.10.80
Router(config)#^Z
Router#

View the assigned DHCP addresses

Page | 52
Router#showipdhcp binding
IP address Client-ID/ Lease expiration Type
Hardware address
192.168.10.2 00E0.F9BE.AD2D -- Automatic
192.168.10.3 0090.2185.88DD -- Automatic
192.168.10.4 0001.6450.50D8 -- Automatic
Router#

Click PC1/ IP Configuration /DHCP

Click PC2/ IP Configuration /DHCP

Click PC3/ IP Configuration /DHCP

Page | 53
Click PC1/ Command Prompt

PC>ipconfig /all
Physical Address ................. 00E0.F9BE.AD2D
IP Address. .................... : 192.168.10.2
Subnet Mask.................... : 255.255.255.0
Default Gateway ................ : 192.168.10.1
DNS Servers.................... : 4.2.2.2
PC>

Click PC2/ Command Prompt

PC>ipconfig /all
Physical Address................: 0090.2185.88DD
IP Address. .................... : 192.168.10.3
Subnet Mask.................... : 255.255.255.0
Default Gateway ................ : 192.168.10.1
DNS Servers.................... : 4.2.2.2
PC>

Click PC3/ Command Prompt

PC>ipconfig /all
Physical Address................: 0001.6450.50D8
IP Address. .................... : 192.168.10.4
Subnet Mask.................... : 255.255.255.0
Default Gateway ................ : 192.168.10.1
DNS Servers.................... : 4.2.2.2
PC>

Page | 54
Practical 07

Configuration of DNS server using Cisco Packet Tracer.

Topology:

Above topology have 2 networks; 192.168.1.0 and 192.168.2.0 are the network addresses.

Configuration of Router: Set ip address on both the interface of Router.

Router>enable
Router#conf t
Router (config)# int fa0/0
Router (config-if)# ip address 192.168.1.1 255.255.255.0
Router (config-if)# no shut
Router (config-if)# exit

Router#conf t
Router (config)# int fa0/1
Router (config-if)# ip address 192.168.2.1 255.255.255.0
Router (config-if)# no shut
Router (config-if)# exit

Page | 55
Setting ip address on Host machine(PC):

Setting IP address to respective servers (HTTP, DNS and FTP):

Page | 56
Configure HTTP server:

Enable service of HTTP server and make some changes in index.html file as follows :

Page | 57
Page | 58
Configuration of DNS server:

Enable the service of DNS server and add record (domain name and ip address of

particular website). In this we have used domain name as modelcollege.com and ip address

192.168.2.2

Testing of DNS server:

Go to PC-> Browser -> and type modelcollege.com:

Page | 59
Conclusion: Hence we have successfully implemented DNS server in Cisco

Packet Tracer.

Page | 60
Practical 08

Configuration of OSPF with multiple areas.

Topology:

Configuration of Routers:

Router 0:

Router>enable
Router#conf t
Router(config)# int fa0/0
Router(config-if)# ip address 192.168.1.100 255.255.255.0
Router(config-if)# no shut
Router(config-if)# exit
Router(config)# int se1/0
Router(config-if)# ip address 10.0.0.1 255.0.0.0
Router(config-if)# no shut
Router(config-if)# exit

Page | 61
Router 1:
Router>enable
Router#conf t
Router(config)# int fa0/0
Router(config-if)# ip address 192.168.2.100 255.255.255.0
Router(config-if)# no shut
Router(config-if)# exit
Router(config)# int se1/0
Router(config-if)# ip address 10.0.0.2 255.0.0.0
Router(config-if)# no shut
Router(config-if)# exit
Router(config)# int se1/1
Router(config-if)# ip address 11.0.0.1 255.0.0.0
Router(config-if)# no shut
Router(config-if)# exit

Router 2:
Router>enable
Router#conf t
Router(config)# int fa0/0
Router(config-if)# ip address 192.168.3.100 255.255.255.0
Router(config-if)# no shut
Router(config-if)# exit
Router(config)# int se1/0
Router(config-if)# ip address 11.0.0.2 255.0.0.0
Router(config-if)# no shut
Router(config-if)# exit

Setting IP address on PC:

PC0

Page | 62
PC1

Page | 63
PC2

PC3

PC4

Page | 64
PC5

Configuration of OSPF on Router 0:

Router0>enable
Router1#conf t
Page | 65
Router0(config)#Router ospf 1
Router0(router-config)#network 192.168.1.0 0.0.0.255 area 10
Router0(router-config)#network 10.0.0.0 0.255.255.255 area 10
Router0(router-config)# exit

Configuration of OSPF on Router 2:

Router2>enable
Router2#conf t
Router2(config)#Router ospf 2
Router2(router-config)#network 192.168.3.0 0.0.0.255 area 20
Router2(router-config)#network 11.0.0.0 0.255.255.255 area 20
Router2(router-config)# exit

Configuration of OSPF on Router 1:

Router1>enable
Router1#conf t
Router1(config)#Router ospf 3
Router1(router-config)#network 192.168.2.0 0.0.0.255 area 0
Router1(router-config)#network 10.0.0.0 0.255.255.255 area 10
Router1(router-config)#network 11.0.0.0 0.255.255.255 area 20
Router1(router-config)# exit

Check the connectivity by pinging one PC to another.

Conclusion: Hence we have successfully implemented OSPF with multiple


areas.

Page | 66
Practical No.9

Create Virtual PC based Network using Virtualization software and


Virtual NIC
Step1: Give IP address 192.168.1.3 on 1st Linux Machine as shown in Screen Shot.

Step 2: Check IP address with ifconfig command

Step 3: Go to 2nd Machine (Clone Machine) and give IP address 192.168.1.4 as shown in screen shot

Page | 67
Step 4: Check IP address with ifconfig command

Step 5: Check the network Connectivity by pinging 1st Machine with 2nd and Vice versa.

Page | 68
Page | 69
Practical 10:
Use of Wireshark to scan and check the packet information of following
protocols
• HTTP
• ICMP
• TCP
• SMTP
• POP3

Step 1) Downloading and Installing Wireshark

Step 2) How to Capture Data Packets


When you first launch Wireshark a welcome screen similar to the one shown above should be visible, containing a
list of available network connections on your current device. In this example, you'll notice that the following
connection types are shown: Bluetooth Network Connection, Ethernet, VirtualBox Host-Only Network, Wi-Fi.
Displayed to the right of each is an EKG-style line graph that represents live traffic on that respective network.

To begin capturing packets, first select one or more of these networks by clicking on your choice(s) and using the
Shift or Ctrl keys if you'd like to record data from multiple networks simultaneously. Once a connection type is
selected for capturing purposes, its background will be shaded in either blue or gray. Click on Capture from the
main menu, located towards the top of the Wireshark interface. When the drop-down menu appears, select the Start
option.

You can also initiate packet capturing via one of the following shortcuts.

Keyboard: Press Ctrl + E


Mouse: To begin capturing packets from one particular network, simply double-click on its name
Toolbar: Click on the blue shark fin button, located on the far left-hand side of the Wireshark toolbar
The live capture process will now begin, with packet details displayed in the Wireshark window as they are
recorded. Perform one of the actions below to stop capturing.

Keyboard: Press Ctrl + E


Toolbar: Click on the red stop button, located next to the shark fin on the Wireshark toolbar

Page | 70
Step 3) Viewing and Analyzing Packet Contents

Now that you've recorded some network data it's time to take a look at the captured packets. As shown in the
screenshot above, the captured data interface contains three main sections: The packet list pane, the packet details
pane, and the packet bytes pane.

Packet List
The packet list pane, located at the top of the window, shows all packets found in the active capture file. Each
packet has its own row and corresponding number assigned to it, along with each of these data points.

Time: The timestamp of when the packet was captured is displayed in this column, with the default format being the
number of seconds (or partial seconds) since this specific capture file was first created. To modify this format to
something that may be a bit more useful, such as the actual time of day, select the Time Display Format option from
Wireshark's View menu - located at the top of the main interface.

Source: This column contains the address (IP or other) where the packet originated.
Destination: This column contains the address that the packet is being sent to.
Protocol: The packet's protocol name (i.e., TCP) can be found in this column.
Length: The packet length, in bytes, is displayed in this column.
Info: Additional details about the packet are presented here. The contents of this column can vary greatly depending
on packet contents.

Packet Details
The details pane, found in the middle, presents the protocols and protocol fields of the selected packet in a
collapsible format. In addition to expanding each selection, you can also apply individual Wireshark filters based on
specific details as well as follow streams of data based on protocol type via the details context menu – accessible by
right-clicking your mouse on the desired item within this pane.

Packet Bytes
At the bottom is the packet bytes pane, which displays the raw data of the selected packet in a hexadecimal view.
This hex dump contains 16 hexadecimal bytes and 16 ASCII bytes alongside the data offset.

Selecting a specific portion of this data automatically highlights its corresponding section in the packet details pane
and vice versa. Any bytes that cannot be printed are instead represented by a period.

Page | 71
You can choose to show this data in bit format as opposed to hexadecimal by right-clicking anywhere within the
pane and selecting the appropriate option from the context menu.

Step 4) Using Wireshark Filters


One of the most important feature sets in Wireshark is its filter capabilities, especially when you're dealing with
files that are significant in size. Capture filters can be set before the fact, instructing Wireshark to only record those
packets that meet your specified criteria.

Filters can also be applied to a capture file that has already been created so that only certain packets are shown.
These are referred to as display filters.

Wireshark provides a large number of predefined filters by default, letting you narrow down the number of visible
packets with just a few keystrokes or mouse clicks. To use one of these existing filters, place its name in the Apply
a display filter entry field (located directly below the Wireshark toolbar) or in the Enter a capture filter entry field
(located in the center of the welcome screen).

There are multiple ways to achieve this. If you already know the name of your filter, simply type it into the
appropriate field. For example, if you only wanted to display TCP packets you would type tcp. Wireshark's
autocompleting feature will show suggested names as you begin typing, making it easier to find the correct moniker
for the filter you're seeking.

Another way to choose a filter is to click on the bookmark-like icon positioned on the left-hand side of the entry
field. This will present a menu containing some of the most commonly-used filters as well as an option to Manage
Capture Filters or Manage Display Filters. If you choose to manage either type an interface will appear allowing
you to add, remove or edit filters.

You can also access previously-used filters by selecting the down arrow, located on the right-hand side of the entry
field, which displays a history drop-down list.

Once set, capture filters will be applied as soon as you begin recording network traffic. To apply a display filter,
however, you'll need to click on the right arrow button found on the far-right hand side of the entry field.

Page | 72
Step 5) Colouring Rules

While Wireshark's capture and display filters allow you to limit which packets are recorded or shown on the screen,
its colorization functionality takes things a step further by making it easy to distinguish between different packet
types based on their individual hue. This handy feature lets you quickly locate certain packets within a saved set by
their row's color scheme in the packet list pane.

Wireshark comes with about 20 default coloring rules built in; each which can be edited, disabled, or deleted if you
wish. You can also add new shade-based filters through the coloring rules interface, accessible from the View
menu. In addition to defining a name and filter criteria for each rule, you are also asked to associate both a
background color and a text color. Packet colorization can be toggled off and on via the Colorize Packet List option,
also found within the View menu.

Page | 73
Page | 74

You might also like