Static routing
Static routing is a form of routing that occurs when a router uses a manually-configured routing entry, rather than information from dynamic routing traffic.[1] In many cases, static routes are manually configured by a network administrator by adding in entries into a routing table, though this may not always be the case.[2] Unlike dynamic routing, static routes are fixed and do not change if the network is changed or reconfigured. Static routing and dynamic routing are not mutually exclusive. Both dynamic routing and static routing are usually used on a router to maximise routing efficiency and to provide backups in case dynamic routing information fails to be exchanged. Static routing can also be used in stub networks, or to provide a gateway of last resort.
Uses
Static routing may have the following uses:
- Static routing can be used to define an exit point from a router when no other routes are available or necessary. This is called a default route.
- Static routing can be used for small networks that require only one or two routes. This is often more efficient since a link is not being wasted by exchanging dynamic routing information.
- Static routing is often used as a complement to dynamic routing to provide a failsafe backup if a dynamic route is unavailable.
- Static routing is often used to help transfer routing information from one routing protocol to another (routing redistribution).
Advantages
Static routing, if used without dynamic routing, has the following advantages:[citation needed]
- Static routing causes very little load on the CPU of the router, and produces no traffic to other routers.
- Static routing leaves the network administrator with full control over the routing behavior of the network.
- Static routing is very easy to configure on small networks.
Disadvantages
Static routing can have some potential disadvantages:[3]
- Human error: In many cases, static routes are manually configured. This increases the potential for input mistakes. Administrators can make mistakes and mistype in network information, or configure incorrect routing paths by mistake.
- Fault tolerance: Static routing is not fault tolerant. This means that when there is a change in the network or a failure occurs between two statically defined devices, traffic will not be re-routed. As a result, the network is unusable until the failure is repaired or the static route is manually reconfigured by an administrator.
- Administrative distance: Static routes typically take precedence over routes configured with a dynamic routing protocol. This means that static routes may prevent routing protocols from working as intended. A solution is to manually modify the administrative distance.[4]
- Administrative overhead: Static routes must be configured on each router in the network(s). This configuration can take a long time if there are many routers. It also means that reconfiguration can be slow and inefficient. Dynamic routing on the other hand automatically propagates routing changes, reducing the need for manual reconfiguration.
Example
To route IP traffic destined for the network 10.10.20.0/24 via the next-hop router with the IPv4 address of 192.168.100.1, the following configuration commands or steps can be used:
Linux
Linux distributions generally provide a variety of network configuration software for users to use[5], but also ship with a default such as systemd-networkd or ifupdown.[6] The configuration software of choice is then used to configure the persistent configuration which is applied on boot. It is also possible to configure Linux networking ad-hoc using the ip command from the iproute2 package. The following command can be used to configure the route using ip:[7]
root@router:~# ip route add 10.10.20.0/24 via 192.168.100.1
Cisco
Cisco routers running the Cisco IOS operating system can be configured using the command line interface:[8]
> enable
# configure terminal
(config)# ip route 10.10.20.0 255.255.255.0 192.168.100.1
Configuring administrative distance
The administrative distance can be manually (re)configured so that the static route can be configured as a backup route, to be used only if the dynamic route is unavailable.[9]
(config)# ip route 10.10.20.0 255.255.255.0 exampleRoute 1 254
Setting the administrative distance to 254 will result in the route being used only as a backup.
See also
References
- ^ TCP/IP Tutorial and Technical Overview (IBM RedBooks Series)
- ^ "Cisco IOS Dial Technologies Configuration Guide, Release 12.2SR - Reliable Static Routing Backup Using Object Tracking [Cisco IOS Software Releases 12.2 SR]".
- ^ "Cisco Networking Articles". dummies. Archived from the original on 2013-11-05. Retrieved 2013-11-05.
- ^ Cisco Systems (n.d), Configuring Static Routing, accessed 5 November 2013
- ^ "Chapter 5. Network setup". www.debian.org. Retrieved 2024-12-18.
- ^ "8.2. Configuring the Network". www.debian.org. Retrieved 2024-12-18.
- ^ "16.4. Static Routes and the Default Gateway Red Hat Enterprise Linux 5". docs.redhat.com. Retrieved 2024-12-18.
- ^ "Cisco IOS IP Command Reference, Volume 2 of 4: Routing Protocols, Release 12.3 T - IP Routing Protocol Commands: ip policy route-map through is-type". web.archive.org. 2013-02-02. Retrieved 2024-12-18.
- ^ "Describe Administrative Distance". Cisco. Retrieved 2014-06-12.