Chapter 9
Routing Protocols
Static
Observations
• We need a way to route data packets
over the network.
• How do the routers communicate or
exchange routes.
• How do we specify the next hop?
Routing Protocols
Static
Dynamic
- RIP, RIPv2
- IGRP
- OSPF
- EIGRP
Objective
The objective of this section is to demonstrate how data
packets are routed in a network using a static routing
protocol. The techniques for configuring static routes so
that data packets can be forwarded are presented.
A static route is a data traffic route that has been
manually entered into either a router’s or computer’s
routing table.
The routing table is a list of IP addresses where data
traffic can be forwarded.
A PC’s Static Route
A static route is specified in a PC computer in terms of
the computer’s default gateway and routers sometimes
uses a static route when specifying where the network
data traffic is to be forwarded.
Examples of specifying the static route(s) for a computer
are first examined.
Configuring the Gateway
PC MAC
Examining the PC’s Routing Table
Default Gateway – the most common
static route used by the PC
Specified in the TCP/IP set-up for the PC
The netstat –r command
also route print
The default route is specified in the routing table by a 0.0.0.0 Network Address entry
with a subnet mask of 0.0.0.0. The gateway address of 10.10.20.250 is the IP
address of the Ethernet port of the router connected to the LAN. The IP address of
10.10.20.1 for the interface is the IP address for the host computer’s network
interface card.
The netstat –r command
also route print
The default route is specified in the routing table by a 0.0.0.0 Network Address entry
with a subnet mask of 0.0.0.0. The gateway address of 10.10.20.250 is the IP
address of the Ethernet port of the router connected to the LAN. The IP address of
10.10.20.1 for the interface is the IP address for the host computer’s network
interface card.
The netstat –r command
also route print
The default route is specified in the routing table by a 0.0.0.0 Network Address entry
with a subnet mask of 0.0.0.0. The gateway address of 10.10.20.250 is the IP
address of the Ethernet port of the router connected to the LAN. The IP address of
10.10.20.1 for the interface is the IP address for the host computer’s network
interface card.
The netstat –r command
also route print
The default route is specified in the routing table by a 0.0.0.0 Network Address entry
with a subnet mask of 0.0.0.0. The gateway address of 10.10.20.250 is the IP
address of the Ethernet port of the router connected to the LAN. The IP address of
10.10.20.1 for the interface is the IP address for the host computer’s network
interface card.
The netstat –r command
also route print
The network destination of 10.10.20.0 is returned to the computer’s network
interface card at IP address 10.10.20.1. The gateway for the network destination of
10.10.20.1 is 127.0.0.1 which is a loopback to the host computer.
The netstat –r command
also route print
The network destination of 10.10.20.0 is returned to the computer’s network
interface card at IP address 10.10.20.1. The gateway for the network destination of
10.10.20.1 is 127.0.0.1 which is a loopback to the host computer.
The netstat –r command
also route print
The network destination of 10.10.20.0 is returned to the computer’s network
interface card at IP address 10.10.20.1. The gateway for the network destination of
10.10.20.1 is 127.0.0.1 which is a loopback to the host computer.
The netstat –r command
also route print
The network destination of 10.10.20.0 is returned to the computer’s network
interface card at IP address 10.10.20.1. The gateway for the network destination of
10.10.20.1 is 127.0.0.1 which is a loopback to the host computer.
The netstat –r command
also route print
A loopback means that the data is routed directly back to the source. In this
case, the source is the computer’s network interface card. The loopback can
be used to check that the network interfce is working. Pinging IP address
127.0.0.1 will generate a reply if the interface is working.
What about setting
static routes for a
router in a small
campus network.
First let’s examine
how data packets
travel from one LAN
to another in the
three router campus
network shown.
Specifically, how is
information sent
from a host
computer in LAN A
(10.10.20.0 subnet)
to a host computer in
LAN B (the
10.10.10.0 subnet)?
The data packets
must travel from LAN
A to the Router A
gateway (E0
interface), from
Router A to Router B
via the 10.10.200.0
subnet, and then to
LAN B via the Router
B gateway (E0
interface).
This requires that a
physical
communications link
must be established
between the routers
and a routing
protocol defined for
Router’s A and B
before data packets
can be exchanged.
What about setting static routes in the campus network. A simplified network can
be used to demonstrate what is required to develop static routes in a multiple
router network. For this example, two routers from the campus network are used.
The two routers, Router A and Router B connect to LANs A and B as shown. This
simplified network will be used to describe how data packets travel from LAN A -
Router A - Router B – LAN B and what is required to define the static routes.
The data packets pass through three subnets (indicated by NET) when traveling
from LAN A to LAN B. The IP subnets for each network are:
10.10.20.0 NET LAN A
10.10.200.0 NET Router A connection to Router B
10.10.10.0 NET LAN B
In this network, there are only two routers with Router A directly connected to
Router B. This means that the only route between the routers` is via the
10.10.200.0 NET which is the connection between router A and B. The static
route information is entered from the router’s configure terminal prompt
(config)# using the ip route command. The command structure for ip route is
Router(config)#ip route destination subnet mask next hop
The destination is the network’s destination IP address (NET), the subnet mask is
what has been defined for the subnets, and the next hop is the IP address of
the next router in the link. The command for routing the data to the 10.10.10.0
subnet is as follows:
RouterA(config)#ip route 10.10.10.0 255.255.255.0 10.10.200.2
The next hop IP address is the IP address of the Ethernet 2 port on Router B. Now
the router knows how to deliver data packets from host computers in the
10.10.20.0 NET (LAN A) to destination computers in the 10.10.10.0 NET (LAN
B).
Note: Each static route can use a different subnet mask. This is called variable
length subnet masking. For example, one static route could have a subnet
mask of 255.255.255.0 and another static route could have a subnet mask of
255.255.255.254.
show ip route
The routing address entry into the routing table can be verified by entering
the command show ip route from the router’s (config)#. An example of
this is shown:
RouterA#show ip route
Codes: C - connected, S - static, I - IGRP, 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, * - candidate default
U - per-user static route, o - ODR
T - traffic engineered route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 2 subnets
S 10.10.10.0 [1/0] via 10.10.200.2
C 10.10.200.0 is directly connected, FastEthernet0/1
What about data traffic flow from the 10.10.10.0 NET (LAN B) to the 10.10.20.0
NET (LAN A)? Once again, the data packets pass through three subnets
(indicated by NET) when traveling from LAN B to LAN A. The IP addresses for
each subnet are:
10.10.10.0 NET LAN B
10.10.200.0 NET Router B connection to Router A
10.10.20.0 NET LAN A
RouterB(config)#ip route 10.10.20.0 255.255.255.0 10.10.200.1
This information entered into the router is the following:
Destination Subnet Subnet Mask Next Hop
IP Address IP Address
10.10.20.0 255.255.255.0 10.10.200.1
sh ip route
RouterB#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, * - candidate
default
U - per-user static route, o - ODR
T - traffic engineered route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 2 subnets
S 10.10.20.0 [1/0] via 10.10.200.1
C 10.10.200.0 is directly connected, FastEthernet0/2
What about using
static routes in the
three-router campus
network shown.
Once again, a static
route must be
entered into Router
A’s routing table
telling the router how
to forward data to
the 10.10.10.0 NET.
However, in this
example, there are
two possible choices
for a data packet to
travel to the
10.10.10.0 NET from
Router A.
Configuring Static Routes
Router(config)#ip route destination subnet mask next hop
Where the destination is the network’s destination IP address (NET)
the subnet mask is what has been defined for the subnets
the next hop is the IP address of the next router in the link
Example: The command for routing the data to the 10.10.10.0 subnet off
RouterA is as follows:
RouterA(config)#ip route 10.10.10.0 255.255.255.0 10.10.200.2
RouterA(config)#ip route 10.10.10.0 255.255.255.0 10.10.100.2
Displaying Configured Routes
RouterA#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, * - candidate default
U - per-user static route, o - ODR
T - traffic engineered route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 2 subnets
S 10.10.10.0 [1/0] via 10.10.200.2
S 10.10.10.0 [1/0] via 10.10.100.2
C 10.10.200.0 is directly connected, FastEthernet0/0
C 10.10.100.0 is directly connected, FastEthernet0/1
Displaying the running-confugration
RouterA#sh run
!
!
ip route 10.10.5.0 255.255.255.0 10.10.200.2
ip route 10.10.5.0 255.255.255.0 10.10.100.2
!
!
Router Command Summary
Table 9-1 Summary of commands used to configured the static
routing protocol
Command Use
ip route used to specify the destination IP address, the
subnet mask, and the next hop IP address
show ip route shows the IP routes listed in the routing table.
show ip route static shows only the static IP routes listed in the
routing table
show running-config shows the router’s running-configuration
show startup-config shows the routers saved configuration in
NVRAM
wr m copies the current router changes to
memory (NVRAM
copy run start copies the current router changes to
memory (NVRAM)
Static Routes - Summary
When static routes are used, the network
administrator in essence, becomes the
routing protocol. In other words, the
network administrator is making all of the
decisions regarding data traffic routing.
Static Route Issues
This requires that the network
administrator must know all network data
routes, setup up the routes to each subnet
and be constantly aware of any route
changes.
Gateway of last resort
One of the most important applications for using a static
route is for configuring the Gateway of last resort on
a router.
The Gateway of last resort is the IP address of the
router in your network where data packets with
unknown routes should be forwarded.
The purpose of this is to configure a route for data
packets that do not have a destination route configured
in the routing table. In this case, a default route can be
configure that instructs the router to forward the data
packet(s) with an unknown route to another router. The
command for doing this is
ip route 0.0.0.0 0.0.0.0 <next hop address>
Network-Challenge
Open the Chapter 9 – Static Challenge and
verify you can configure static routes
Chapter 9-2 Key Terms
Static Route
netstat-r
route print
Loopback
Variable Length Subnet Masking
show ip route (sh ip route)
S
C
Chapter 9-2 Key Terms
show running-configuration
show startup-configuration (sh start)
copy run start
write memory (wr m)