RIPv2 向未知网络发送更新

网络工程 路由
2021-07-08 12:14:02

我正在使用 GNS3 在我的简单网络中配置基本的 RIPv2。首先,这是我的网络,

在此处输入图片说明

这是每个路由器的配置,

R1,

router rip
 version 2
 passive-interface FastEthernet0/0
 network 10.0.0.0
 network 192.168.2.0
 no auto-summary


R1#show ip int br
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.1.1     YES manual up                    up  
Serial0/0                  10.1.1.6        YES manual up                    up  
FastEthernet0/1            unassigned      YES unset  administratively down down
Serial0/1                  unassigned      YES unset  administratively down down

对于 R2

router rip
 passive-interface FastEthernet0/0
 network 192.168.1.0
 network 192.168.2.0
 no auto-summary


R2#show ip int br
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.2.1     YES manual up                    up
Serial0/0                  10.1.1.5        YES manual up                    up
FastEthernet0/1            unassigned      YES unset  administratively down down
Serial0/1                  10.1.1.2        YES manual up                    up

R3,

router rip
 version 2
 passive-interface FastEthernet0/0
 network 10.0.0.0
 network 192.168.1.0
 network 192.168.2.0
 no auto-summary


R3#show ip int br
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.2.129   YES manual up                    up  
Serial0/0                  unassigned      YES unset  administratively down down
FastEthernet0/1            unassigned      YES unset  administratively down down
Serial0/1                  10.1.1.1        YES manual up                    up 

即使我已经RIPv2在每个路由器中进行了配置,我的路由器仍然不会学习到它自己网络之外的任何路由。

这是show ip route每个路由器命令输出

R1,

Gateway of last resort is not set

     10.0.0.0/30 is subnetted, 1 subnets
C       10.1.1.4 is directly connected, Serial0/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0

R2,

Gateway of last resort is not set

     10.0.0.0/30 is subnetted, 2 subnets
C       10.1.1.0 is directly connected, Serial0/1
C       10.1.1.4 is directly connected, Serial0/0
     192.168.2.0/25 is subnetted, 1 subnets
C       192.168.2.0 is directly connected, FastEthernet0/0

R3,

Gateway of last resort is not set

     10.0.0.0/30 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Serial0/1
     192.168.2.0/25 is subnetted, 1 subnets
C       192.168.2.128 is directly connected, FastEthernet0/0

当我使用debug ip rip命令时,我看到以下输出,

R1,

R1#
*Mar  1 00:31:48.595: RIP: sending v2 update to 224.0.0.9 via Serial0/0 (10.1.1.6)
*Mar  1 00:31:48.595: RIP: build update entries - suppressing null update
R1#
*Mar  1 00:32:15.975: RIP: sending v2 update to 224.0.0.9 via Serial0/0 (10.1.1.6)
*Mar  1 00:32:15.975: RIP: build update entries - suppressing null update

R3,

R3#
*Mar  1 00:32:15.559: RIP: sending v2 update to 224.0.0.9 via Serial0/1 (10.1.1.1)
*Mar  1 00:32:15.559: RIP: build update entries
*Mar  1 00:32:15.563:   192.168.2.128/25 via 0.0.0.0, metric 1, tag 0

从上面的输出中可以看出,R1R3都将更新发送到224.0.0.9,但我没有任何具有此 IP 地址的网络。除此之外,R2当我启用调试时根本没有显示任何更新。

这是show ip protocols命令的输出R2

R2#show ip protocols
Routing Protocol is "rip"
  Sending updates every 30 seconds, next due in 16 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Redistributing: rip
  Default version control: send version 1, receive any version
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    192.168.1.0
    192.168.2.0
  Passive Interface(s):
    FastEthernet0/0
  Routing Information Sources:
    Gateway         Distance      Last Update
  Distance: (default is 120)

谁能告诉我为什么我的路由器没有学习到相邻网络的正确路由,并将更新发送到错误的地址?我没有access list在任何路由器中配置或配置任何其他东西,只是RIPv2配置简单

3个回答

确保路由器 RIP 配置如下所示。

对于 R1,

router rip
 version 2
 network 10.0.0.0
 network 192.168.1.0
 no auto-summary

对于 R2,

router rip
 version 2
 network 10.0.0.0
 network 192.168.2.0
 no auto-summary

和 R3,

router rip
 version 2
 network 10.0.0.0
 network 192.168.2.0
 no auto-summary

上述配置使路由协议 100% 工作。

以下是以下路由器的路由表中的路由,

R1,

R1#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

Gateway of last resort is not set

     10.0.0.0/30 is subnetted, 2 subnets
R       10.1.1.0 [120/1] via 10.1.1.5, 00:00:05, Serial0/0/0
C       10.1.1.4 is directly connected, Serial0/0/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
     192.168.2.0/25 is subnetted, 2 subnets
R       192.168.2.0 [120/1] via 10.1.1.5, 00:00:05, Serial0/0/0
R       192.168.2.128 [120/2] via 10.1.1.5, 00:00:05, Serial0/0/0

对于 R2,

R2#sh ip  route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

Gateway of last resort is not set

     10.0.0.0/30 is subnetted, 2 subnets
C       10.1.1.0 is directly connected, Serial0/0/1
C       10.1.1.4 is directly connected, Serial0/0/0
R    192.168.1.0/24 [120/1] via 10.1.1.6, 00:00:02, Serial0/0/0
     192.168.2.0/25 is subnetted, 2 subnets
C       192.168.2.0 is directly connected, FastEthernet0/0
R       192.168.2.128 [120/1] via 10.1.1.1, 00:00:12, Serial0/0/1

和 R3,

R3#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

Gateway of last resort is not set

     10.0.0.0/30 is subnetted, 2 subnets
C       10.1.1.0 is directly connected, Serial0/0/0
R       10.1.1.4 [120/1] via 10.1.1.2, 00:00:11, Serial0/0/0
R    192.168.1.0/24 [120/2] via 10.1.1.2, 00:00:11, Serial0/0/0
     192.168.2.0/25 is subnetted, 2 subnets
R       192.168.2.0 [120/1] via 10.1.1.2, 00:00:11, Serial0/0/0
C       192.168.2.128 is directly connected, FastEthernet0/0

希望这可以帮助。

在 R2 上,

network 10.0.0.0

在您的路由器 rip 上丢失

由于您的 FastEthernet 接口是被动的,您不需要

network 192.168.1.0
network 192.168.2.0

路由器中的语句 rip 在您的任何路由器上。那些(仍然是classfull)ip-nets 必须包括你在RIP 上的链接上的地址,应该说,no passive interface Serial0/0不够。

将 s0/1 连接到其他路由器的 s0/0 接口也很省事。只是名字。

最后,不要在 RIP 上花费太多时间。更好的学习OSPF和BGP。

您忘记为 R2 配置 RIP 版本 2。您已在 R1 和 R3 上指定它,但未在 R2 上指定它。没有这个,子网信息将不会被公布,因此你不能使用断开连接的网络。这也是 R2 在调试模式下不显示任何内容的原因。