如何为Cisco IOS配置RIP路由?

嗨,今天我们将寻找一些网络资料。到目前为止,我还没有写过任何路由相关的技术文章。在本文中,我将向您展示一些使用RIP协议的简单动态路由。路由分为两部分,一部分是静态路由。在静态路由中,通过键入路由的每个细节在路由器中配置路由,并且在路由中使用所有配置的内容。而在动态路由中,我们先配置一般规则,然后让网络根据配置生成特定的规则。 图片[1]-如何为Cisco IOS配置RIP路由?-yiteyi-C++库

null

例如,如果需要静态路由A、B、C 网络通过D网络你应该在每个路由器上写下所有三个网络的单独路由。但在动态路由中,一个路由器只能写三条路由。其他路由器使用动态路由协议获得这些路由。现在让我们开始输入命令。

设置接口的静态IP地址

首先,我们需要配置在路由中起作用的接口的IP地址。

R1#configureConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.R1(config)#interface ethernet 0/0R1(config-if)#ip address 10.1.0.1 255.255.255.0R1(config-if)#no shutdownR1(config-if)#exitR2#configureConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.R2(config)#interface ethernet 0/1R2(config-if)#ip address 10.2.0.2 255.255.255.0R2(config-if)#no shutdownR2(config-if)#exitR3#configureConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.R3(config)#interface ethernet 0/0R3(config-if)#ip add 10.1.0.2 255.255.255.0R3(config-if)#no shutdownR3(config-if)#exitR3#configureConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.R3(config)#interface ethernet 0/1R3(config-if)#ip address 10.2.0.1 255.255.255.0R3(config-if)#no shutdownR3(config-if)#exit

检查连接性

现在我们应该检查L3的连通性。单向检查就够了

R1>ping 10.1.0.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.1.0.2, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 msR3#ping 10.2.0.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.2.0.2, timeout is 2 seconds:.!!!!Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/1 ms

启用RIP路由服务

现在我们可以开始描述路由的网络。通过network命令,我们指定将用于rip路由的网络。这个命令有两个主要效果。首先,我们指定此网络将用于rip路由,这意味着此网络地址将被其他路由器学习。第二,这个网络所属的接口启动rip通信,比如发送和接收rip数据包。Auto summary命令使routing classfull成为今天通常不使用的类,因此我们在没有Auto summary命令的情况下禁用它。如果您有rip路由问题,请首先查看此自动摘要选项。

R1(config)#router rip R1(config-router)#network 10.1.0.0R1(config-router)#no auto-summary R1(config-router)#exit

RIP协议疑难解答

为了验证rip协议的有效性,我们可以使用debug IP route命令调试rip包。我们看到rip正在发送数据包,但还没有接收,因为我们没有配置其他路由器。

R1#debug ip rip RIP protocol debugging is onR1#*Oct 11 04:05:58.871: RIP: sending v1 update to 255.255.255.255 via Ethernet0/0 (10.1.0.1)*Oct 11 04:05:58.871: RIP: build update entries - suppressing null update

在接口上配置RIP

现在是时候配置R3了。所以我们可以用R1设置相邻的飞船,然后看看工作中的裂口。正如您在描述了R3与R1创建的网络后所看到的

R3(config)#router rip R3(config-router)#network 10.1.0.0*Oct 11 04:08:25.865: RIP: sending request on Ethernet0/0 to 255.255.255.255*Oct 11 04:08:25.865: RIP: sending request on Ethernet0/1 to 255.255.255.255R3(config-router)#no auto-summary*Oct 11 04:08:27.863: RIP: sending v1 flash update to 255.255.255.255 via Ethernet0/0 (10.1.0.2)*Oct 11 04:08:27.864: RIP: build flash update entries*Oct 11 04:08:27.864: subnet 10.2.0.0 metric 1*Oct 11 04:08:27.864: RIP: sending v1 flash update to 255.255.255.255 via Ethernet0/1 (10.2.0.1)*Oct 11 04:08:27.864: RIP: build flash update entries*Oct 11 04:08:27.864: subnet 10.1.0.0 metric 1R3(config-router)#exit

打印/列出RIP配置和信息

如果您查看rip数据库和路由表,您将看到添加了一个新路由。新的路由id从R3发送到R1。新路由是R3的et0/1接口和网络。然后我们ping到新路由的IP。 sh ip rip database 命令显示rip数据库。 show ip route命令显示路由表。

R1#sh ip rip database 10.0.0.0/8 auto-summary10.1.0.0/24 directly connected, Ethernet0/010.2.0.0/24[1] via 10.1.0.2, 00:00:18, Ethernet0/0R1#show ip route Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static route, H - NHRP, l - LISPa - application route+ - replicated route, % - next hop overrideGateway of last resort is not set10.0.0.0/8 is variably subnetted, 3 subnets, 2 masksC 10.1.0.0/24 is directly connected, Ethernet0/0L 10.1.0.1/32 is directly connected, Ethernet0/0R 10.2.0.0/24 [120/1] via 10.1.0.2, 00:00:24, Ethernet0/0R1#ping 10.2.0.0Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.2.0.0, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms

相关文章: 如何修复Dns查找失败

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享