Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

ROUTING

Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

CCNA

Routing Fundamentals
Things we’ll cover

What is routing?

The routing table on a Cisco router
→Connected and Local routes

Routing fundamentals (route selection)
What is routing?

Routing is the process that routers use to determine the path that IP packets should take over a network to reach their destination.
→Routers store routes to all of their known destinations in a routing table.
→When routers receive packets, they look in the routing table to find the best route to forward that packet.


There are two main routing methods (methods that routers use to learn routes):
Dynamic Routing: Routers use dynamic routing protocols (ie. OSPF) to share routing information with each other automatically and build
their routing tables.
→We will cover this later in the course.
next-hop = the next router in
Static Routing: A network engineer/admin manually configures routes on the router. the path to the destination.
→We will cover this in the next video.


A route tells the router: to send a packet to destination X, you should send the packet to next-hop Y.
→or, if the destination is directly connected to the router, send the packet directly to the destination.
→or, if the destination is the router’s own IP address, receive the packet for yourself (don’t forward it).


In the next video, we will configure static routes on the routers to allow PC1 and PC4 to communicate with each other.
→This video will focus on two types of routes automatically added to a router’s routing table.
R1 R3 WAN (Wide Area Network) =
LAN WAN a network that extends over a
G0/0 G0/0 large geographical area.
PC1 G0/2
.10 .1 .1 192.168.13.0/24 .3
G0/1 .1 .3 G0/1
192.168.1.0/24 192.168.12.0/24 192.168.34.0/24 LAN
G0/0 192.168.4.0/24
.2 .4 G0/1
.4 .10
R2 G0/1 G0/0 G0/2 PC4
.2 192.168.24.0/24 .4 R4
R1 Pre-configurations (IP Addresses)
R1# conf t
R1(config)# interface g0/0
R1(config-if)# ip address 192.168.13.1 255.255.255.0 There is no need to use exit to return to global config
R1(config-if)# no shutdown mode before entering interface g0/1. You can use
the interface g0/1 command directly from interface
R1(config-if)# interface g0/1 config mode.
R1(config-if)# ip address 192.168.12.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# interface g0/2
R1(config-if)# ip address 192.168.1.1 255.255.255.0
R1(config-if)# no shutdown
R1# show ip int br
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 192.168.13.1 YES manual up up
GigabitEthernet0/1 192.168.12.1 YES manual up up
GigabitEthernet0/2 192.168.1.1 YES manual up up
GigabitEthernet0/3 unassigned YES NVRAM administratively down down
R1 R3

PC1 G0/2 G0/0 G0/0


.10 .1 .1 192.168.13.0/24 .3
G0/1 .1 .3 G0/1
192.168.1.0/24 192.168.12.0/24 192.168.34.0/24
G0/0 .2 192.168.4.0/24
.4 G0/1
.4 .10
R2 G0/1 G0/0 G0/2 PC4
.2 192.168.24.0/24 .4 R4
Routing Table (show ip route)
R1# show ip route Use the command show ip route to view the routing table. The Codes legend in the output of show ip
route lists the different protocols which
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area routers can use to learn routes.
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2 ・ L - local
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 →A route to the actual IP address configured
ia - IS-IS inter area, * - candidate default, U - per-user static route on the interface. (with a /32 netmask)
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP ・ C - connected
a - application route → A route to the network the interface is
+ - replicated route, % - next hop override, p - overrides from PfR connected to. (with the actual netmask
configured on the interface)
Gateway of last resort is not set

192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks


C 192.168.1.0/24 is directly connected, GigabitEthernet0/2 When you configure an IP address on an
L 192.168.1.1/32 is directly connected, GigabitEthernet0/2 interface and enable it with no shutdown, 2
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks routes (per interface) will automatically be added
C 192.168.12.0/24 is directly connected, GigabitEthernet0/1 to the routing table:
L 192.168.12.1/32 is directly connected, GigabitEthernet0/1 →a connected route
192.168.13.0/24 is variably subnetted, 2 subnets, 2 masks →a local route
C 192.168.13.0/24 is directly connected, GigabitEthernet0/0
L 192.168.13.1/32 is directly connected, GigabitEthernet0/0
R1 R3

PC1 G0/2 G0/0 G0/0


.10 .1 .1 192.168.13.0/24 .3
G0/1 .1 .3 G0/1
192.168.1.0/24 192.168.12.0/24 192.168.34.0/24
G0/0 .2 192.168.4.0/24
.4 G0/1
.4 .10
R2 G0/1 G0/0 G0/2 PC4
.2 192.168.24.0/24 .4 R4
Connected and Local routes
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/2
L 192.168.1.1/32 is directly connected, GigabitEthernet0/2
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, GigabitEthernet0/1
L 192.168.12.1/32 is directly connected, GigabitEthernet0/1
192.168.13.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.13.0/24 is directly connected, GigabitEthernet0/0
L 192.168.13.1/32 is directly connected, GigabitEthernet0/0

A connected route is a route to the network the interface is connected to.

R1 G0/2 IP = 192.168.1.1/24

Network Address = 192.168.1.0/24

It provides a route to all hosts in that network (ie. 192.168.1.10, 192.168.1.100, 192.168.1.232, etc.)

R1 knows: “If I need to send a packet to any host in the 192.168.1.0/24 network, I should send it out of G0/2”.


A local route is a route to the exact IP address configured on the interface.

A /32 netmask is used to specify the exact IP address of the interface.
→/32 means all 32 bits are ‘fixed’, they can’t change.

Even though R1’s G0/2 is configured as 192.168.1.1/24, the connected route is to 192.168.1.1/32.

R1 knows: “If I receive a packet destined for this IP address, the message is for me”.

R1 R3

PC1 G0/2 G0/0 G0/0


.10 .1 .1 192.168.13.0/24 .3
G0/1 .1 .3 G0/1
192.168.1.0/24 192.168.12.0/24 192.168.34.0/24
G0/0 .2 192.168.4.0/24
.4 G0/1
.4 .10
R2 G0/1 G0/0 G0/2 PC4
.2 192.168.24.0/24 .4 R4
Connected and Local routes

192 . 168 . 1 . 0 /24


255 . 255 . 255 . 0
=FIXED (can’t change) =not fixed
C 192.168.1.0/24 is directly connected, GigabitEthernet0/2
192.168.1.2 = match
→Send packet out of G0/2
192.168.1.7 = match

192.168.1.0/24 matches 192.168.1.0 ~ 192.168.1.255. →Send packet out of G0/2
→If R1 receives a packet with a destination in that range, it will 192.168.1.89 = match
send the packet out of G0/2. →Send packet out of G0/2
A route matches a packet’s destination if the packet’s destination 192.168.2.1 = no match
IP address is part of the network specified in the route. →Send the packet using a different route, or
drop the packet if there is no matching route.
Connected and Local routes

192 . 168 . 1 . 1 /32


255 . 255 . 255 . 255
=FIXED (can’t change)

192.168.1.1/32 matches ONLY 192.168.1.1


Route Selection
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/2
L 192.168.1.1/32 is directly connected, GigabitEthernet0/2


A packet destined for 192.168.1.1 is matched by both routes: When R1 receives a packet destined for 192.168.1.1,
192.168.1.0/24 it will select the route to 192.168.1.1/32.
→R1 will receive the packet for itself, rather than
192.168.1.1/32
forward it out of G0/2.
Local route = keep the packet, don’t forward

Which route will R1 use for a packet destined for 192.168.1.1?
→It will choose the most specific matching route.


The route to 192.168.1.0/24 includes 256 different IP addresses (192.168.1.0 – 192.168.1.255)

The route to 192.168.1.1/32 includes only 1 IP address (192.168.1.1)
→This route is more specific.


Most specific matching route = the matching route with the longest prefix length.

R1 PACKET R3
Dst. IP: 192.168.1.1

PC1 G0/2 G0/0 G0/0


.10 .1 .1 192.168.13.0/24 .3
G0/1 .1 .3 G0/1
192.168.1.0/24 192.168.12.0/24 192.168.34.0/24
G0/0 .2 192.168.4.0/24
.4 G0/1
.4 .10
R2 G0/1 G0/0 G0/2 PC4
.2 192.168.24.0/24 .4 R4
Route Selection
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/2
L 192.168.1.1/32 is directly connected, GigabitEthernet0/2
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, GigabitEthernet0/1
L 192.168.12.1/32 is directly connected, GigabitEthernet0/1
192.168.13.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.13.0/24 is directly connected, GigabitEthernet0/0
L 192.168.13.1/32 is directly connected, GigabitEthernet0/0


These three lines are not routes. They mean the following:
● 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
→In the routing table, there are two routes to subnets that fit within the 192.168.1.0/24 Class C network, with two different netmasks (/24 and /32).
● 192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
→In the routing table, there are two routes to subnets that fit within the 192.168.12.0/24 Class C network, with two different netmasks (/24 and /32).
● 192.168.13.0/24 is variably subnetted, 2 subnets, 2 masks
→In the routing table, there are two routes to subnets that fit within the 192.168.13.0/24 Class C network, with two different netmasks (/24 and /32).

We will cover subnetting soon (in another video)! For now, I just wanted to point out that these three lines are not routes.

R1 R3

PC1 G0/2 G0/0 G0/0


.10 .1 .1 192.168.13.0/24 .3
G0/1 .1 .3 G0/1
192.168.1.0/24 192.168.12.0/24 192.168.34.0/24
G0/0 .2 192.168.4.0/24
.4 G0/1
.4 .10
R2 G0/1 G0/0 G0/2 PC4
.2 192.168.24.0/24 .4 R4
Route Selection Practice (1)
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/2
L 192.168.1.1/32 is directly connected, GigabitEthernet0/2
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, GigabitEthernet0/1
L 192.168.12.1/32 is directly connected, GigabitEthernet0/1
192.168.13.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.13.0/24 is directly connected, GigabitEthernet0/0
L 192.168.13.1/32 is directly connected, GigabitEthernet0/0

R1

.1 .1
192.168.1.0/24 192.168.13.0/24
PACKET 1 G0/2 G0/0
Dst. IP: 192.168.1.1

.1
G0/1
1) Dst. IP 192.168.1.1
→Receive for myself

192.168.12.0/24
Route Selection Practice (2)
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/2
L 192.168.1.1/32 is directly connected, GigabitEthernet0/2
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, GigabitEthernet0/1
L 192.168.12.1/32 is directly connected, GigabitEthernet0/1
192.168.13.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.13.0/24 is directly connected, GigabitEthernet0/0
L 192.168.13.1/32 is directly connected, GigabitEthernet0/0

R1

.1 .1
192.168.1.0/24 192.168.13.0/24
PACKET 2 G0/2 G0/0
Dst. IP: 192.168.13.3

.1
G0/1
1) Dst. IP 192.168.1.1
→Receive for myself
2) Dst. IP 192.168.13.3
192.168.12.0/24 →Send to the destination (connected to G0/0)
Route Selection Practice (3)
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/2
L 192.168.1.1/32 is directly connected, GigabitEthernet0/2
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, GigabitEthernet0/1
L 192.168.12.1/32 is directly connected, GigabitEthernet0/1
192.168.13.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.13.0/24 is directly connected, GigabitEthernet0/0
L 192.168.13.1/32 is directly connected, GigabitEthernet0/0

R1

.1 .1
192.168.1.0/24 192.168.13.0/24
G0/2 G0/0

.1
G0/1
1) Dst. IP 192.168.1.1
→Receive for myself
2) Dst. IP 192.168.13.3
192.168.12.0/24 →Send to the destination (connected to G0/0)
3) Dst. IP 192.168.1.244
→Send to the destination (connected to G0/2)

PACKET 3
Dst. IP: 192.168.1.244
Route Selection Practice (4)
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/2
L 192.168.1.1/32 is directly connected, GigabitEthernet0/2
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, GigabitEthernet0/1
L 192.168.12.1/32 is directly connected, GigabitEthernet0/1
192.168.13.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.13.0/24 is directly connected, GigabitEthernet0/0
L 192.168.13.1/32 is directly connected, GigabitEthernet0/0

R1

.1 .1
192.168.1.0/24 192.168.13.0/24
G0/2 G0/0
PACKET 4
Dst. IP: 192.168.12.1
.1
G0/1
1) Dst. IP 192.168.1.1
→Receive for myself
2) Dst. IP 192.168.13.3
192.168.12.0/24 →Send to the destination (connected to G0/0)
3) Dst. IP 192.168.1.244
→Send to the destination (connected to G0/2)
4) Dst. IP 192.168.12.1
→Receive for myself
Route Selection Practice (5)
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/2
L 192.168.1.1/32 is directly connected, GigabitEthernet0/2
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, GigabitEthernet0/1
L 192.168.12.1/32 is directly connected, GigabitEthernet0/1
192.168.13.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.13.0/24 is directly connected, GigabitEthernet0/0
L 192.168.13.1/32 is directly connected, GigabitEthernet0/0

R1

.1 .1
192.168.1.0/24 192.168.13.0/24
G0/2 G0/0
PACKET 5
Dst. IP: 192.168.4.10
X
.1
G0/1
1) Dst. IP 192.168.1.1
→Receive for myself
2) Dst. IP 192.168.13.3
192.168.12.0/24 →Send to the destination (connected to G0/0)
3) Dst. IP 192.168.1.244
→Send to the destination (connected to G0/2)
4) Dst. IP 192.168.12.1
→Receive for myself
5) Dst. IP 192.168.4.10
→Drop (no route)
Summary

Routers store information about destinations they know in their routing table.
→When they receive packets, the look in the routing table to find the best route to forward the packet.


Each route in the routing table is an instruction:
→To reach destinations in network X, send the packet to next-hop Y (the next router in the path to the destination).
→If the destination is directly connected (Connected route) send the packet directly to the destination.
→If the destination if your own IP address (Local route), receive the packet for yourself.
*We will look at how next-hops work in the next video on static routes.


When you configure an IP address on an interface and enable the interface, two routes are automatically added to the routing table:
Connected route (code C in the routing table): A route to the network connected to the interface.
→ie. if the interface’s IP is 192.168.1.1/24, the route will be to 192.168.1.0/24.
→Tells the router: “To send a packet to a destination in this network, send it out of the interface specified in the route”.

Local route (code L in the routing table): A route to the exact IP address configured on the interface.
→ie. if the interface’s IP is 192.168.1.1/24, the route will be to 192.168.1.1/32.
→Tells the router: “Packets to this destination are for you. You should receive them for yourself (not forward them)”.


A route matches a destination if the packet’s destination IP address is part of the network specified in the route.
→ie. a packet to 192.168.1.60 is matched by a route to 192.168.1.0/24, but not by a route to 192.168.0.0/24.


If a router receives a packet and it doesn’t have a route that matches the packet’s destination, it will drop the packet.
→This is different than switches, which flood frames if they don’t have a MAC table entry for the destination.


If a router receives a packet and it has multiple routes that match the packet’s destination, it will use the most specific matching route to
forward the packet.
→Most specific matching route = the matching route with the longest prefix length.
→This is different than switches, which look for an exact match in the MAC address table to forward frames.
Things we covered

What is routing?

The routing table on a Cisco router
→Connected and Local routes

Routing fundamentals (route selection)
Quiz 1

The IP address configured on a router interface will appear in the routing table as what kind of
route?

a) Static

b) Connected
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/2
c) Local L 192.168.1.1/32 is directly connected, GigabitEthernet0/2

d) Dynamic
Quiz 2
Examine R1’s routing table. What will it do when it receives a packet destined for 192.168.3.25?
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/0
L 192.168.1.1/32 is directly connected, GigabitEthernet0/0
192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.2.0/24 is directly connected, GigabitEthernet0/1
L 192.168.2.1/32 is directly connected, GigabitEthernet0/1
192.168.3.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.3.0/24 is directly connected, GigabitEthernet0/2
L 192.168.3.25/32 is directly connected, GigabitEthernet0/2

a) It will drop the packet.

b) It will receive the packet for itself.

c) It will forward the packet out of the G0/0 interface.

d) It will forward the packet out of the G0/2 interface.


Quiz 3
Which of the following statements about the behavior of routers and switches are true?
(select two)

a) Routers flood packets with an unknown destination.

b) Switches flood frames with an unknown destination.

c) Routers drop packets with an unknown destination.

d) Switches drop frames with an unknown destination.


Quiz 4
Which two types of routes are automatically added to the routing table when you configure an IP
address on an interface and enable it?
R1# show ip route

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


a) C, L 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
b) C, S i - IS-IS, su - IS-IS summary, 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, H - NHRP, l - LISP
a - application route
c) L, S + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set


d) L, D 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/0
L 192.168.1.1/32 is directly connected, GigabitEthernet0/0
Quiz 5
Examine R1’s routing table below. If R1 receives a packet destined for 10.0.1.23, how many routes match
that destination? And which is the most specific matching route?
10.0.0.0/24 is variably subnetted, 2 subnets, 2 masks
C 10.0.0.0/24 is directly connected, GigabitEthernet0/0
L 10.0.0.1/32 is directly connected, GigabitEthernet0/0
10.0.2.0/24 is variably subnetted, 2 subnets, 2 masks
C 10.0.2.0/24 is directly connected, GigabitEthernet0/1
L 10.0.2.23/32 is directly connected, GigabitEthernet0/1
10.0.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 10.0.1.0/24 is directly connected, GigabitEthernet0/2
L 10.0.1.23/32 is directly connected, GigabitEthernet0/2

a) One matching route: 10.0.1.0/24

b) One matching route: 10.0.1.23/32

c) Two matching routes: 10.0.1.0/24, 10.0.1.23/32. Most specific: 10.0.1.23/32.

d) Two matching routes: 10.0.1.0/24, 10.0.1.23/32. Most specific: 10.0.1.0/24.


JCNP-Level Channel Members

*as of December 20, 2022

You might also like