Lab 2
Lab 2
Lab 2
Remote Networks: Networks that are not directly connected to the router. Routers learn about
remote networks in two ways:
• Static routes - Added to the routing table when a route is manually configured.
• Dynamic routing protocols - Added to the routing table when routing protocols dynamically learn
about the remote network.
Default Route: Specifies a next-hop router to use when the routing table does not contain a
specific route that matches the destination IP address. The default route can be entered
manually as a static route, or learned automatically from a dynamic routing protocol.
• The default route is sometimes referred to as a gateway of last resort.
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 3
Packet Forwarding
Packet Forwarding Decision Process
1. The data link frame with an
encapsulated IP packet arrives on
the ingress interface.
2. The router examines the
destination IP address in the
packet header and consults its IP
routing table.
3. The router finds the longest
matching prefix in the routing table.
4. The router encapsulates the
packet in a data link frame and
forwards it out the egress interface.
The destination could be a device
connected to the network or a next-
hop router.
5. However, if there is no matching
route entry the packet is dropped.
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 4
Packet Forwarding
Packet Forwarding Decision Process (Cont.)
After a router has determined the best path, it could do the following:
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 5
Packet Forwarding
Packet Forwarding Decision Process (Cont.)
After a router has determined the best path, it could do the following:
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 6
14.4 IP Routing Table
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 7
IP Routing Table
Route Sources
A routing table contains a list of routes to known networks (prefixes and prefix lengths).
The source of this information is derived from the following:
• Directly connected networks
• Static routes
• Dynamic routing protocols
The source for each route in the routing table is identified by a code. Common codes
include the following:
• L - Identifies the address assigned to a router interface.
• C - Identifies a directly connected network.
• S - Identifies a static route created to reach a specific network.
• O - Identifies a dynamically learned network from another router using the OSPF routing protocol.
• * - This route is a candidate for a default route.
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 8
IP Routing Table
Routing Table Entries
In the figure, the numbers identify the following information:
• Route source - This identifies how the route was
learned.
• Destination network (prefix and prefix length) - This
identifies the address of the remote network.
• Administrative distance - This identifies the
trustworthiness of the route source. Lower values indicate
preferred route source.
• Metric - This identifies the value assigned to reach the
remote network. Lower values indicate preferred routes.
• Next-hop - This identifies the IP address of the next
router to which the packet would be forwarded.
• Route timestamp - This identifies how much time has
passed since the route was learned.
• Exit interface - This identifies the egress interface to use
for outgoing packets to reach their final destination.
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 9
IP Routing Table
Administrative Distance (Cont.)
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 10
IP Routing Table
Static Routes
After directly connected interfaces are configured and added to the routing table, static or
dynamic routing can be implemented for accessing remote networks. Static routes are
manually configured. They define an explicit path between two networking devices. They
are not automatically updated and must be manually reconfigured if the network topology
changes.
• It provides ease of routing table maintenance in smaller networks that are not
expected to grow significantly.
Default Route
• The default route specifies a next-hop router to use when the routing table does not
contain a specific route that matches the destination IP address.
• A default route can be either a static route or learned automatically from a dynamic
routing protocol.
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 11
15.1 Static Routes
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 12
Static Routes
Types of Static Routes
Static routes are commonly implemented on a network. This is true even when there is a
dynamic routing protocol configured.
Static routes can be configured for IPv4 and IPv6. Both protocols support the following
types of static routes:
• Standard static route
• Default static route
• Floating static route
• Summary static route
Static routes are configured using the ip route and ipv6 route global configuration
commands.
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 13
Static Routes
Next-Hop Options
When configuring a static route, the next hop can be identified by an IP address, exit
interface, or both. How the destination is specified creates one of the three following types
of static route:
• Next-hop route - Only the next-hop IP address is specified
• Directly connected static route - Only the router exit interface is specified
• Fully specified static route - The next-hop IP address and exit interface are
specified
IPv4 static routes are configured using the following global configuration command:
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 14
Configure IP Static Routes
Verify a Static Route
Along with show ip route, show ipv6 route, ping and traceroute, other useful
commands to verify static routes include the following:
• show ip route static
• show ip route network
• show running-config | section ip route
Replace ip with ipv6 for the IPv6 versions of the command.
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 15
Configure IP Default Static Routes
Default Static Route
• A default route is a static route that
matches all packets. A single default route
represents any network that is not in the
routing table.
• Routers commonly use default routes that
are either configured locally or learned
from another router. The default route is
used as the Gateway of Last Resort.
• Default static routes are commonly used
when connecting an edge router to a
service provider network, or a stub router
(a router with only one upstream neighbor
router).
• The figure shows a typical default static
route scenario.
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 16
Configure IP Default Static Routes
Default Static Route (Cont.)
IPv4 Default Static Route: The command syntax for an IPv4 default static route is similar to any
other IPv4 static route, except that the network address is 0.0.0.0 and the subnet mask is 0.0.0.0.
The 0.0.0.0 0.0.0.0 in the route will match any network address.
The basic command syntax for an IPv4 default static route is as follows:
Router(config)# ip route 0.0.0.0 0.0.0.0 {ip-address | exit-intf}
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 17
Configure IP Default Static Routes
Verify a Default Static Route
The show ip route static command output from R1 displays the contents of the static routes in the routing table.
Note the asterisk (*) next to the route with code ‘S’. The asterisk indicates that this static route is a candidate
default route, which is why it is selected as the Gateway of Last Resort.
Notice that the static default route configuration uses the /0 mask for IPv4 default routes. Remember that the IPv4
subnet mask in a routing table determines how many bits must match between the destination IP address of the
packet and the route in the routing table. A /0 mask indicates that none of the bits are required to match. As long
as a more specific match does not exist, the default static route matches all packets.
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 18
Configure Floating Static Routes
Floating Static Routes
• Another type of static route is a floating static route. Floating static routes are static
routes that are used to provide a backup path to a primary static or dynamic route.
The floating static route is only used when the primary route is not available.
• To accomplish this, the floating static route is configured with a higher administrative
distance than the primary route.
• By default, static routes have an administrative distance of 1, making them preferable
to routes learned from dynamic routing protocols.
• The administrative distance of a static route can be increased to make the route less
desirable than that of another static route or a route learned through a dynamic
routing protocol. In this way, the static route “floats” and is not used when the route
with the better administrative distance is active.
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 19
Configure Floating Static Routes
Configure IPv4 and IPv6 Floating Static Routes
The commands to configure default and floating IP default routes are as follows:
R1(config)# ip route 0.0.0.0 0.0.0.0 172.16.2.2
R1(config)# ip route 0.0.0.0 0.0.0.0 10.10.10.2 5
The show ip route and show ipv6 route output verifies that the default routes to R2 are installed in
the routing table. Note that the IPv4 floating static route to R3 is not present in the routing table.
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 20
Troubleshoot IPv4 Static and Default Route Configuration
Common Troubleshooting Commands
Command Description
ping • Verify Layer 3 connectivity to destination.
• Extended pings provide additional options.
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 21