1. What is a static route?
Static routing is a routing method in which routing items are manually configured rather than dynamically determined. Unlike dynamic routing , static routing is fixed and does not change even if network conditions change or are reconfigured. Generally speaking, static routes are added to the routing table item by item by our network management .
Introduce the syntax of this static route
ip route [target network segment IP address] [subnet mask] [next hop address]
Let's not talk much, let's go straight to the actual operation
2. Static routing configuration (basic practice)
Equipment name | interface name | IP address | subnet mask | gateway |
PC-1 | e0 | 192.168.1.1 | 255.255.255.0 | 192.168.1.254 |
PC-2 | e0 | 192.168.2.1 | 255.255.255.0 | 192.168.2.254 |
R1 | S0/2 | 192.168.3.1 | 255.255.255.0 | none |
e0/0 | 192.168.1.254 | 255.255.255.0 | none | |
R2 | S0/2 | 192.168.3.2 | 255.255.255.0 | none |
e0/0 | 192.168.2.254 | 255.255.255.0 | none |
1. Mission requirements
By configuring static routes for R1 and R2, PC-1 and PC-2 can communicate with each other successfully
2. Configuration process
Static routing configuration information of R1:
ip route 192.168.2.0 255.255.255.0 192.168.3.2
Static routing configuration information of R2:
ip route 192.168.1.0 255.255.255.0 192.168.3.1
3. Verification
1. Ask PC-1 to ping PC-2
You can see that after we configure the static route, we can ping through
PS. I use GNS3
3. Static routing configuration (advanced practice)
Equipment name | interface name | IP address | subnet mask | gateway |
PC1 | e0 | 172.16.1.1 | 255.255.255.0 | 172.16.10.254 |
PC2 | e0 | 192.168.1.1 | 255.255.255.0 | 192.168.1.254 |
PC3 | e0 | 192.168.2.1 | 255.255.255.0 | 192.168.2.254 |
R1 | s2/0 | 192.168.3.2 | 255.255.255.0 | none |
s2/1 | 192.168.4.2 | 255.255.255.0 | none | |
e0/0 | 172.16.1.254 | 255.255.255.0 | none | |
R2 | s2/0 | 192.168.3.1 | 255.255.255.0 | none |
e0/0 | 192.168.1.1 | 255.255.255.0 | none | |
R3 | s2/1 | 192.168.4.1 | 255.255.255.0 | none |
e0/0 | 192.168.2.1 | 255.255.255.0 | none |
1. Mission requirements
Configure static routing through R1, R2, and R3, and successfully enable PC2 and PC3 to ping PC1
2. Configuration process
Static routing configuration information of R1:
ip route 192.168.1.0 255.255.255.0 192.168.3.1
ip route 192.168.2.0 255.255.255.0 192.168.4.1
Static routing configuration information of R2:
ip route 172.16.1.0 255.255.255.0 192.168.3.2
Static routing configuration information of R3:
ip route 172.16.1.0 255.255.255.0 192.168.4.2
3. Verification
1. Ask PC2 and PC3 to ping PC1
2. View the routing table of R1
3. View the routing table of R2
4. View the routing table of R3
4. How to view the routing table
In the above practical operation, we have performed an operation of viewing the routing table. Now let me introduce the routing table
- We use the show ip route command in privileged mode to view the routing table
- We use the do show ip route command in the global configuration to view the routing table (more do)
After entering the command, we saw a few uppercase English letters. What does this mean?
- C (connect): connect routing
- S (static): Static routing
- L (Local): Local routing
After talking about this, let's take the static routing in the routing table of R3 as an example.
It can be seen that the next hop address corresponding to our target network segment 172.16.1.0 is 192.168.4.2
V. Summary
Static routing is very important. It took me nearly 3 hours to fully understand it. Maybe my comprehension is too low. The points I have summarized above are of course based on practical operations, because too many Words are not as strong as hands-on ones.