GAR路由器RIP实验 R1:ZXR10_R1#configure terminal //进入全局配置模式ZXR10_R1(config)#interface fei_1/1 //进入端口配置模式ZXR10_R1(config-if)#ip adderss 192.168.1.1 255.255.255.0 //将和R2连接的端口配上i
GAR路由器RIP实验 R1: ZXR10_R1#configure terminal //进入全局配置模式 ZXR10_R1(config)#interface fei_1/1 //进入端口配置模式 ZXR10_R1(config-if)#ip adderss 192.168.1.1 255.255.255.0 //将和R2连接的端口配上ip ZXR10_R1(config-if)#exit //退回全局配置模式 ZXR10_R1(config)#interface fei_0/1 //进入端口配置模式 ZXR10_R1(config-if)#ip adderss 192.168.2.1 255.255.255.0 //将和PC1连接的端口配上ip ZXR10_R1(config-if)#exit //退回全局配置模式 ZXR10_R1(config)#router rip //进入rip路由配置模式 ZXR10_R1(config-router)#network 192.168.1.0 0.0.0.255 //将和R2连接的端口加入rip协议中 ZXR10_R1(config-router)#network 192.168.2.0 0.0.0.255 //将和PC1连接的端口加入rip协议中 R2: ZXR10_R2#configure terminal //进入全局配置模式 ZXR10_R2(config)#interface fei_1/1 //进入端口配置模式 ZXR10_R2(config-if)#ip adderss 192.168.1.2 255.255.255.0 //将和R1连接的端口配上ip ZXR10_R2(config-if)#exit //退回全局配置模式 ZXR10_R2(config)#interface fei_0/1 //进入端口配置模式 ZXR10_R2(config-if)#ip adderss 192.168.3.1 255.255.255.0 //将和PC2连接的端口配上ip ZXR10_R2(config-if)#exit //退回全局配置模式 ZXR10_R2(config)#router rip //进入rip路由配置模式 ZXR10_R2(config-router)#network 192.168.1.0 0.0.0.255 //将和R1连接的端口加入rip协议中 ZXR10_R2(config-router)#network 192.168.3.0 0.0.0.255 //将和PC2连接的端口加入rip协议中 13.7 验证方法 ZXR10-R1#show ip route IPv4 Routing Table: Dest Mask Gw Interface Owner pri metric 192.168.1.0 255.255.255.0 192.168.1.1 fei_1/1 direct 0 0 192.168.1.1 255.255.255.255 192.168.1.1 fei_1/1 address 0 0 192.168.2.0 255.255.255.0 192.168.2.1 fei_0/1 direct 0 0 192.168.2.1 255.255.255.255 192.168.2.1 fei_0/1 address 0 0 192.168.3.0 255.255.255.0 192.168.1.2 fei_1/1 rip 120 2 测试网络互通性,应该是全网互通的。如果不是,请检查您的配置是否与上面的一致。现在我们可以看看RIP是怎样发现路由的,在特权模式下打开RIP协议调试开关,有如下信息在路由器之间传递,它们完成了路由的交换,并形成新的路由。 ZXR10-R1# debug ip rip all 00:19:36: RIP: building update entries 192.168.2.0/24 via 0.0.0.0, metric 1, tag 0 00:19:36: RIP: Update contains 1 routes 00:19:36: RIP: sending v2 periodic update to 224.0.0.9 via fei_1/1 (192.168.1.1) 192.168.1.0/24 via 0.0.0.0, metric 1, tag 0 192.168.3.0/24 via 0.0.0.0, metric 2, tag 0 从上面的信息可以看到RIP协议版本为version 2,这是中兴GAR路由器的默认版本。 水平分割默认是打开的。关闭水平分割后,可以查看和上面的debug信息有何不同? ZXR10-R1 (config-if)#no ip split-horizon ZXR10-R1# debug ip rip all 00:35:07: RIP: building update entries 192.168.2.0/24 via 0.0.0.0, metric 1, tag 0 192.168.3.0/24 via 0.0.0.0, metric 2, tag 0 00:35:07: RIP: Update contains 2 routes 00:35:07: RIP: sending v2 periodic update to 224.0.0.9 via fei_1/1 (192.168.1.1) 192.168.1.0/24 via 0.0.0.0, metric 1, tag 0 192.168.3.0/24 via 0.0.0.0, metric 2, tag 0 00:35:07: RIP: Update contains 2 routes 00:35:07: RIP: sending v2 periodic update to 224.0.0.9 via fei_0/1 (192.168.2.1) 在将R1和R2 与PC互连的地址改为192.168.2.1/25和192.168.2.129/25后,关掉自动聚合功能。观察在关掉自动汇聚前后路由表的变化。 ZXR10_R1(config)#interface fei_0/1 ZXR10_R1(config-if)#ip adderss 192.168.2.1 255.255.255.128 ZXR10_R1(config-if)# ZXR10_R1(config)#router rip ZXR10_R1(config-router)# no auto-summary //关闭自动汇聚 ZXR10_R1#show ip route //关闭前 IPv4 Routing Table: Dest Mask Gw Interface Owner pri metric 3.3.3.3 255.255.255.255 3.3.3.3 loopback1 address 0 0 192.168.1.0 255.255.255.0 192.168.1.1 fei_1/1 direct 0 0 192.168.1.1 255.255.255.255 192.168.1.1 fei_1/1 address 0 0 192.168.2.0 255.255.255.128 192.168.2.1 fei_0/1 direct 0 0 192.168.2.1 255.255.255.255 192.168.2.1 fei_0/1 address 0 0 ZXR10_R1#show ip route //关闭后 IPv4 Routing Table: Dest Mask Gw Interface Owner pri metric 3.3.3.3 255.255.255.255 3.3.3.3 loopback1 address 0 0 192.168.1.0 255.255.255.0 192.168.1.1 fei_1/1 direct 0 0 192.168.1.1 255.255.255.255 192.168.1.1 fei_1/1 address 0 0 192.168.2.0 255.255.255.0 192.168.1.2 fei_1/1 rip 120 3 192.168.2.0 255.255.255.128 192.168.2.1 fei_0/1 direct 0 0 192.168.2.1 255.255.255.255 192.168.2.1 fei_0/1 address 0 0 然后改变协议版本ZXR10-R1(config-router)#version 1并使之生效,并在关闭和启动自动聚合功能下显示路由表信息会发现都没有动态路由产生,知道为什么吗?因为version 1不支持可变长 子网掩码,而192.168.2.1与192.168.2.129属于C 类地址,自然掩码为24位,属于同一网段的地址。大家可以自己做实验试一试。 13.8 TIPS 对接设备的RIP版本要一致。多网段时注意自动汇聚的作用。
(免责声明:文章内容如涉及作品内容、版权和其它问题,请及时与我们联系,我们将在第一时间删除内容,文章内容仅供参考)