欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

思科五台路由rip配置_如何为Cisco IOS配置RIP路由?

程序员文章站 2022-03-13 21:20:37
...
思科五台路由rip配置_如何为Cisco IOS配置RIP路由?

思科五台路由rip配置

思科五台路由rip配置_如何为Cisco IOS配置RIP路由?

Hi, today we will look for some networking stuff. Up to now, I have not written any routing-related technical post. In this article, I am gonna show you some simple dynamic routing with RIP protocol. Routing is divided into two part which one is static. In static routing, routes are configured in the router by typing every detail of the route and all things configured are used in routing. But in dynamic routing, we configure the general rules and then let the network generate specific rules according to the config.

嗨,今天我们将寻找一些联网的东西。 到目前为止,我还没有写任何与路由相关的技术文章。 在本文中,我将向您展示一些使用RIP协议的简单动态路由。 路由分为两个部分,其中一个是静态的。 在静态路由中,通过键入路由的每个详细信息在路由器中配置路由,并且在路由中使用所有已配置的内容。 但是在动态路由中,我们配置通用规则,然后让网络根据配置生成特定规则。

For example, if you need to statically route A, B, C  networks through D network you should write separate route all of the three networks in each router. But in dynamic routing, you should only write three route in one router. Other routers get theses routes with dynamic routing protocols. Now let start typing commands.

例如,如果需要通过D网络静态路由A,B,C网络,则应在每个路由器中为所有三个网络编写单独的路由。 但是在动态路由中,您只应在一台路由器中写入三个路由。 其他路由器通过动态路由协议获得这些路由。 现在开始输入命令。

设置接口的静态IP地址 (Set Static IP Addresses For Interfaces)

First, we need to configure the IP address of the interfaces that play in routing.

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

R1#configure
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#interface ethernet 0/0
R1(config-if)#ip address 10.1.0.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit

R2#configure
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#interface ethernet 0/1
R2(config-if)#ip address 10.2.0.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit

R3#configure
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#interface ethernet 0/0
R3(config-if)#ip add 10.1.0.2 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit

R3#configure
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.

R3(config)#interface ethernet 0/1
R3(config-if)#ip address 10.2.0.1 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit

检查连通性 (Check Connectivity)

Now we should check the L3 connectivity. One direction check is enough

现在我们应该检查L3连接。 一个方向检查就足够了

R1>ping 10.1.0.2
Type 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 ms

R3#ping 10.2.0.2
Type 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路由服务 (Enable RIP Routing Service)

Now we can start describing networks for routing. With network command, we specify network that will be used for rip routing. There are two main effects of this command. First, we specify that this network will be used for rip routing which means this network address will be learned by other routers. Second the interface this network belongs to start to rip communication like sending and receiving rip packets. Auto-summary command makes routing classfull which is generally not used today so we disable it with no auto-summary command. If you have problem with rip routing look first this auto-summary option.

现在我们可以开始描述用于路由的网络。 使用network命令,我们指定将用于rip路由的网络。 此命令有两个主要作用。 首先,我们指定此网络将用于rip路由,这意味着该网络地址将被其他路由器学习。 其次,该网络所属的接口开始进行rip通信,例如发送和接收rip数据包。 自动汇总命令使路由类已满,今天通常不使用它,因此我们不使用自动汇总命令将其禁用。 如果您在翻录路由方面遇到问题,请首先查看此自动摘要选项。

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

对RIP协议进行故障排除 (Troubleshoot RIP Protocol)

To see that rip protocol works we can debug rip packets with debug IP route command. We see that rip is sending packets but not receiving yet because we didn’t configure other routers.

要查看rip协议是否有效,我们可以使用debug IP route命令调试rip数据包。 我们看到rip正在发送数据包,但尚未收到,因为我们没有配置其他路由器。

R1#debug ip rip 
RIP protocol debugging is on
R1#
*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 (Configure RIP On Interface)

Now it is time to configure R3. so we can set neighbor-ship with R1 and see the RIP in work. As you can see after describing network R3 created neighbor-ship with R1

现在该配置R3了。 因此我们可以使用R1设置邻居关系,并查看RIP的工作情况。 如您所见,描述网络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.255
R3(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 1
R3(config-router)#exit

打印/列出RIP配置和信息 (Print/List RIP Configuration and Information)

If you look to rip database and routing table you will see a new route is added. The new route id sends from R3 to R1. The new route is the et0/1 interface and network of R3. Then we ping to the IP of the new route. sh ip rip database command shows rip database. show ip route command shows routing table.

如果您要翻录数据库和路由表,则会看到已添加新路由。 新的路由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-summary
10.1.0.0/24 directly connected, Ethernet0/0
10.2.0.0/24
[1] via 10.1.0.2, 00:00:18, Ethernet0/0

R1#show ip route 
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C 10.1.0.0/24 is directly connected, Ethernet0/0
L 10.1.0.1/32 is directly connected, Ethernet0/0
R 10.2.0.0/24 [120/1] via 10.1.0.2, 00:00:24, Ethernet0/0

R1#ping 10.2.0.0
Type 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
通过示例了解更多QEMU教程

翻译自: https://www.poftut.com/configure-rip-routing-cisco-ios/

思科五台路由rip配置