
要求:1.使用静态路由使PC1 访问 PC2
2.使用默认路由使PC1 访问 PC2
(接口ip已配置好)
1.使用静态路由使PC1 访问 PC2
配置思路
R1要配置去往10.23.23.0网段和10.10.20.0网段的静态路由
R2要配置到10.10.10.0 10.10.20.0 两个网段的静态路由
R3要配置去往10.12.12.0网段和10.10.10.0网段的静态路由
R1:
ip route 10.10.20.0 255.255.255.0 10.12.12.2
ip route 10.23.23.0 255.255.255.252 10.12.12.2
show ip route
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
S 10.23.23.0/30 [1/0] via 10.12.12.2
C 10.12.12.0/30 is directly connected, FastEthernet0/1
C 10.10.10.0/24 is directly connected, FastEthernet0/0
S 10.10.20.0/24 [1/0] via 10.12.12.2
R2:
ip route 10.10.10.0 255.255.255.0 10.12.12.1
ip route 10.10.20.0 255.255.255.0 10.23.23.2
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 10.23.23.0/30 is directly connected, FastEthernet0/1
C 10.12.12.0/30 is directly connected, FastEthernet0/0
S 10.10.10.0/24 [1/0] via 10.12.12.1
S 10.10.20.0/24 [1/0] via 10.23.23.2
R3:
ip route 10.10.10.0 255.255.255.0 10.23.23.1
ip route 10.12.12.0 255.255.255.252 10.23.23.1
show ip route
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 10.23.23.0/30 is directly connected, FastEthernet0/0
S 10.12.12.0/30 [1/0] via 10.23.23.1
S 10.10.10.0/24 [1/0] via 10.23.23.1
C 10.10.20.0/24 is directly connected, FastEthernet0/1
PC1#ping 10.12.12.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.12.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/21/24 ms
2.使用默认路由使PC1 访问 PC2 (仅限在实验室环境,仅作一种实验参考)
配置思路
将三台路由器分别开启通往各个网段的端口的默认路由
R1:
ip route 0.0.0.0 0.0.0.0 FastEthernet0/1 10.12.12.2
show ip route
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.12.12.0/30 is directly connected, FastEthernet0/1
C 10.10.10.0/24 is directly connected, FastEthernet0/0
S* 0.0.0.0/0 [1/0] via 10.12.12.2, FastEthernet0/1
R2:
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0 10.12.12.1
ip route 0.0.0.0 0.0.0.0 FastEthernet0/1 10.23.23.2
show ip route
10.0.0.0/30 is subnetted, 2 subnets
C 10.23.23.0 is directly connected, FastEthernet0/1
C 10.12.12.0 is directly connected, FastEthernet0/0
S* 0.0.0.0/0 [1/0] via 10.23.23.2, FastEthernet0/1
[1/0] via 10.12.12.1, FastEthernet0/0
R3:
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0 10.23.23.1
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0 10.12.12.2
show ip route
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.23.23.0/30 is directly connected, FastEthernet0/0
C 10.10.20.0/24 is directly connected, FastEthernet0/1
S* 0.0.0.0/0 [1/0] via 10.23.23.1, FastEthernet0/0
PC1#ping 10.10.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
本文详细介绍了如何通过静态路由和默认路由实现不同网段间的通信。首先,通过配置静态路由,确保了PC1能够访问PC2;其次,通过设置默认路由,实现了更广泛的网络可达性。文章提供了具体的配置命令和验证步骤。
3368

被折叠的 条评论
为什么被折叠?



