要求配置rip动态路由协议实现全网互通
R1和R2的互联地址 192.168.0.0/24
R1和R3的互联地址 192.168.1.0/24
R2和R3的互联地址 192.168.2.0/24
R3和R4的互联地址 192.168.3.0/24
使用loopback接口模拟公司内部的客户端主机
R1的lo 0 192.168.10.1/24
R2的lo 0 192.168.20.1/24
R3的lo 0 192.168.30.1/24
R4的lo 0 192.168.40.1/24
接口配置省略
R1
router rip
network 192.168.10.0
network 192.168.0.0
network 192.168.1.0
R2
router rip
network 192.168.20.0
network 192.168.2.0
network 192.168.0.0
R3
router rip
netwrok 192.168.30.0
network 192.168.2.0
network 192.168.1.0
network 192.168.3.0
R4
router rip
network 192.168.40.0
network 192.168.3.0
路由表
R1
R 192.168.30.0/24 [120/1] via 192.168.1.2, 00:00:10, FastEthernet0/0
C 192.168.10.0/24 is directly connected, Loopback0
R 192.168.40.0/24 [120/2] via 192.168.1.2, 00:00:10, FastEthernet0/0
R 192.168.20.0/24 [120/1] via 192.168.0.2, 00:00:04, FastEthernet1/0
C 192.168.0.0/24 is directly connected, FastEthernet1/0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
R 192.168.2.0/24 [120/1] via 192.168.1.2, 00:00:10, FastEthernet0/0
[120/1] via 192.168.0.2, 00:00:04, FastEthernet1/0
R 192.168.3.0/24 [120/1] via 192.168.1.2, 00:00:12, FastEthernet0/0
R2
R 192.168.30.0/24 [120/1] via 192.168.2.1, 00:00:00, FastEthernet0/0
R 192.168.10.0/24 [120/1] via 192.168.0.1, 00:00:09, FastEthernet1/0
R 192.168.40.0/24 [120/2] via 192.168.2.1, 00:00:00, FastEthernet0/0
C 192.168.20.0/24 is directly connected, Loopback0
C 192.168.0.0/24 is directly connected, FastEthernet1/0
R 192.168.1.0/24 [120/1] via 192.168.2.1, 00:00:00, FastEthernet0/0
[120/1] via 192.168.0.1, 00:00:09, FastEthernet1/0
C 192.168.2.0/24 is directly connected, FastEthernet0/0
R 192.168.3.0/24 [120/1] via 192.168.2.1, 00:00:02, FastEthernet0/0
R3
C 192.168.30.0/24 is directly connected, Loopback0
R 192.168.10.0/24 [120/1] via 192.168.1.1, 00:00:25, FastEthernet1/0
R 192.168.40.0/24 [120/1] via 192.168.3.1, 00:00:21, FastEthernet2/0
R 192.168.20.0/24 [120/1] via 192.168.2.2, 00:00:24, FastEthernet0/0
R 192.168.0.0/24 [120/1] via 192.168.2.2, 00:00:24, FastEthernet0/0
[120/1] via 192.168.1.1, 00:00:25, FastEthernet1/0
C 192.168.1.0/24 is directly connected, FastEthernet1/0
C 192.168.2.0/24 is directly connected, FastEthernet0/0
C 192.168.3.0/24 is directly connected, FastEthernet2/0
R4
R 192.168.30.0/24 [120/1] via 192.168.3.2, 00:00:13, FastEthernet0/0
R 192.168.10.0/24 [120/2] via 192.168.3.2, 00:00:13, FastEthernet0/0
C 192.168.40.0/24 is directly connected, Loopback0
R 192.168.20.0/24 [120/2] via 192.168.3.2, 00:00:13, FastEthernet0/0
R 192.168.0.0/24 [120/2] via 192.168.3.2, 00:00:13, FastEthernet0/0
R 192.168.1.0/24 [120/1] via 192.168.3.2, 00:00:13, FastEthernet0/0
R 192.168.2.0/24 [120/1] via 192.168.3.2, 00:00:13, FastEthernet0/0
C 192.168.3.0/24 is directly connected, FastEthernet0/0
标红的路由条目表示到目标网段有两条路径可走,跳数相同,因为RIP是以跳数作为度量值的
扩展RIPv2内容(修改lo 0 参数)
把 R1 lo 0 修改为
把R2 lo 0 修改为
把R3 lo 0 修改为
把R4 lo 0 修改为
然后每台路由宣告lo 0 网段network
路由表
R1
R
R2
R
[120/1] via 192.168.0.1, 00:00:15, FastEthernet1/0
R3
R
R4
R
R1 到
R2 到
R3到
R4 到
解决办法:用RIPv2并且禁止路由汇总
路由表
R1
R
R
R
R2
R
R
R
R3
R
R
R
R4
R
R
R
全网互通成功