In this article, I will tell you how to do Static Routing on Routers with Cisco Packet Tracer software. First, I will explain its importance in a small network environment by setting a fixed route on routers.
When you follow the step-by-step instructions and commands, you will be able to add a Static route and communicate between different segments. So, let’s start this network journey to understand better and apply this method!
How to Set Up Static Routing on a Cisco Router
There are two types of routing. These;
In this article, after explaining what Static Routing is and how it works, we will configure routing in a small network environment.
If the network environment consists of several Routers, it is recommended that you use static routes for routing. When routers are configured with dynamic routing, they work slower in terms of performance. However, in a small network environment, we can make routers work more efficiently by manually adding routes.
You need to configure this routing type manually compared to others. However, since it will be challenging to perform this process in a growing network, you can use the appropriate dynamic routing type.
Enabling Static Routing Between Two Cisco Routers with Packet Tracer
Now, to add a static route to your routers with Cisco Packet Tracer, follow the steps below.
Step 1
Open the simulator program and configure the TCP/IP settings of the computers after creating the network topology, as shown in the image below.
Step 2
To configure the GigabitEthernet and Serial interfaces of the Cisco Router, open the CLI prompt and execute the following commands.
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#
R1(config)#interface gigabitethernet 0/0
R1(config-if)#ip address 192.168.5.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
R1(config-if)#exit
R1(config)#
R1(config)#interface serial0/1/0
R1(config-if)#ip address 10.1.1.1 255.255.255.0
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/1/0, changed state to down
R1(config-if)#end
R1#
%SYS-5-CONFIG_I: Configured from console by console
R1#
Step 3
In the same way, configure the GigabitEthernet and Serial interfaces of the R2 router with the following commands.
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2
R2(config)#
R2(config)#interface gigabitethernet 0/0
R2(config-if)#ip address 192.168.10.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
R2(config-if)#exit
R2(config)#
R2(config)#interface serial 0/1/0
R2(config-if)#ip address 10.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#
%LINK-5-CHANGED: Interface Serial0/1/0, changed state to up
R2(config-if)#end
R2#
Step 4
Before adding a static route to the routers, ping the default gateway from PC0 and the Serial interface of R1 to test the network connection.
Pinging will be successful as follows.
Step 5
Also, test the connection by pinging the default gateway via PC1 and the Serial interface of the R2 to which it is connected.
Step 6
When you ping the PC0 to the Serial interface of Cisco Router R2 and the computer on its 192.168.5.0/24 network, it will fail, as shown in the image below.
Step 7
Also, ping R11’s interfaces from PC1 and check the result.
Step 8
Pinging between clients in two segments failed because no routing was enabled in the network environment. If you ping the Router from the Router according to this network design, you will see that the result is successful.
For example, ping from R1 to R2 would be successful as follows;
Step 9
Pinging from R2 to R1 will also be successful.
Step 10
Now, add a static route to the Routers so that PC0 can communicate with PC1. To add a static route to R1, execute the command ip route 192.168.10.0 255.255.255.0 10.1.1.2.
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ip route 192.168.10.0 255.255.255.0 10.1.1.2
R1(config)#exit
R1#
After enabling Static routing on R1, execute the show ip route command and check whether the output contains line S 192.168.10.0/24 [1/0] via 10.1.1.2.
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.1.1.0/24 is directly connected, Serial0/1/0
L 10.1.1.1/32 is directly connected, Serial0/1/0
192.168.5.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.5.0/24 is directly connected, GigabitEthernet0/0
L 192.168.5.1/32 is directly connected, GigabitEthernet0/0
S 192.168.10.0/24 [1/0] via 10.1.1.2
R1#
S 192.168.10.0/24 [1/0] via 10.1.1.2 ⇒ This line indicates that PC0 will reach the network environment 192.168.10.0/24 via the IP address 10.1.1.2.
Step 11
To add a static route to R2, use the following command:
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#
R2(config)#ip route 192.168.5.0 255.255.255.0 10.1.1.1
R2(config)#
R2(config)#exit
R2#
Show ip route command output in R2;
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.1.1.0/24 is directly connected, Serial0/1/0
L 10.1.1.2/32 is directly connected, Serial0/1/0
S 192.168.5.0/24 [1/0] via 10.1.1.1
192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.10.0/24 is directly connected, GigabitEthernet0/0
L 192.168.10.1/32 is directly connected, GigabitEthernet0/0
R2#
S 192.168.5.0/24 [1/0] via 10.1.1.1 ⇒ This line indicates that PC1 will access the network environment 192.168.5.0/24 via IP address 10.1.1.1.
Step 12
After configuring Static Routing on routers, test the connection by pinging PC0 to PC1. Clients in two different locations will now be able to communicate successfully with each other.
Step 13
Likewise, when pinging from PC1 to PC0, ping will be successful as follows.
Show Commands for Static Routing
- R1# show running-config
- R2# show running-config
Video
You can watch the video below to enable static routing on Packet Tracer. Also, subscribe to our YouTube channel to support us!
Conclusion
As a result, I successfully configured static routes on two routers using Cisco simulator software. Then, I established communication between PCs in two separate segments.
In short, with all the steps I provided, you can create an efficient and secure connection in a network environment. This method is especially preferred in structures with smaller environments. Therefore, I recommend choosing dynamic ones instead of static routing in environments that are not suitable.
You are the best. Saved me alot. Please add donate button to your website.