[go: up one dir, main page]

0% found this document useful (0 votes)
41 views13 pages

Practical-8 Dynamic Routing Using CLI

Uploaded by

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

Practical-8 Dynamic Routing Using CLI

Uploaded by

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

Practical 8

Dynamic Routing using CLI

Router 0 – Left Router


Router>enable

Router#configure terminal

Router(config)#int fa0/0

Router(config-if)#ip add 192.168.1.4 255.255.255.0

Router(config-if)#no shutdown

Router(config-if)#int s 0/0/0
Router(config-if)#ip add 192.168.3.2 255.255.255.0

Router(config-if)#no shutdown

Router 2 - Middle Router


Router>enable

Router#config terminal

Router(config)#int fa 0/0

Router(config-if)#ip add 192.168.5.4 255.255.255.0

Router(config-if)#no shutdown

Router(config-if)#int s 0/0/0

Router(config-if)#ip add 192.168.3.3 255.255.255.0

Router(config-if)#no shutdown

Router(config)#int s 0/1/0

Router(config-if)#ip add 192.168.4.2 255.255.255.0

Router(config-if)#no shutdown

Router 1 – Right Router


Router>enable

Router#config terminal
Router(config)#int fa 0/0

Router(config-if)#ip add 192.168.2.4 255.255.255.0

Router(config-if)#no shutdown

Router(config-if)#int s 0/0/0

Router(config-if)#ip add 192.168.4.3 255.255.255.0

Router(config-if)#no shutdown

Router 0 – Left Router


Router(config)#router rip

Router(config-router)#network 192.168.1.0

Router(config-router)#network 192.168.3.0

Router 2 - Middle Router


Router(config)#router rip

Router(config-router)#network 192.168.3.0

Router(config-router)#network 192.168.4.0

Router(config-router)#network 192.168.5.0
Router 1 – Right Router
Router(config)#router rip

Router(config-router)#network 192.168.2.0

Router(config-router)#network 192.168.4.0

Configuring RIPv2
Configuring RIPv2 is a pretty straightforward process. Only three steps are required:

1. enabling RIP by using the router rip global configuration command


2. instructing the router to use RIPv2 by typing the version 2 command
3. telling RIP which networks to advertise by using one or more network commands.

So, the configuration on R1 should look like this:

R1(config)#router rip

R1(config-router)#version 2

R1(config-router)#network 10.0.0.0

R1(config-router)#network 172.16.0.0
The configuration on R2 looks similar, but with different network number for the directly
connected subnet:

R2(config)#router rip

R2(config-router)#version 2

R2(config-router)#network 192.168.0.0

R2(config-router)#network 172.16.0.0

You can verify that router R1 has a route to R2’s directly connected subnet by typing the
show ip route command:

Router#show ip route

Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

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

P - periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/24 is subnetted, 1 subnets

C 10.0.1.0 is directly connected, FastEthernet0/0


C 172.16.0.0/16 is directly connected, FastEthernet0/1

R 192.168.0.0/24 [120/1] via 172.16.0.2, 00:00:25, FastEthernet0/1

The legend lists R for all RIP routes in the routing table. Also note that the administrative
distance of 120 is shown, together with the metric of 1.

The show ip route Command Explained

The 'show ip route' command displays the structure and contents of the routing table. You
can use the 'show ip route' for the following purposes.

• To list the routing table's entries


• To view how many routes available for a particular destination
• To view the route the router uses to forward data packets for a specific destination
• To know the routes added by a routing protocol
• To know the routes added by the router from the IP configurations
• To view the current status of a route
• To verify and troubleshoot the routing

To use the 'show ip route' command, enter privileged-exec mode and run the following
command.

#show ip route

The output of this command is organized into three sections. These sections are Codes,
Default route, and Routes. The following image shows the output of this command.
Codes

The routing table uses the abbreviated code to store the type of route. This section displays
the meaning of each abbreviated code.

Default route

This section displays the default route. The router uses the routing table's routes to forward
data packets. If there is no route available for the destination address of a data packet, the
router uses the default route to forward the data packet. If the default route is not set, the
router discards the data packet.

Routes

The routing table puts all routes in this section. To arrange routes, the routing table uses
blocks. Each block contains a classful network and the classless networks created from the
classful network. If a classful network is subnetted into small classless networks and the
router knows the routes for the classless networks, the routing table uses a heading to group
all classless networks of the same classful network.

The routing table uses the heading for a classful network only if it knows more than one
route for the classful network. If there is only one route for the network, the routing table
adds the route without the heading.
The following image shows routes with the heading and without the heading.

The heading includes three things: the classful network, the total number of subnets, and the
total number of masks used to create the subnets. Let's understand these things.

The classful network

The routing table organizes routes by classful networks. If a classful network is subnetted
into classless networks and the routes for the classless networks are available, the router
arranges all classless networks under the classful network.

Total number of subnets

A router learns routes from various sources. This part shows the total number of routes the
router learned from all sources for the classful network. The total number includes all routes
for the classful network and all classless networks created from the same classful network.

When you assign an IP configuration to the interface, the router automatically creates two
routes from the IP configuration and adds them to the routing table. The router adds the first
route for the network address of the IP configuration. The router uses this route to forward
data packets. The router adds the second route for the interface. The router uses this route
to reach the interface. The router uses the prefix /32 for this route.

Total number of masks

This is the total number of different masks used in all routes for all subnets created from the
classful network mentioned in the heading.

The routing table uses a heading to organize all routes created from the same classful
network. We have already discussed the things the routing table uses to create the heading.
Now let's discuss the things the routing table uses to build route entries.
Legend code

The legend code is the first thing in a route entry. A router can learn a route from various
sources. The legend code shows the source from which the router learned the route. The
routing table stores the legend code in the abbreviated form. The first section of the output
of the 'show ip route' command shows the meaning of each code.

Network address / Subnet mask

Each route reaches a specific destination. Each route entry includes only one destination
network. After the legend code, the routing table places the destination network address with
the subnet mask in the route entry.
Routers use the routing table to make a forwarding decision. A router compares the
destination address of the data packet to the network address stored in each entry of the
routing table. If the network address mentioned in an entry matches the destination address
of the data packet, the router forwards the data packet from the interface or to the next-hop
router's interface mentioned the matching entry.

To learn how this process works or how routers take a routing decision, you can check the
following tutorial.

Routing Decision Longest Match Explained

AD(Administrative Distance)/Metric
The routing table stores only one route for each destination. If the router learns more than
one route for a destination from different sources, the router adds only the best route to the
routing table. To select the best route, the router uses the AD (Administrative Distance)
value.

The AD value is the trustworthiness of a source. A source with a lower AD value is


considered more reliable than a source with a higher AD value.

Let's take an example. A router learned two routes for the same destination. The AD value
of the first source is 10 and the AD value of the second source is 20. The router will add the
route learned from the first source to the routing table.

A router can also learn more than one route from the same source. If the router learns more
than one route for a destination from the same source, the router uses the metric value of the
routes to select the best route. Sources use the metric value to calculate the best route for the
destination.

In simple words, a router uses the AD value to select the best route learned from different
sources and the metric value to select the best route learned from the same source.
The IP address of the next-hop router

This is the IP address of the next-hop router. A router forwards the packet to the next-hop
router if the destination address and the address specified in the route match.

You might also like