What is Static Routing in Networking?
Static routing is a type of network routing technique that involves manually setting up routes between two or more nodes in a given network. Static routing works by having the administrator of the network configure specific routes between certain nodes, allowing data packets to travel only along those predetermined paths instead of seeking out other available routes.
What are the Advantages of Static Routing?
Here are several advantages of static routing:
- Security: Static routing is considered more secure than dynamic routing, as it allows administrators to control exactly which nodes can access which resources. This makes it much harder for malicious actors to gain access to the network.
- Simplicity and Reliability: This remains unchanged unless an administrator makes a manual change because static routes are manually configured, which makes them more reliable.
- Efficiency: Many networks are likely to have many static routes as opposed to dynamic routes, meaning that the amount of processing needed to find an optimal route is reduced compared to dynamic routing. This can help reduce bandwidth usage and make the network more efficient.
What are the Disadvantages of Static Routing?
Although static routing has its advantages, it also has some significant disadvantages, including:
- Inefficiency: As with dynamic routing, static routes can become inefficient if a network topology changes or if there are new nodes added to the network. This is because the routes need to be manually updated, meaning that resources can be wasted if the network is not actively monitored.
- Lack of Flexibility: Static routing works best in simple networks as it only allows for one pre-determined route between two nodes. This lack of flexibility can cause problems in larger and more complex networks where different paths may be needed depending on the situation.
- The difficulty of Configuration: Configuring static routes in a network can be difficult and time-consuming, as it requires an administrator to manually enter each route. This process can become even more complex when dealing with larger networks that have multiple devices and nodes.
How to Configure a Static Routing in a Router?
Configuring Via CLI
Here are the steps for setting up a static route via CLI:
1. Connect to the router using an SSH client, such as PuTTY.
2. Enter enable mode by typing in “enable” and entering your password when prompted.
3. Configure the Router Interface according to your Network Requirements.
4. Enter “IP route {IP address} {Subnet Mask} {Gateway IP Address}”, where the IP address is the destination network, a subnet mask is a mask for that network, and the gateway IP address is the next hop router for this static route.
5. Configure Static Route on Router 3 as per the diagram.
6. Type out “end” to exit configure terminal mode and then type “write memory” to save your changes.
- Example: Router(Config)# IP route 10.0.0.0 255.255.255.0 10.1.2.3
This command will set up a static route for the network 10.0.0.0/24 to the next hop router at 10.1.2.3
How to Modify the Static Routing?
Here are the steps for modifying a static route via CLI:
- Connect to the router using an SSH client, such as PuTTY.
- Enter enable mode by typing in “enable” and entering your password when prompted.
- Type out the command “configure terminal” and press enter.
- Enter “no IP route {IP address} {Subnet Mask} {Gateway IP Address}”, where the IP address is the destination network, a subnet mask is a mask for that network, and the gateway IP address is the next hop router for this static route.
- Type out the command “IP route {IP address} {Subnet Mask} {New Gateway IP Address}” to make the new changes.
- Press enter to save your new static route.
- Type out “end” to exit configure terminal mode and then type “write memory” to save your changes.
Example:
- Router(Config)# no IP route 10.0.0.0 255.255.255.0 10.1.2.3
- Router(Config)# IP route 10.0.0.0 255.255 255 0 10.1 .3 .4
This command will remove the existing static route for the network 10.0.0.0/24 to the next hop router at 10.1.2.3, and replace it with a new one pointing to 10.1 .3 .4 as the next hop router for this static route.
Which commands would help you solve a static route problem?
The following commands will help you troubleshoot and solve a static route problem:
- Show IP route: Displays all IP routes configured on the router.
- Traceroute: Helps identify which hop is causing an issue with the specified destination address.
- Ping: Allows for diagnostic testing to check if a particular host is reachable.
- Show IP protocols: Displays all the configured routing protocols on the router.
- Clear IP route * (all): Removes a static route from the router’s routing table.
- Show IP interface brief: Displays the status of each interface on the router.
- Show IP route static: Displays all static routes configured on the router.
Hi Gurpreet…I enjoy your articles…thank you for your work. I have a rather interesting situation on a linux box – here are the details.
Is there a failover mechanism that exist in the routing? For example – in a multi homed linux server(imagine – 2 NICs with different IPs in different subnets and each having its own gateway) how it will be able to identify which NIC to use to reach a destination that is reachable only via (say) NIC2? If it chooses (say) NIC1 whereas the right decision is NIC2, can I somehow make the kernel failover and upon ICMP network unreachable message, the system doesn’t give up but tries the other NIC? This is important when you are trying to initiate connections (not as a router but for outgoing connections). Thanks
In Router, We can achieve a failover mechanism via Static Routing ( Policy Base Route ) and We can configure track there for trigger ICMP messages.
As per my understanding, Failover mechanisms can be implemented in Linux using the routing daemon “Quagga”. Quagga provides a number of tools for managing network traffic and can be used to configure failover mechanisms. To configure a failover mechanism with Quagga, you need to use the “route-map” command.