Static Routes CCNA
Static Routes CCNA

Static Routes

Static Routes
5

Summary

This topic describe the command syntax for static routes. Start learning CCNA 200-301 for free right now!!

Note: Welcome: This topic is part of Module 15 of the Cisco CCNA 2 course, for a better follow up of the course you can go to the CCNA 2 section to guide you through an order.

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.

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 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.

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.

Dual-Stack Topology

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

Dual-Stack Topology
Dual-Stack Topology

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)

IPv6 Starting Routing Tables

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.

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)

Glossary: If you have doubts about any special term, you can consult this computer network dictionary.

Ready to go! Keep visiting our networking course blog, give Like to our fanpage; and you will find more tools and concepts that will make you a networking professional.

More Goodies
Network Documentation CCNA
Network Documentation