How to Configure Static Routing on Cisco Devices? Static routing is a setup procedure that facilitates the transfer of data traffic from one network to another. It is a technology used to enhance the efficiency and security of communication between different IP addresses in different network configurations. In #Cisco Router devices, static routing is a configuration feature that enables the communication between different IP addresses connected to different Router devices by entering routing tables into switch devices. It is often preferred in small networks with relatively stable infrastructures.
Advantages of Static Routing:
- It is more secure as the routing table does not change with externally sent network packets.
- It consumes less bandwidth.
Disadvantages of Static Routing:
- It is difficult to manage and implement in large network environments.
- If the network structure is highly variable, updating all routers becomes necessary, which can be a significant time-consuming task and disrupt your workflow.
Static Routing Scenario on Cisco Router
I will demonstrate our example using the Cisco Packet Tracer program. According to the visual example schema, we have two branches in Ordu and Samsun, and I will establish communication between them. Our Ordu location has the following configurations: the gateway is 172.21.1.1, Subnet Mask is 255.255.255.0, and the local computer’s IP address is 172.21.1.10. We configure Ordu PC0 device according to this IP block.
Our Samsun location has the following configurations: the gateway is 172.23.1.1, Subnet Mask is 255.255.255.0, and the local PC1 IP address is 172.23.1.20. Similarly, we will configure our computer in Samsun based on this IP block.
Now let’s move on to the IP addresses between the two routers. We will configure our Serial connection addresses as follows: for Ordu, 126.96.36.199/24, and for the Samsun serial input, 188.8.131.52/24. By defining these IP configurations on the devices, we will enable communication between two different router devices within the company.
Let’s open Router2 named “Samsun” and enter the necessary Cisco commands.
- Router#configure terminal
- Router(config)#hostname samsun (Optional command to name the Router)
samsun(config)#interface gigabitEthernet 0/0/0 (I used this value because I plugged the cable into the Router’s Gig0/0/0 port)
- samsun(config-if)#ip address 172.23.1.1 255.255.255.0
- samsun(config-if)#no sh (Command to activate the Cisco Switch port)
- samsun#write (Command to save the actions made on the Switch)
Let’s configure the Serial Connection settings for Samsun:
- samsun#configure terminal (Command to edit the Cisco Switch)
- samsun(config)#interface serial 0/1/1 (The entered value is because I plugged the cable into the Switch’s se0/1/0 port)
- samsun(config-if)#ip address 184.108.40.206 255.255.255.0
- samsun(config-if)#no sh (Command to activate the port)
- samsun#write (Command to save the actions)
We have completed the IP configuration for the Serial input of the Cisco Router device named “Samsun” and defined the default gateway for the Gigabit input. You can now ping from the computer to Router 2 and establish access. Now let’s proceed to perform the same actions for the Router0 device.
Configuration of Ordu Cisco Router0:
- Router#conf terminal
- Router(config)#hostname ordu
- ordu(config)#interface gigabitEthernet 0/0/1 (I am using this value because I plugged the cable into Router’s gi0/0/1 port)
- ordu(config-if)#ip address 172.21.1.1 255.255.255.0
- ordu(config-if)#no sh (I am activating the port with this command)
Serial Connection Port Configuration for Ordu Cisco Router0:
- ordu#conf terminal
- ordu(config)#interface serial 0/1/0 (I am entering this value because I plugged the cable into Router’s se0/1/0 port)
- ordu(config-if)#ip address 220.127.116.11 255.255.255.0
- ordu(config-if)#no sh (Command to activate the Cisco port)
- ordu#write (Command to save the actions on the Router)
The configuration of the Router named “Ordu” is as follows. You can see that it can ping internally, indicating that there is access. If you want to view the settings you made on a Cisco Router device, such as which input has what IP address, you can enter the following command: `show ip interface brief`.
Now let’s move on to the final step. PC0 and PC1 users still cannot communicate with each other. In other words, we will establish network communication between the two branches by providing static routing. For this, we need to enter the “Samsun” router and create a routing table for the target network, which is the “Ordu” router.
Static Routing on Samsun Router:
- samsun#configure terminal
- samsun(config)#ip route 172.21.1.0 255.255.255.0 18.104.22.168 (I’m entering the IP block of the Ordu branch, which means I’m specifying the path from the Samsun branch to the Ordu branch via 22.214.171.124, the IP address of the Ordu branch)
Note: To view the written Route table on Cisco Switches, you can use the command show ip route.
Finally, from the Ordu branch, we will create a routing table for Samsun.
ordu(config)#ip route 172.23.1.0 255.255.255.0 126.96.36.199 (I’m entering the IP address block of the Samsun configuration and specifying the Serial connection)
After these settings, according to our example diagram, the PC0 user in the Ordu branch will be able to ping the PC1 user in the Samsun branch. In other words, the two users will be able to communicate in the network environment.