Static route configuration is a fundamental method of building routing tables in networking. It involves manually adding network addresses leading to other networks to a router. This enables the router to be able to determine the best path for forwarding packets.
Static Route Configuration Methods
Static route configuration can be implemented using either the Command Line Interface (CLI) or the Graphic User Interface (GUI).
While GUI interfaces may offer more visual and intuitive options, configuring static routes via the CLI provides a deeper understanding of networking principles and allows for precise control over routing decisions.
In this demonstration, we will configure static using the CLI. If you are curious to learn how to configure a static route using the GUI, read our post on static route configuration using the GUI.
Next Hop in Static Routing
The concept of the next hop is central to routing. It refers to the next network device to which a packet is forwarded as it exits a router.
When a router receives a packet, it examines the destination IP address and consults its routing table to determine the appropriate interface for forwarding the packet towards its destination. The next hop IP address plays a crucial role in this process, as it directs the packet along the correct path to reach its intended destination efficiently.
Determining Next Hop and Network IP
To determine the next hop IP address static routing, it’s essential to consider the network topology and the devices involved in establishing connectivity. For instance, if you aim to establish connectivity between two PCs in a network, you must identify the routers along the shortest path between them.
Suppose we intend to configure a static route between two PCs with two routers between them. In that case, the next hop IP address of the left-hand router corresponds to the IP address of the interface connecting it to the right-hand router.
For example, if PC0 in the network below is trying to communicate with PC3, it will forward the packet to R1, which is PC0’s default gateway. R1 will then forward the packet to R2 because it is R2 that is directly connected to PC3. In this case, R2 is the Next Hop router to R1 and the IP address; 192.168.2.4 is the Next Hop IP address.
Network Topology
The network topology we will be making use of in this post is shown below. As you can see, it consists of three routers.
In this demonstration, we will configure static routes on each of the routers so that they can reach each other.
How to Configure Static Route in Cisco Router
Here are steps to configure static route in cisco router for the network shown above;
Step 1: Configure the interfaces of the router.
The first step is to assign an IP address to the interface of the routers.
Router 1
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface loopback 0
R1(config-if)#ip address 1.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
Here is a brief explanation of the commands that you might find confusing;
- R1(config)#interface loopback 0: This command enters interface configuration mode for Loopback interface 0 on Router 1. Loopback interfaces are virtual interfaces that exist only within the router’s memory and are commonly used for testing, management, and routing purposes.
- R1(config-if)#ip address 1.1.1.1 255.255.255.0: This command assigns the IP address 1.1.1.1 to Loopback interface 0 with a subnet mask of 255.255.255.0. The IP address and subnet mask define the network address and size of the loopback interface.
Router 2
R2(config)#interface ethernet0/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface ethernet0/1
R2(config-if)#ip address 192.168.21.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface loopback 0
R2(config-if)#ip address 2.2.2.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
Router 3
R3(config)#interface ethernet0/1
R3(config-if)#ip address 192.168.21.2 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface loopback 0
R3(config-if)#ip address 3.3.3.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
Step 2: Configure the static routes
Router 1
On Router 1, we are trying to add a route to the 192.168.21.0 network and to the loopback interface of Router 2 and Router 3. In this case, the next hop to Router 1 is Router 2. It will forward its traffic first to the e0/0 interface of the router 2. Here is static route configuration.
R1(config)#ip route 192.168.21.0 255.255.255.0 192.168.12.2
R1(config)#ip route 3.3.3.0 255.255.255.0 192.168.12.2
R1(config)#ip route 2.2.2.0 255.255.255.0 192.168.12.2
The first line configures a static route for the 192.168.21.0/24 network. 192.168.12.2 is the next-hop IP address.
Similarly, lines 2 and 3 configure a static route to the loop back interfaces of router 3 and router 2, respectively.
Router 2
On router 2, we are trying to add a static route to the loop-back interface of routers 1 and Router 3. Hence, the configuration is as follows:
R2(config)#ip route 1.1.1.0 255.255.255.0 192.168.12.1
R2(config)#ip route 3.3.3.0 255.255.255.0 192.168.21.2
Router 3
On Router 3, we are trying to add a static route to the loop back interfaces of router 1 and router 2 and then add a static route to the 192.168.12.0 /24 network. Hence, the configuration follows:
R3(config)#ip route 192.168.12.0 255.255.255.0 192.168.21.1
R3(config)#ip route 1.1.1.0 255.255.255.0 192.168.21.1
R3(config)#ip route 2.2.2.0 255.255.255.0 192.168.21.1
Step 3: Test connectivity
To test if the configuration was done properly, from the user exec mode of router 1, ping the IP address of router 2. Also, from the user exec mode of router 3, ping the IP address of router 1. If you get a reply, it means the static route configuration was done properly.
Related:
How To Configure Dynamic Routing In Cisco Packet Tracer
Reference: https://github.com/misterkrittin/CCNA-Labs
I am a passionate Networking Associate specializing in Telecommunications.
With a degree in Electronic engineering, I possess a strong understanding of electronic systems and the intricacies of telecommunications networks. I gained practical experience and valuable insights working for a prominent telecommunications company.
Additionally, I hold certifications in networking, which have solidified my expertise in network architecture, protocols, and optimization.
Through my writing skills, I aim to provide accurate and valuable knowledge in the networking field.
Connect with me on social media using the links below for more insights.
You can contact me using [email protected] or connect with me using any of the social media account linked below