Understanding IPv4 / IPv6 Static Route. Configuration Example.

By | December 4, 2023

What is Static Route?

Static routing is when network administrators manually add or configure routes on each router interface with IP addresses. This can be a challenging task, particularly in the management of large networks. Dynamic routing protocols, on the other hand, automate the process of updating routing tables and exchanging route information between routers. This can greatly simplify network management and reduce the likelihood of human error.

Static routes are most often used to connect to a specific network or to provide a Gateway of Last Resort for a stub network. They can also be used to:

= Reduce the number of routes advertised by summarizing several contiguous networks as one static route.

= Create a backup route in case a primary route link fails

In as much as it’s a complex task, there are benefits of static routes:

i.     Bandwidth usage between routers is at a minimum, none in some cases.

ii.   There is no overhead on the router CPU.

iii.  It adds security due to the choice of route configuration by the administrator.

iv.  It reduces the number of routes found in the routing table.

Disadvantages of Static Routes:

i.   Takes too many man-hours for configuration, especially in a large network.

ii.  Too complex and can sometimes be confusing during troubleshooting.

III.  Administrator intervention is required to maintain changing route information.

IV.  Does not scale well with growing networks; maintenance becomes cumbersome.

V. Requires complete knowledge of the whole network for proper implementation.

When to Use Static Routes 

Static routing has 3 primary uses:

i. Providing simple routing table maintenance in smaller networks that aren’t expected to grow considerably.

ii. Routing to and from stub networks. A stub network is a network accessed by a single route, and the router has just one neighbour.

iii. Using a single default route to represent a path to any network that doesn’t have an additional specific match with another route within the routing table. Default routes are accustomed to sending traffic to any destination beyond the next upstream router.

Static Router command syntax: 

Ip route {destination network address} {mask}  {next hop address or exit interface}

We will use the following network topology as an example. All necessary interfaces had been configured with IP addresses.

IPv4

staticroute

Remember the Static Router command syntax:

ip route {destination network address} {mask}  {next hop address or exit interface}

Static Route configuration on HQ router:

HQ(config)#ip route 172.16.10.0 255.255.255.0 10.10.11.2

HQ(config)#interface serial 0/0/0

HQ(config-if)#clock rate 64000

HQ(config-if)#end

HQ#

Command syntax explained from the example configuration above:

ip route: this command creates the static route and tells the router that this is a static route.

172.16.10.0: This is the remote network we want to send the packet to.

255.255.255.0: This is the mask of the remote network.

10.10.11.2: This is the next hop router address we are sending the packet.

Here, the exit interface could be used in the place of next-hop address:

HQ(config)#ip route 172.16.10.0 255.255.255.0 se0/0/0

HQ(config)#end

Verify your configuration from the routing table:

HQ#show ip route

The represents the static route with the administrative distance of 1. The router gives priority to static routes over dynamic routes, where 0 is best and 255 is worst!

To verify the connectivity, Ping from PC 1 to PC 5

PC1

Also, Ping from PC 7 to PC 3

PC7>ping 192.168.30.4

IPv6 Static Route

The diagram below shows a network topology illustrating static routing in an IPv6 environment.

Diagram is copyright from same publisher

Here is an explanation of the components and the routing logic represented:

The network between R1 and Sw1 has the IPv6 prefix 2001:FC8:A72C:A::/64.
The network between R2 and Sw2 has the IPv6 prefix 2001:FC8:A72C:B::/64.
The link between R1 and R2 has been allocated the subnet FC00::1/64 on R1’s side and FC00::2/64 on R2’s side. This is a point-to-point link between the two routers.


Each router interface on the local network segments is configured with eui-64, which indicates that the interface will use the EUI-64 format to automatically generate the interface ID portion of its IPv6 address based on its MAC address.


Static Route: The serial (s/0) link between R1 and R2 represents a static route. This indicates that any traffic from R1 destined for the network 2001:FC8:A72C:B::/64 should be sent directly to R2 via the S0 interface.

Configuration Example

To configure a static route in the above network scenario, we will need to add a route to each router that points to the other router for the destination network it is not directly connected to. Here’s an example of how this would look in a Cisco-like command-line interface for both routers:

Configuration on Router R1 (R1)
Router R1 needs a static route to reach the network 2001:FC8:A72C:B::/64, which is directly connected to Router R2. To achieve this, R1 must be configured with the following command:

R1(config)#ipv6 route 2001:FC8:A72C:B::/64 FC00::2

In this command:

ipv6 route is the command to enter a static route into the IPv6 routing table.
2001:FC8:A72C:B::/64 is the destination network prefix you are routing to.
FC00::2 is the next-hop IPv6 address that corresponds to the interface on R2 that is directly connected to R1.

Configuration on Router R2 (R2)
Router R2 needs a static route to reach the network 2001:FC8:A72C:A::/64, which is directly connected to Router R1. The command would be:

R2(config)#ipv6 route 2001:FC8:A72C:A::/64 FC00::1

Here:

2001:FC8:A72C:A::/64 is the destination network prefix that R2 wants to reach.
FC00::1 is the next-hop IPv6 address that is assigned to the interface on R1 that connects directly to R2.
These static route configurations tell each router where to forward packets destined for the network that is not within their direct connected routes. It is assumed that the interfaces on both routers are already configured with their respective IPv6 addresses and that any necessary IPv6 unicast-routing commands have been executed.

Remember, these are basic static route configurations and do not include configurations for security, redundancy, or other advanced routing features that might be necessary in a production environment.

This configuration ensures that traffic from PC1 to PC2, and vice versa, will route through R1 and R2. If PC1 wants to send traffic to a network not explicitly listed in R1’s routing table, it would use the default route, which would likely be through R2 (assuming R2 has a path to the broader internet or other networks).

In conclusion, the use of static routes is ideal when the network topology is simple, stable, and the routing paths are known and consistent. Static routes are easy to configure and require minimal overhead, making them a cost-effective solution for small networks with few changes. However, in larger or more dynamic networks, the manual configuration and maintenance of static routes can become cumbersome and inefficient. In such cases, dynamic routing protocols that automatically adjust to network changes may be more suitable.

How to Configure Default Routes RIPv2 IPv6 Explained EIGRPv6

RIPv6 or RIPng OSPFv3 DHCPv6