How to configure Static Route – IPv4 and IPv6

We can configure static or dynamic routes after configuring directly connected interfaces. Static routes are manually configured and provide a clear path between two networking devices. However, they must be manually reconfigured if the network topology changes, which is the main disadvantage of static routes.

It is more secure and efficient than dynamic routes. It uses less bandwidth than dynamic routing protocols because no CPU cycles are required to calculate and communicate routes. It provides easy maintenance in smaller networks that are not expected to grow significantly. We can use this route in different situations.

  • We can use static routing from stub networks where a single route accesses a network, and the router has only one neighbor.
  • Using a single default route for a network that does not have a match with another route in the routing table. Default routes send traffic to any destination further than the next upstream router.
  • We can also use a static route to reduce the number of routes advertised by summarizing several nearby networks as one static route.
  • Static routing can also create a backup route if a primary link goes down.
  • Standard static route and Default Static Routes
  • Summary static route
  • Floating static route
  • A route between two specific networks.
  • Static Default Route, also known as Route of Last

Static Route Between Two Specific Network

We can configure a static route to reach a specific remote network. The command syntax for static IP version 4 routes is the following.
Router(config)# ip route network address network mask {next-hop-ip | exit-interface}

The configuration command must be issued in global configuration mode. The static routes are identified with the code ‘S’ in the routing table. The figure below shows the configuration of a static IP version 4 route on Router2 to the Serial 0/3/0 interface.

The static route on Router 2 is configured to reach network 172.16.17.0/24 on Router 3. It is configured using the exit interface toward Router 3. We can also configure the router using the IP address of the next hop. In this example, the next hop is the serial 0/3/0 interface of Router 0.

Both the route with the next-hop address and exit interface are acceptable. There is no difference between them; only they look different in the routing table.

We can also configure the static IP version 6 route between two specific networks. The command should be issued in global configuration mode. The command syntax for the static IPv6 route is as follows.
Router(config)#ipv6 route ipv6-prefix/prefix-length{ipv6-address|interface-type interface-number}

Static Default Route

We can also examine another route “S” with an asterisk pointing to gigabitEthernet 0/1. Asterisk illustrates that it is the default route. It is also known as the gateway of last resort because it is not set for any specific network. If the packet destination is unknown for the router, the router search routing table for the default route.

A default route role is similar to a default gateway on a host. It specifies the path for the packet when the router has no information about the packet’s destination. To configure an IPv4 default route, use the following command in global configuration mode.

Router(config)# ip route 0.0.0.0 0.0.0.0 {exit-interface | next-hop-ip}

Notice that the next-hop address for the default route is the exit interface of the router towards Router 0. We can also configure the default static route with the next-hop IP address similar to the static route configuration. In the same way, we can configure the default static IP version 6 route using the following command in global configuration mode.

Router(config)#ipv6 route ::/0 {ipv6-address |interface-type interface-number}