CCNA 2 v7.0 Curriculum: Module 15 – IP Static Routing

15.0 Introduction

15.0.1 Why should I take this module?

Welcome to IP Static Routing!

There are so many different ways to dynamically route a packet that you might wonder why anybody would take the time to manually configure a static route. It is kind of like handwashing all of your clothes when you have a perfectly good washing machine. But you know that some clothing items cannot go in the washing machine. Some items benefit from being washed by hand. There is a similarity in networking. As it turns out, there are many situations where a manually configured a static route is your best option.

There are different kinds of static routes, and each is perfect for solving (or avoiding) a specific type of network problem. Many networks use both dynamic and static routing, so network administrators need to know how to configure, verify, and troubleshoot static routes. You are taking this course because you want to become a network administrator, or you want to improve your existing network administrator skills. You will be glad you took this module, because you will use these skills frequently! And because this module is about configuring static routes, there are several Syntax Checker activities, followed by a Packet Tracer and a Lab where you can hone your skills!

15.0.2 What will I learn to do in this module?

Module Title: IP Static Routing

Module Objective: Configure IPv4 and IPv6 static routes.

Topic Title Topic Objective
Static Routes Describe the command syntax for static routes.
Configure IP Static Routes Configure IPv4 and IPv6 static routes.
Configure IP Default Static Routes Configure IPv4 and IPv6 default static routes.
Configure Floating Static Routes Configure a floating static route to provide a backup connection.
Configure Static Host Routes Configure IPv4 and IPv6 static host routes that direct traffic to a specific host.

15.1 Static Routes

15.1.1 Types of Static Routes

Static routes are commonly implemented on a network. This is true even when there is a dynamic routing protocol configured. For instance, an organization could configure a default static route to the service provider and advertise this route to other corporate routers using the dynamic routing protocol.

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.

15.1.2 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

15.1.3 IPv4 Static Route Command

IPv4 static routes are configured using the following global configuration command:

Router(config)# ip route network-address subnet-mask { ip-address | exit-intf [ip-address]} [distance]

Note: Either the ip-addressexit-intf, or the ip-address and exit-intf parameters must be configured.

The table describes the ip route command parameters.

Parameter Description
network-address
Identifies the destination IPv4 network address of the remote network to add to the routing table.
subnet-mask
  • Identifies the subnet mask of the remote network.
  • The subnet mask can be modified to summarize a group of networks and create a summary static route.
ip-address
  • Identifies the next-hop router IPv4 address.
  • Typically used with broadcast networks (i.e., Ethernet).
  • Could create a recursive static route where the router performs an additional lookup to find the exit interface.
exit-intf
  • Identifies the exit interface to forward packets.
  • Creates a directly connected static route.
  • Typically used in a point-to-point configuration.
exit-intf ip-address
Creates a fully specified static route because it specifies the exit interface and next-hop IPv4 address.
distance
  • Optional command that can be used to assign an administrative distance value between 1 and 255.
  • Typically used to configure a floating static route by setting an administrative distance that is higher than a dynamically learned route.

15.1.4 IPv6 Static Route Command

IPv6 static routes are configured using the following global configuration command:

Router(config)# ipv6 route ipv6-prefix/prefix-length {ipv6-address | exit-intf [ipv6-address]} [distance]

Most of parameters are identical to the IPv4 version of the command.

The table shows the various ipv6 route command parameters and their descriptions.

Parameter Description
ipv6-prefix
Identifies the destination IPv6 network address of the remote network to add to the routing table.
/prefix-length
Identifies the prefix length of the remote network.
ipv6-address
  • Identifies the next-hop router IPv6 address.
  • Typically used with broadcast networks (i.e., Ethernet)
  • Could create a recursive static route where the router performs an additional lookup to find the exit interface.
exit-intf
  • Identifies the exit interface to forward packets.
  • Creates a directly connected static route.
  • Typically used in a point-to-point configuration.
exit-intf ipv6-address
Creates a fully specified static route because it specifies the exit interface and next-hop IPv6 address.
distance
  • Optional command that can be used to assign an administrative distance value between 1 and 255.
  • Typically used to configure a floating static route by setting an administrative distance that is higher than a dynamically learned route.

Note: The ipv6 unicast-routing global configuration command must be configured to enable the router to forward IPv6 packets.

15.1.5 Dual-Stack Topology

The figure shows a dual-stack network topology. Currently, no static routes are configured for either IPv4 or IPv6.

CCNA 2 v7.0 Curriculum: Module 15 - IP Static Routing 19

15.1.6 IPv4 Starting Routing Tables

Click each button to see the IPv4 routing table of each router and ping results. Notice that each router has entries only for directly connected networks and associated local addresses.

R1 IPv4 Routing Table

R1# show ip route | begin Gateway
Gateway of last resort is not set
      172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks
C        172.16.2.0/24 is directly connected, Serial0/1/0
L        172.16.2.1/32 is directly connected, Serial0/1/0
C        172.16.3.0/24 is directly connected, GigabitEthernet0/0/0
L        172.16.3.1/32 is directly connected, GigabitEthernet0/0/0
R1#

R2 IPv4 Routing Table

R2# show ip route | begin Gateway
Gateway of last resort is not set
      172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks
C        172.16.1.0/24 is directly connected, GigabitEthernet0/0/0
L        172.16.1.1/32 is directly connected, GigabitEthernet0/0/0
C        172.16.2.0/24 is directly connected, Serial0/1/0
L        172.16.2.2/32 is directly connected, Serial0/1/0
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Serial0/1/1
L        192.168.1.2/32 is directly connected, Serial0/1/1
R2#

R3 IPv4 Routing Table

R3# show ip route | begin Gateway
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, Serial0/1/1
L        192.168.1.1/32 is directly connected, Serial0/1/1
      192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.2.0/24 is directly connected, GigabitEthernet0/0/0
L        192.168.2.1/32 is directly connected, GigabitEthernet0/0/0
R3#

R1 Can Ping R2

None of the routers have knowledge of any networks beyond the directly connected interfaces. This means each router can only reach directly connected networks, as demonstrated in the following ping tests.

ping from R1 to the serial 0/1/0 interface of R2 should be successful because it is a directly-connected network.

R1# ping 172.16.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.2.2, timeout is 2 seconds:
!!!!!

R1 Cannot Ping R3 LAN

However, a ping from R1 to the R3 LAN should fail because R1 does not have an entry in its routing table for the R3 LAN network.

R1# ping 192.168.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)

15.1.7 IPv6 Starting Routing Tables

Click each button to see the IPv6 routing table of each router and ping results. Notice that each router has entries only for directly connected networks and associated local addresses.

R1 IPv6 Routing Table

R1# show ipv6 route | begin C
C   2001:DB8:ACAD:2::/64 [0/0]
     via Serial0/1/0, directly connected
L   2001:DB8:ACAD:2::1/128 [0/0]
     via Serial0/1/0, receive
C   2001:DB8:ACAD:3::/64 [0/0]
     via GigabitEthernet0/0/0, directly connected
L   2001:DB8:ACAD:3::1/128 [0/0]
     via GigabitEthernet0/0/0, receive
L   FF00::/8 [0/0]
     via Null0, receive
R1#

R2 IPv6 Routing Table

R2# show ipv6 route | begin C 
C   2001:DB8:ACAD:1::/64 [0/0]
     via GigabitEthernet0/0/0, directly connected
L   2001:DB8:ACAD:1::1/128 [0/0]
     via GigabitEthernet0/0/0, receive
C   2001:DB8:ACAD:2::/64 [0/0]
     via Serial0/1/0, directly connected
L   2001:DB8:ACAD:2::2/128 [0/0]
     via Serial0/1/0, receive
C   2001:DB8:CAFE:1::/64 [0/0]
     via Serial0/1/1, directly connected
L   2001:DB8:CAFE:1::2/128 [0/0]
     via Serial0/1/1, receive
L   FF00::/8 [0/0]
     via Null0, receive
R2#

R3 IPv6 Routing Table

R3# show ipv6 route | begin C 
C   2001:DB8:CAFE:1::/64 [0/0]
     via Serial0/1/1, directly connected
L   2001:DB8:CAFE:1::1/128 [0/0]
     via Serial0/1/1, receive
C   2001:DB8:CAFE:2::/64 [0/0]
     via GigabitEthernet0/0/0, directly connected
L   2001:DB8:CAFE:2::1/128 [0/0]
     via GigabitEthernet0/0/0, receive
L   FF00::/8 [0/0]
     via Null0, receive
R3#

R1 Can Ping R2

None of the routers have knowledge of any networks beyond the directly connected interfaces.

A ping from R1 to the serial 0/1/0 interface on R2 should be successful.

R1# ping 2001:db8:acad:2::2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:DB8:ACAD:2::2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/2/3 ms

R1 Cannot Ping R3 LAN

However, a ping to the R3 LAN is unsuccessful. This is because R1 does not have an entry in its routing table for that network.

R1# ping 2001:DB8:cafe:2::1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:DB8:CAFE:2::1, timeout is 2 seconds:
% No valid route for destination
Success rate is 0 percent (0/1)

15.2 Configure IP Static Routes

15.2.1 IPv4 Next-Hop Static Route

The commands to configure standard static routes varies slightly between IPv4 and IPv6. This topic shows you how to configure standard next-hop, directly connected, and full specified static routes for both IPv4 and Ipv6.

In a next-hop static route, only the next-hop IP address is specified. The exit interface is derived from the next hop. For example, three next-hop IPv4 static routes are configured on R1 using the IP address of the next hop, R2.

CCNA 2 v7.0 Curriculum: Module 15 - IP Static Routing 20

The commands to configure R1 with the IPv4 static routes to the three remote networks are as follows:

R1(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.2
R1(config)# ip route 192.168.1.0 255.255.255.0 172.16.2.2
R1(config)# ip route 192.168.2.0 255.255.255.0 172.16.2.2

The routing table for R1 now has routes to the three remote IPv4 networks.

R1# show ip route | begin Gateway
Gateway of last resort is not set
      172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks
S        172.16.1.0/24 [1/0] via 172.16.2.2
C        172.16.2.0/24 is directly connected, Serial0/1/0
L        172.16.2.1/32 is directly connected, Serial0/1/0
C        172.16.3.0/24 is directly connected, GigabitEthernet0/0/0
L        172.16.3.1/32 is directly connected, GigabitEthernet0/0/0
S     192.168.1.0/24 [1/0] via 172.16.2.2
S     192.168.2.0/24 [1/0] via 172.16.2.2

R1#

15.2.2 IPv6 Next-Hop Static Route

The commands to configure R1 with the IPv6 static routes to the three remote networks are as follows:

R1(config)# ipv6 unicast-routing
R1(config)# ipv6 route 2001:db8:acad:1::/64 2001:db8:acad:2::2
R1(config)# ipv6 route 2001:db8:cafe:1::/64 2001:db8:acad:2::2
R1(config)# ipv6 route 2001:db8:cafe:2::/64 2001:db8:acad:2::2

The routing table for R1 now has routes to the three remote IPv6 networks.

R1# show ipv6 route
IPv6 Routing Table - default - 8 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
       B - BGP, R - RIP, H - NHRP, I1 - ISIS L1
       I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP
       EX - EIGRP external, ND - ND Default, NDp - ND Prefix, DCE - Destination
       NDr - Redirect, RL - RPL, O - OSPF Intra, OI - OSPF Inter
       OE1 - OSPF ext 1, OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1
       ON2 - OSPF NSSA ext 2, la - LISP alt, lr - LISP site-registrations
       ld - LISP dyn-eid, lA - LISP away, le - LISP extranet-policy
       a - Application
S   2001:DB8:ACAD:1::/64 [1/0]
     via 2001:DB8:ACAD:2::2
C   2001:DB8:ACAD:2::/64 [0/0]
     via Serial0/1/0, directly connected
L   2001:DB8:ACAD:2::1/128 [0/0]
     via Serial0/1/0, receive
C   2001:DB8:ACAD:3::/64 [0/0]
     via GigabitEthernet0/0/0, directly connected
L   2001:DB8:ACAD:3::1/128 [0/0]
     via GigabitEthernet0/0/0, receive
S   2001:DB8:CAFE:1::/64 [1/0]
     via 2001:DB8:ACAD:2::2
S   2001:DB8:CAFE:2::/64 [1/0]
     via 2001:DB8:ACAD:2::2
L   FF00::/8 [0/0]
     via Null0, receive

15.2.3 IPv4 Directly Connected Static Route

When configuring a static route, another option is to use the exit interface to specify the next-hop address. The figure shows the topology again.

CCNA 2 v7.0 Curriculum: Module 15 - IP Static Routing 21

Three directly connected IPv4 static routes are configured on R1 using the exit interface.

R1(config)# ip route 172.16.1.0 255.255.255.0 s0/1/0
R1(config)# ip route 192.168.1.0 255.255.255.0 s0/1/0
R1(config)# ip route 192.168.2.0 255.255.255.0 s0/1/0

The IPv4 routing table for R1 shows that when a packet is destined for the 192.168.2.0/24 network, R1 looks for a match in the routing table, and finds that it can forward the packet out of its Serial 0/1/0 interface.

Note: Using a next-hop address is generally recommended. Directly connected static routes should only be used with point-to-point serial interfaces, as in this example.

R1# show ip route | begin Gateway
Gateway of last resort is not set
      172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks
S        172.16.1.0/24 is directly connected, Serial0/1/0
C        172.16.2.0/24 is directly connected, Serial0/1/0
L        172.16.2.1/32 is directly connected, Serial0/1/0
C        172.16.3.0/24 is directly connected, GigabitEthernet0/0/0
L        172.16.3.1/32 is directly connected, GigabitEthernet0/0/0
S     192.168.1.0/24 is directly connected, Serial0/1/0
S     192.168.2.0/24 is directly connected, Serial0/1/0

15.2.4 IPv6 Directly Connected Static Route

In the example, three directly connected IPv6 static routes are configured on R1 using the exit interface.

R1(config)# ipv6 route 2001:db8:acad:1::/64 s0/1/0
R1(config)# ipv6 route 2001:db8:cafe:1::/64 s0/1/0
R1(config)# ipv6 route 2001:db8:cafe:2::/64 s0/1/0

The IPv6 routing table for R1 in the example output shows that when a packet is destined for the 2001:db8:cafe:2::/64 network, R1 looks for a match in the routing table and finds that it can forward the packet out of its Serial 0/1/0 interface.

Note: Using a next-hop address is generally recommended. Directly connected static routes should only be used with point-to-point serial interfaces, as in this example.

R1# show ipv6 route
IPv6 Routing Table - default - 8 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
       B - BGP, R - RIP, H - NHRP, I1 - ISIS L1
       I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP
       EX - EIGRP external, ND - ND Default, NDp - ND Prefix, DCE - Destination
       NDr - Redirect, RL - RPL, O - OSPF Intra, OI - OSPF Inter
       OE1 - OSPF ext 1, OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1
       ON2 - OSPF NSSA ext 2, la - LISP alt, lr - LISP site-registrations
       ld - LISP dyn-eid, lA - LISP away, le - LISP extranet-policy
       a - Application
S   2001:DB8:ACAD:1::/64 [1/0]
     via Serial0/1/0, directly connected
C   2001:DB8:ACAD:2::/64 [0/0]
     via Serial0/1/0, directly connected
L   2001:DB8:ACAD:2::1/128 [0/0]
     via Serial0/1/0, receive
C   2001:DB8:ACAD:3::/64 [0/0]
     via GigabitEthernet0/0/0, directly connected
L   2001:DB8:ACAD:3::1/128 [0/0]
     via GigabitEthernet0/0/0, receive
S   2001:DB8:CAFE:1::/64 [1/0]
     via Serial0/1/0, directly connected
S   2001:DB8:CAFE:2::/64 [1/0]
     via Serial0/1/0, directly connected
L   FF00::/8 [0/0]
     via Null0, receiveIPv6 Routing Table - default - 8 entries
R1#

15.2.5 IPv4 Fully Specified Static Route

In a fully specified static route, both the exit interface and the next-hop IP address are specified. This form of static route is used when the exit interface is a multi-access interface and it is necessary to explicitly identify the next hop. The next hop must be directly connected to the specified exit interface. Using an exit interface is optional, however it is necessary to use a next-hop address.

Suppose that the network link between R1 and R2 is an Ethernet link and that the GigabitEthernet 0/0/1 interface of R1 is connected to that network, as shown in the figure.

CCNA 2 v7.0 Curriculum: Module 15 - IP Static Routing 22

The difference between an Ethernet multi-access network and a point-to-point serial network is that a point-to-point serial network has only one other device on that network, the router at the other end of the link. With Ethernet networks, there may be many different devices sharing the same multi-access network, including hosts and even multiple routers.

It is recommended that when the exit interface is an Ethernet network, that the static route includes a next-hop address. You can also use a fully specified static route that includes both the exit interface and the next-hop address.

R1(config)# ip route 172.16.1.0 255.255.255.0 GigabitEthernet 0/0/1 172.16.2.2
R1(config)# ip route 192.168.1.0 255.255.255.0 GigabitEthernet 0/0/1 172.16.2.2
R1(config)# ip route 192.168.2.0 255.255.255.0 GigabitEthernet 0/0/1 172.16.2.2

When forwarding packets to R2, the exit interface is GigabitEthernet 0/0/1 and the next-hop IPv4 address is 172.16.2.2 as shown in the show ip route output from R1.

R1# show ip route | begin Gateway
Gateway of last resort is not set
      172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks
S        172.16.1.0/24 [1/0] via 172.16.2.2, GigabitEthernet0/0/1
C        172.16.2.0/24 is directly connected, GigabitEthernet0/0/1
L        172.16.2.1/32 is directly connected, GigabitEthernet0/0/1
C        172.16.3.0/24 is directly connected, GigabitEthernet0/0/0
L        172.16.3.1/32 is directly connected, GigabitEthernet0/0/0
S     192.168.1.0/24 [1/0] via 172.16.2.2, GigabitEthernet0/0/1
S     192.168.2.0/24 [1/0] via 172.16.2.2, GigabitEthernet0/0/1

15.2.6 IPv6 Fully Specified Static Route

In a fully specified IPv6 static route, both the exit interface and the next-hop IPv6 address are specified. There is a situation in IPv6 when a fully specified static route must be used. If the IPv6 static route uses an IPv6 link-local address as the next-hop address, use a fully specified static route. The figure shows an example of a fully specified IPv6 static route using an IPv6 link-local address as the next-hop address.

CCNA 2 v7.0 Curriculum: Module 15 - IP Static Routing 23

R1(config)# ipv6 route 2001:db8:acad:1::/64 fe80::2
%Interface has to be specified for a link-local nexthop
R1(config)# ipv6 route 2001:db8:acad:1::/64 s0/1/0 fe80::2

In the example, a fully specified static route is configured using the link-local address of R2 as the next-hop address. Notice that IOS requires that an exit interface be specified.

The reason a fully specified static route must be used is because IPv6 link-local addresses are not contained in the IPv6 routing table. Link-local addresses are only unique on a given link or network. The next-hop link-local address may be a valid address on multiple networks connected to the router. Therefore, it is necessary that the exit interface be included.

The following example shows the IPv6 routing table entry for this route. Notice that both the next-hop link-local address and the exit interface are included.

R1# show ipv6 route static | begin 2001:db8:acad:1::/64
S   2001:DB8:ACAD:1::/64 [1/0]
    via FE80::2, Seria0/1/0

15.2.7 Verify a Static Route

Along with show ip routeshow ipv6 routeping 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.

Reference the figure when reviewing the command examples.

CCNA 2 v7.0 Curriculum: Module 15 - IP Static Routing 24

Click each button for example output for IPv4 and IPv6 static routes.

Display Only IPv4 Static Routes

This output shows only the IPv4 static routes in the routing table. Also note where the filter begins the output, excluding all the codes.

R1# show ip route static | begin Gateway
Gateway of last resort is not set
      172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks
S        172.16.1.0/24 [1/0] via 172.16.2.2
S     192.168.1.0/24 [1/0] via 172.16.2.2
S     192.168.2.0/24 [1/0] via 172.16.2.2
R1#

Display a Specific IPv4 Network

This command will show output for only the specified network in the routing table.

R1# show ip route 192.168.2.1
Routing entry for 192.168.2.0/24
  Known via "static", distance 1, metric 0
  Routing Descriptor Blocks:
  * 172.16.2.2
      Route metric is 0, traffic share count is 1
R1#

Display the IPv4 Static Route Configuration

This command filters the running configuration for only IPv4 static routes.

R1# show running-config | section ip route
ip route 172.16.1.0 255.255.255.0 172.16.2.2
ip route 192.168.1.0 255.255.255.0 172.16.2.2
ip route 192.168.2.0 255.255.255.0 172.16.2.2
R1#

Display Only IPv6 Static Routes

This output shows only the IPv6 static routes in the routing table. Also note where the filter begins the output, excluding all the codes.

R1# show ipv6 route static
IPv6 Routing Table - default - 8 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
       B - BGP, R - RIP, H - NHRP, I1 - ISIS L1
       I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP
       EX - EIGRP external, ND - ND Default, NDp - ND Prefix, DCE - Destination
       NDr - Redirect, RL - RPL, O - OSPF Intra, OI - OSPF Inter
       OE1 - OSPF ext 1, OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1
       ON2 - OSPF NSSA ext 2, la - LISP alt, lr - LISP site-registrations
       ld - LISP dyn-eid, lA - LISP away, le - LISP extranet-policy
       a - Application
S   2001:DB8:ACAD:1::/64 [1/0]
     via 2001:DB8:ACAD:2::2
S   2001:DB8:CAFE:1::/64 [1/0]
     via 2001:DB8:ACAD:2::2
S   2001:DB8:CAFE:2::/64 [1/0]
     via 2001:DB8:ACAD:2::2
R1#

Display a Specific IPv6 Network

This command will show output for only the specified network in the routing table.

R1# show ipv6 route 2001:db8:cafe:2:: 
Routing entry for 2001:DB8:CAFE:2::/64
  Known via "static", distance 1, metric 0
  Route count is 1/1, share count 0
  Routing paths:
    2001:DB8:ACAD:2::2
      Last updated 00:23:55 ago

R1#

Display the IPv6 Static Route Configuration

This command filters the running configuration for only IPv6 static routes.

R1# show running-config | section ipv6 route
ipv6 route 2001:DB8:ACAD:1::/64 2001:DB8:ACAD:2::2
ipv6 route 2001:DB8:CAFE:1::/64 2001:DB8:ACAD:2::2
ipv6 route 2001:DB8:CAFE:2::/64 2001:DB8:ACAD:2::2
R1#

15.2.8 Syntax Checker – Configure Static Routes

Configure static routes based on the specified requirements

CCNA 2 v7.0 Curriculum: Module 15 - IP Static Routing 25

Configure an IPv4 next-hop static route on R2 to the 192.168.2.0/24 network using the next-hop address 192.168.1.1.

R2(config)#ip route 192.168.2.0 255.255.255.0 192.168.1.1

Configure a fully specified IPv4 static route on R2 to the 172.16.3.0/24 network using the exit interface/next-hop pair: g0/0/1 172.16.2.1

R2(config)#ip route 172.16.3.0 255.255.255.0 g0/0/1 172.16.2.1

Configure an IPv6 next-hop static route on R2 to the 2001:db8:cafe:2::/64 network using the next-hop address 2001:db8:cafe:1::1.

R2(config)#ipv6 route 2001:db8:cafe:2::/64 2001:db8:cafe:1::1

Configure a fully specified IPv6 static route on R2 to the 2001:db8:acad:3::/64 network using the exit interface/next-hop pair: g0/0/1 / fe80::1

R2(config)#ipv6 route 2001:db8:acad:3::/64 g0/0/1 fe80::1

Exit configuration mode and issue the command to display only the IPv4 static routes in the routing table of R2.

R2(config)#exit
\*Sep 18 21:44:32.910: %SYS-5-CONFIG\_I: Configured from console by console
R2#show ip route static
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
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
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks
S 172.16.3.0/24 \[1/0\] via 172.16.2.1, GigabitEthernet0/0/1
S 192.168.2.0/24 \[1/0\] via 192.168.1.1

Issue the command to display only the IPv6 static routes in the routing table of R2.

R2#show ipv6 route static
IPv6 Routing Table - default - 9 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
       B - BGP, R - RIP, H - NHRP, I1 - ISIS L1
       I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP
       EX - EIGRP external, ND - ND Default, NDp - ND Prefix, DCE - Destination
       NDr - Redirect, RL - RPL, O - OSPF Intra, OI - OSPF Inter
       OE1 - OSPF ext 1, OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1
       ON2 - OSPF NSSA ext 2, a - Application
S   2001:DB8:ACAD:3::/64 \[1/0\]
     via FE80::1, GigabitEthernet0/0/1
S   2001:DB8:CAFE:2::/64 \[1/0\]
     via 2001:DB8:CAFE:1::1
==============================================================

You are now logged into R3:
Configure a directly connected IPv4 static route on R3 to the 172.16.3.0/24 network using exit interface S0/1/1.

R3(config)#ip route 172.16.3.0 255.255.255.0 s0/1/1

Configure a directly connected IPv4 static route on R3 to the 172.16.1.0/24 network using exit interface S0/1/1.

R3(config)#ip route 172.16.1.0 255.255.255.0 s0/1/1
Configure a directly connected IPv4 static route on R3 to the 172.16.2.0/24 network using exit interface S0/1/1.

R3(config)#ip route 172.16.2.0 255.255.255.0 s0/1/1
Configure a directly connected IPv6 static route on R3 to the 2001:db8:acad:1::/64 network using exit interface S0/1/1.

R3(config)#ipv6 route 2001:db8:acad:1::/64 s0/1/1
Configure a directly connected IPv6 static route on R3 to the 2001:db8:acad:3::/64 network using exit interface S0/1/1.

R3(config)#ipv6 route 2001:db8:acad:3::/64 s0/1/1
Configure a directly connected IPv6 static route on R3 to the 2001:db8:acad:2::/64 network using exit interface S0/1/1.

R3(config)#ipv6 route 2001:db8:acad:2::/64 s0/1/1
Exit configuration mode and issue the command to display only the IPv4 static routes in the routing table of R3.

R3(config)#exit
Sep 18 21:47:57.894: %SYS-5-CONFIG\_I: Configured from console by console
R3#show ip route static
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
       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
       + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
      172.16.0.0/24 is subnetted, 3 subnets
S        172.16.1.0 is directly connected, Serial0/1/1
S        172.16.2.0 is directly connected, Serial0/1/1
S        172.16.3.0 is directly connected, Serial0/1/1

Issue the command to display only the IPv6 static routes in the routing table of R3.

R3#show ipv6 route static
IPv6 Routing Table - default - 8 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
       B - BGP, R - RIP, H - NHRP, I1 - ISIS L1
       I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP
       EX - EIGRP external, ND - ND Default, NDp - ND Prefix, DCE - Destination
       NDr - Redirect, RL - RPL, O - OSPF Intra, OI - OSPF Inter
       OE1 - OSPF ext 1, OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1
       ON2 - OSPF NSSA ext 2, a - Application
S   2001:DB8:ACAD:1::/64 \[1/0\]
     via Serial0/1/1, directly connected
S   2001:DB8:ACAD:2::/64 \[1/0\]
     via Serial0/1/1, directly connected
S   2001:DB8:ACAD:3::/64 \[1/0\]
     via Serial0/1/1, directly connected
You have successfully configured and verified IPv4 and IPv6 static routes.

15.3 Configure IP Default Static Routes

15.3.1 Default Static Route

This topic shows you how to configure a default route for IPv4 and IPv6. It also explains the situations in which a default route is a good choice. A default route is a static route that matches all packets. Instead of routers storing routes for all of the networks in the internet, they can store a single default route to represent any network that is not in the routing table.

Routers commonly use default routes that are either configured locally or learned from another router, using a dynamic routing protocol. A default route does not require any far-left bits to match between the default route and the destination IP address. A default route is used when no other routes in the routing table match the destination IP address of the packet. In other words, if a more specific match does not exist, then 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.

CCNA 2 v7.0 Curriculum: Module 15 - IP Static Routing 26

R1 only needs to know about directly connected networks. For all other networks it can use a default static route pointing to R2.

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.

Note: An IPv4 default static route is commonly referred to as a quad-zero route.

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}

IPv6 Default Static Route

The command syntax for an IPv6 default static route is similar to any other IPv6 static route, except that the ipv6-prefix/prefix-length is ::/0, which matches all routes.

The basic command syntax for an IPv6 default static route is as follows:

Router(config)# ipv6 route ::/0 {ipv6-address | exit-intf}

15.3.2 Configure a Default Static Route

In the figure, R1 could be configured with three static routes, one to reach each of the remote networks in the example topology. However, R1 is a stub router because it is only connected to R2. Therefore, it would be more efficient to configure a single default static route.

CCNA 2 v7.0 Curriculum: Module 15 - IP Static Routing 27

The example shows an IPv4 default static route configured on R1. With the configuration shown in the example, any packets not matching more specific route entries are forwarded to R2 at 172.16.2.2.

R1(config)# ip route 0.0.0.0 0.0.0.0 172.16.2.2

An IPv6 default static route is configured in similar fashion. With this configuration any packets not matching more specific IPv6 route entries are forwarded to R2 at 2001:db8:acad:2::2

R1(config)# ipv6 route ::/0 2001:db8:acad:2::2

15.3.3 Verify a Default Static Route

CCNA 2 v7.0 Curriculum: Module 15 - IP Static Routing 20

Verify IPv4 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’. As displayed in the codes table in the show ip route output, the asterisk indicates that this static route is a candidate default route, which is why it is selected as the Gateway of Last Resort.

R1# show ip route static
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 
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 
+ - replicated route, % - next hop override 

Gateway of last resort is 172.16.2.2 to network 0.0.0.0

S* 0.0.0.0/0 [1/0] via 172.16.2.2 
R1#

Verify IPv6 Default Static Route

This example shows the show ipv6 route static command output to display the contents of the routing table.

R1# show ipv6 route static
IPv6 Routing Table - default - 8 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
       B - BGP, R - RIP, H - NHRP, I1 - ISIS L1
       I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP
       EX - EIGRP external, ND - ND Default, NDp - ND Prefix, DCE - Destination
       NDr - Redirect, RL - RPL, O - OSPF Intra, OI - OSPF Inter
       OE1 - OSPF ext 1, OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1
       ON2 - OSPF NSSA ext 2, la - LISP alt, lr - LISP site-registrations
       ld - LISP dyn-eid, lA - LISP away, le - LISP extranet-policy
       a - Application
S   ::/0 [1/0]
     via 2001:DB8:ACAD:2::2

R1#

Notice that the static default route configuration uses the /0 mask for IPv4 default routes and the ::/0 prefix for IPv6 default routes. Remember that the IPv4 subnet mask and IPv6 prefix-length 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 or ::/0 prefix 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.

15.3.4 Syntax Checker – Configure Default Static Routes

Configure and verify default static routes based on the specified requirements.

CCNA 2 v7.0 Curriculum: Module 15 - IP Static Routing 29

Configure an IPv4 default static route on R3 to reach all remote networks. Use the next-hop IPv4 address argument.

R3(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.2
Configure an IPv6 default static route on R3 to reach all remote networks. Use the next-hop IPv6 address argument.

R3(config)#ipv6 route ::/0 2001:db8:cafe:1::2
Exit configuration mode and display only the static routes in the IPv4 routing table.

R3(config)#exit
\*Sep 16 10:11:43.767: %SYS-5-CONFIG\_I: Configured from console by console
R3#show ip route static
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   
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   
\+ - replicated route, % - next hop override   
  
Gateway of last resort is 192.168.1.2 to network 0.0.0.0   
  
S\* 0.0.0.0/0 \[1/0\] via 172.16.2.2
Display only the static routes in the IPv6 routing table.

R3#show ipv6 route static
IPv6 Routing Table - default - 8 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
       B - BGP, R - RIP, H - NHRP, I1 - ISIS L1
       I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP
       EX - EIGRP external, ND - ND Default, NDp - ND Prefix, DCE - Destination
       NDr - Redirect, RL - RPL, O - OSPF Intra, OI - OSPF Inter
       OE1 - OSPF ext 1, OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1
       ON2 - OSPF NSSA ext 2, la - LISP alt, lr - LISP site-registrations
       ld - LISP dyn-eid, lA - LISP away, le - LISP extranet-policy
       a - Application
S   ::/0 \[1/0\]
     via 2001:DB8:CAFE:1::2
You have successfully configured and verified default static routes.

15.4 Configure Floating Static Routes

15.4.1 Floating Static Routes

As with the other topics in this module, you will learn how to configure IPv4 and IPv6 floating static routes and when to use them.

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, in the event of a link failure. 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. The administrative distance represents the trustworthiness of a route. If multiple paths to the destination exist, the router will choose the path with the lowest administrative distance.

For example, assume that an administrator wants to create a floating static route as a backup to an EIGRP-learned route. The floating static route must be configured with a higher administrative distance than EIGRP. EIGRP has an administrative distance of 90. If the floating static route is configured with an administrative distance of 95, the dynamic route learned through EIGRP is preferred to the floating static route. If the EIGRP-learned route is lost, the floating static route is used in its place.

In the figure, the branch router typically forwards all traffic to the HQ router over the private WAN link. In this example, the routers exchange route information using EIGRP. A floating static route, with an administrative distance of 91 or higher, could be configured to serve as a backup route. If the private WAN link fails and the EIGRP route disappears from the routing table, the router selects the floating static route as the best path to reach the HQ LAN.

CCNA 2 v7.0 Curriculum: Module 15 - IP Static Routing 30

  1. A route learned through dynamic routing is preferred.
  2. If a dynamic route is lost, the floating static route will be used.

By default, static routes have an administrative distance of 1, making them preferable to routes learned from dynamic routing protocols. For example, the administrative distances of some common interior gateway dynamic routing protocols are:

  • EIGRP = 90
  • OSPF = 110
  • IS-IS = 115

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. However, if the preferred route is lost, the floating static route can take over, and traffic can be sent through this alternate route.

15.4.2 Configure IPv4 and IPv6 Floating Static Routes

IP floating static routes are configured by using the distance argument to specify an administrative distance. If no administrative distance is configured, the default value (1) is used.

Refer to the topology in the figure and the ip route and ipv6 route commands issued on R1. In this scenario, the preferred default route from R1 is to R2. The connection to R3 should be used for backup only.

CCNA 2 v7.0 Curriculum: Module 15 - IP Static Routing 31

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
R1(config)# ipv6 route ::/0 2001:db8:acad:2::2
R1(config)# ipv6 route ::/0 2001:db8:feed:10::2 5

R1 is configured with IPv4 and IPv6 default static routes pointing to R2. Because no administrative distance is configured, the default value (1) is used for these static routes. R1 is also configured with IPv4 and IPv6 floating static default routes pointing to R3 with an administrative distance of 5. This value is greater than the default value of 1 and therefore; this route floats and is not present in the routing table unless the preferred route fails.

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.

R1# show ip route static | begin Gateway
Gateway of last resort is 172.16.2.2 to network 0.0.0.0

S*   0.0.0.0/0 [1/0] via 172.16.2.2
R1# show ipv6 route static | begin S : 
S   ::/0 [1/0]
     via 2001:DB8:ACAD:2::2
R1#

Use the show run command to verify that floating static routes are in the configuration. For example, the following command output verifies that both IPv6 static default routes are in the running configuration.

R1# show run | include ipv6 route
ipv6 route ::/0 2001:db8:feed:10::2 5
ipv6 route ::/0 2001:db8:acad:2::2
R1#

15.4.3 Test the Floating Static Route

In the figure, what would happen if R2 failed?

CCNA 2 v7.0 Curriculum: Module 15 - IP Static Routing 31

To simulate this failure, both serial interfaces of R2 are shut down, as shown in the configuration.

R2(config)# interface s0/1/0
R2(config-if)# shut
*Sep 18 23:36:27.000: %LINK-5-CHANGED: Interface Serial0/1/0, changed state to administratively down
*Sep 18 23:36:28.000: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/0, changed state to down
R2(config-if)# interface s0/1/1
R2(config-if)# shut
*Sep 18 23:36:41.598: %LINK-5-CHANGED: Interface Serial0/1/1, changed state to administratively down
*Sep 18 23:36:42.598: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/1, changed state to down

Notice that R1 automatically generates messages indicating that the serial interface to R2 is down.

R1#
*Sep 18 23:35:48.810: %LINK-3-UPDOWN: Interface Serial0/1/0, changed state to down
R1#
*Sep 18 23:35:49.811: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/0, changed state to down
R1#

A look at the IP routing tables of R1 verifies that the floating static default routes are now installed as the default routes and are pointing to R3 as the next-hop router.

R1# show ip route static | begin Gateway
Gateway of last resort is 10.10.10.2 to network 0.0.0.0
S*    0.0.0.0/0 [5/0] via 10.10.10.2
R1# show ipv6 route static | begin :: 
S   ::/0 [5/0] 
     via 2001:DB8:FEED:10::2
R1#

15.4.4 Syntax Checker – Configure Floating Static Route

Configure and verify floating static routes based on the specified requirements.

CCNA 2 v7.0 Curriculum: Module 15 - IP Static Routing 31

Configure an IPv4 default static route on R3 using the next-hop address 192.168.1.2.

R3(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.2
Configure an IPv4 default static route on R3 using the next-hop address 10.10.10.1 with an administrative distance of 5.

R3(config)#ip route 0.0.0.0 0.0.0.0 10.10.10.1 5
Configure an IPv6 default static route on R3 using the next-hop address 2001:db8:cafe:1::2

R3(config)#ipv6 route ::/0 2001:db8:cafe:1::2
Configure an IPv6 default route on R3 using the next-hop address 2001:db8:feed:10::1 with an administrative distance of 5.

R3(config)#ipv6 route ::/0 2001:db8:feed:10::1 5
Exit configuration mode and display the IPv4 routing table.

R3(config)#exit
\*Sep 20 02:55:53.327: %SYS-5-CONFIG\_I: Configured from console by console
R3#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   
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   
\+ - replicated route, % - next hop override   
  
Gateway of last resort is 192.168.1.2 to network 0.0.0.0  
  
S\* 0.0.0.0/0 \[1/0\] via 192.168.1.2
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.10.10.0/24 is directly connected, Serial0/1/0
L        10.10.10.2/32 is directly connected, Serial0/1/0
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Serial0/1/1
L        192.168.1.1/32 is directly connected, Serial0/1/1
      192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.2.0/24 is directly connected, GigabitEthernet0/0/0
L        192.168.2.1/32 is directly connected, GigabitEthernet0/0/0
Display the IPv6 routing table.

R3#show ipv6 route
IPv6 Routing Table - default - 8 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
       B - BGP, R - RIP, H - NHRP, I1 - ISIS L1
       I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP
       EX - EIGRP external, ND - ND Default, NDp - ND Prefix, DCE - Destination
       NDr - Redirect, RL - RPL, O - OSPF Intra, OI - OSPF Inter
       OE1 - OSPF ext 1, OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1
       ON2 - OSPF NSSA ext 2, a - Application
S   ::/0 \[1/0\]
     via 2001:DB8:CAFE:1::2
C   2001:DB8:CAFE:1::/64 \[0/0\]
     via Serial0/1/1, directly connected
L   2001:DB8:CAFE:1::1/128 \[0/0\]
     via Serial0/1/1, receive
C   2001:DB8:CAFE:2::/64 \[0/0\]
     via GigabitEthernet0/0/0, directly connected
L   2001:DB8:CAFE:2::1/128 \[0/0\]
     via GigabitEthernet0/0/0, receive
C   2001:DB8:FEED:10::/64 \[0/0\]
     via Serial0/1/0, directly connected
L   2001:DB8:FEED:10::2/128 \[0/0\]
     via Serial0/1/0, receive
L   FF00::/8 \[0/0\]
     via Null0, receive
You have successfully configured and verified floating static routes.

15.5 Configure Static Host Routes

15.5.1 Host Routes

This topic shows you how to configure an IPv4 and IPv6 static host route and when to use them.

A host route is an IPv4 address with a 32-bit mask, or an IPv6 address with a 128-bit mask. The following shows the three ways a host route can be added to the routing table:

  • Automatically installed when an IP address is configured on the router (as shown in the figures)
  • Configured as a static host route
  • Host route automatically obtained through other methods (discussed in later courses)

15.5.2 Automatically Installed Host Routes

Cisco IOS automatically installs a host route, also known as a local host route, when an interface address is configured on the router. A host route allows for a more efficient process for packets that are directed to the router itself, rather than for packet forwarding. This is in addition to the connected route, designated with a C in the routing table for the network address of the interface.

When an active interface on a router is configured with an IP address, a local host route is automatically added to the routing table. The local routes are marked with L in the output of the routing table.

For example, refer to the topology in the figure.

CCNA 2 v7.0 Curriculum: Module 15 - IP Static Routing 34

The IP addresses assigned to the Branch Serial0/1/0 interface are 198.51.100.1/30 and 2001:db8:acad:1::1/64. The local routes for the interface are installed by the IOS in the IPv4 and IPv6 routing tables, as shown in the example.

Branch# show ip route | begin Gateway
Gateway of last resort is not set
      198.51.100.0/24 is variably subnetted, 2 subnets, 2 masks
C        198.51.100.0/30 is directly connected, Serial0/1/0
L        198.51.100.1/32 is directly connected, Serial0/1/0
Branch# show ipv6 route | begin :: 
C   2001:DB8:ACAD:1::/64 [0/0]
     via Serial0/1/0, directly connected
L   2001:DB8:ACAD:1::1/128 [0/0]
     via Serial0/1/0, receive
L   FF00::/8 [0/0]
     via Null0, receive

15.5.3 Static Host Routes

A host route can be a manually configured static route to direct traffic to a specific destination device, such as the server shown in the figure. The static route uses a destination IP address and a 255.255.255.255 (/32) mask for IPv4 host routes, and a /128 prefix length for IPv6 host routes.

CCNA 2 v7.0 Curriculum: Module 15 - IP Static Routing 35

15.5.4 Configure Static Host Routes

The example shows the IPv4 and IPv6 static host route configuration on the Branch router to access the server.

Branch(config)# ip route 209.165.200.238 255.255.255.255 198.51.100.2
Branch(config)# ipv6 route 2001:db8:acad:2::238/128 2001:db8:acad:1::2
Branch(config)# exit
Branch#

15.5.5 Verify Static Host Routes

A review of both the IPv4 and IPv6 route tables verifies that the routes are active.

Branch# show ip route | begin Gateway
Gateway of last resort is not set
      198.51.100.0/24 is variably subnetted, 2 subnets, 2 masks
C        198.51.100.0/30 is directly connected, Serial0/1/0
L        198.51.100.1/32 is directly connected, Serial0/1/0
      209.165.200.0/32 is subnetted, 1 subnets
S        209.165.200.238 [1/0] via 198.51.100.2
Branch# show ipv6 route
(Output omitted)
C   2001:DB8:ACAD:1::/64 [0/0]
     via Serial0/1/0, directly connected
L   2001:DB8:ACAD:1::1/128 [0/0]
     via Serial0/1/0, receive
S   2001:DB8:ACAD:2::238/128 [1/0]
     via 2001:DB8:ACAD:1::2
Branch#

For IPv6 static routes, the next-hop address can be the link-local address of the adjacent router. However, you must specify an interface type and an interface number when using a link-local address as the next hop, as shown in the example. First, the original IPv6 static host route is removed, then a fully specified route configured with the IPv6 address of the server and the IPv6 link-local address of the ISP router.

Branch(config)# no ipv6 route 2001:db8:acad:2::238/128 2001:db8:acad:1::2
Branch(config)# ipv6 route 2001:db8:acad:2::238/128 serial 0/1/0 fe80::2
Branch# show ipv6 route | begin ::
C   2001:DB8:ACAD:1::/64 [0/0]
     via Serial0/1/0, directly connected
L   2001:DB8:ACAD:1::1/128 [0/0]
     via Serial0/1/0, receive
S   2001:DB8:ACAD:2::238/128 [1/0]
     via FE80::2, Serial0/1/0
Branch#

15.5.7 Syntax Checker – Configure Static Host Routes

Configure and verify static host routes based on the specified requirements

CCNA 2 v7.0 Curriculum: Module 15 - IP Static Routing 36

Display the routing tables on the Branch router.
- Issue the command to view the IPv4 routing table.
- Issue the command to view the IPv6 routing table.
Branch#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
       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
       + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
      198.51.100.0/24 is variably subnetted, 2 subnets, 2 masks
C        198.51.100.0/30 is directly connected, Serial0/1/0
L        198.51.100.1/32 is directly connected, Serial0/1/0
Branch#show ipv6 route
IPv6 Routing Table - default - 3 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
       B - BGP, R - RIP, H - NHRP, I1 - ISIS L1
       I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP
       EX - EIGRP external, ND - ND Default, NDp - ND Prefix, DCE - Destination
       NDr - Redirect, RL - RPL, O - OSPF Intra, OI - OSPF Inter
       OE1 - OSPF ext 1, OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1
       ON2 - OSPF NSSA ext 2, a - Application
C   2001:DB8:ACAD:1::/64 \[0/0\]
     via Serial0/1/0, directly connected
L   2001:DB8:ACAD:1::1/128 \[0/0\]
     via Serial0/1/0, receive
L   FF00::/8 \[0/0\]
     via Null0, receive
Enter Global Configuration mode to configure the following:
- A static IPv4 route to a host at address 209.165.200.238 and an exit interface of s0/1/0.
- A static IPv6 route to a host at address 2001:db8:acad::2 and an exit interface of s0/1/0.
Note: Be sure to use s0/1/0 as the interface designation.

Branch#configure terminal
Branch(config)#ip route 209.165.200.238 255.255.255.255 s0/1/0
Branch(config)#ipv6 route 2001:db8:acad:2::238 s0/1/0
Exit configuration mode and display the IPv4 and IPv6 routing tables.

Branch(config)#exit
\*Sep 19 19:06:47.301: %SYS-5-CONFIG\_I: Configured from console by console
Branch#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
       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
       + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
      198.51.100.0/24 is variably subnetted, 2 subnets, 2 masks
C        198.51.100.0/30 is directly connected, Serial0/1/0
L        198.51.100.1/32 is directly connected, Serial0/1/0
      209.165.200.0/32 is subnetted, 1 subnets
S        209.165.200.238 is directly connected, Serial0/1/0
Branch#show ipv6 route
IPv6 Routing Table - default - 4 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
       B - BGP, R - RIP, H - NHRP, I1 - ISIS L1
       I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP
       EX - EIGRP external, ND - ND Default, NDp - ND Prefix, DCE - Destination
       NDr - Redirect, RL - RPL, O - OSPF Intra, OI - OSPF Inter
       OE1 - OSPF ext 1, OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1
       ON2 - OSPF NSSA ext 2, a - Application
C   2001:DB8:ACAD:1::/64 \[0/0\]
     via Serial0/1/0, directly connected
L   2001:DB8:ACAD:1::1/128 \[0/0\]
     via Serial0/1/0, receive
S   2001:DB8:ACAD:2::238/128 \[1/0\]
     via Serial0/1/0, directly connected
L   FF00::/8 \[0/0\]
     via Null0, receive
You have successfully configured static host routes.

15.6 Module Practice and Quiz

15.6.1 Packet Tracer – Configure IPv4 and IPv6 Static and Default Routes

In this Packet Tracer summary activity, you will configure static, default, and floating static routes for both the IPv4 and IPv6 protocols.

15.6.1 Packet Tracer – Configure IPv4 and IPv6 Static and Default Routes

15.6.2 Lab – Configure IPv4 and IPv6 Static and Default Routes

In this lab, you will complete the following objectives:

  • Part 1: Build the Network and Configure Basic Device Settings
  • Part 2: Configure and Verify IP and IPv6 Addressing on R1 and R2
  • Part 3: Configure and Verify Static and Default Routing for IPv4 on R1 and R2
  • Part 4: Configure and Verify Static and Default Routing for IPv6 on R1 and R2

15.6.2 Lab – Configure IPv4 and IPv6 Static and Default Routes

15.6.3 What did I learn in this module?

Static Routes

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, and summary static route. Static routes are configured using the ip route and ipv6 route global configuration commands. 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, directly connected, and fully specified. IPv4 static routes are configured using the following global configuration command: ip route network-address subnet-mask { ip-address | exit-intf [ip=address] } [distance]. IPv6 static routes are configured using the following global configuration command: ipv6 route ipv6-prefix/prefix-length { ipv6-address | exit-intf [ipv6-address]} [distance]. The command to start an IPv4 routing table is show ip route | begin Gateway. The command to start an IPv6 routing table is show ipv6 route | begin C.

Configure IP Static Routes

In a next-hop static route, only the next-hop IP address is specified. The exit interface is derived from the next hop. When configuring a static route, another option is to use the exit interface to specify the next-hop address. Directly connected static routes should only be used with point-to-point serial interfaces. In a fully specified static route, both the exit interface and the next-hop IP address are specified. This form of static route is used when the exit interface is a multi-access interface and it is necessary to explicitly identify the next hop. The next hop must be directly connected to the specified exit interface. In a fully specified IPv6 static route, both the exit interface and the next-hop IPv6 address are specified. Along with show ip routeshow ipv6 routeping and traceroute, other useful commands to verify static routes include: show ip route staticshow ip route network, and show running-config | section ip route. Replace ip with ipv6 for the IPv6 versions of the command.

Configure IP Default Static Routes

A default route is a static route that matches all packets. A default route does not require any far-left bits to match between the default route and the destination IP address. Default static routes are commonly used when connecting an edge router to a service provider network, and a stub router. 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 command syntax for an IPv6 default static route is similar to any other IPv6 static route, except that the ipv6-prefix/prefix-length is ::/0, which matches all routes. To verify an IPv4 default static route, use the show ip route static command. For IPV6 use the show ipv6 route static command.

Configure Floating Static Routes

Floating static routes are static routes that are used to provide a backup path to a primary static or dynamic route in the event of a link failure. 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 distances of some common interior gateway dynamic routing protocols are EIGRP = 90, OSPF = 110, and IS-IS = 115. IP floating static routes are configured by using the distance argument to specify an administrative distance. If no administrative distance is configured, the default value (1) is used. The show ip route and show ipv6 route output verifies that the default routes to a router are installed in the routing table.

Configure Static Host Routes

A host route is an IPv4 address with a 32-bit mask or an IPv6 address with a 128-bit mask. There are three ways a host route can be added to the routing table: automatically installed when an IP address is configured on the router, configured as a static host route, or automatically obtained through other methods not covered in this module. Cisco IOS automatically installs a host route, also known as a local host route, when an interface address is configured on the router. A host route can be a manually configured static route to direct traffic to a specific destination device. For IPv6 static routes, the next-hop address can be the link-local address of the adjacent router; however, you must specify an interface type and an interface number when using a link-local address as the next hop. To do this, the original IPv6 static host route is removed, then a fully specified route is configured with the IPv6 address of the server and the IPv6 link-local address of the ISP router.

15.6.4 Module Quiz – IP Static Routing

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x