这是我在 GNS3 中设置的拓扑。
路由器 R2 的 RIP V2 协议正在识别和通告 EIGRP 中通告的两个网络,即使上述信息只能通过重新分发接收。如何确保 RIP 仅通告我想要通告的子网,而不是该特定路由器上可能存在的该有类网络的所有子网?
以下是路由器 R2 和 R3 的 Show Ip route 和 Show Running-config 信息,
R3#sh ip route
Codes: 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
Gateway of last resort is not set
192.168.1.0/24 is variably subnetted, 5 subnets, 2 masks
C 192.168.1.64/28 is directly connected, Loopback1
R 192.168.1.32/28 [120/1] via 192.168.1.133, 00:00:00, Serial0/0
R 192.168.1.16/28 [120/1] via 192.168.1.133, 00:00:00, Serial0/0
R 192.168.1.128/30 [120/1] via 192.168.1.133, 00:00:00, Serial0/0
C 192.168.1.132/30 is directly connected, Serial0/0
R3#
//////////////////////////////////////////////////////////////////////////////
R3#sh run
Building configuration...
Current configuration : 1063 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback1
ip address 192.168.1.65 255.255.255.240
!
interface Serial0/0
ip address 192.168.1.134 255.255.255.252
serial restart-delay 0
no dce-terminal-timing-enable
!
interface Serial0/1
no ip address
shutdown
serial restart-delay 0
no dce-terminal-timing-enable
!
interface Serial0/2
no ip address
shutdown
serial restart-delay 0
no dce-terminal-timing-enable
!
interface Serial0/3
no ip address
shutdown
serial restart-delay 0
no dce-terminal-timing-enable
!
router rip
version 2
passive-interface default
network 192.168.1.0
neighbor 192.168.1.133
!
no ip http server
no ip http secure-server
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
R3#s
//////////////////////////////////////////////////////////////
R2#sh run
Building configuration...
Current configuration : 1240 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback1
ip address 192.168.1.17 255.255.255.240
!
interface Loopback2
ip address 192.168.1.33 255.255.255.240
!
interface Serial0/0
ip address 192.168.1.130 255.255.255.252
serial restart-delay 0
no dce-terminal-timing-enable
!
interface Serial0/1
ip address 192.168.1.133 255.255.255.252
serial restart-delay 0
no dce-terminal-timing-enable
!
interface Serial0/2
no ip address
shutdown
serial restart-delay 0
no dce-terminal-timing-enable
!
interface Serial0/3
no ip address
shutdown
serial restart-delay 0
no dce-terminal-timing-enable
!
router eigrp 10
network 192.168.1.16 0.0.0.15
network 192.168.1.128 0.0.0.3
no auto-summary
!
router rip
version 2
passive-interface default
network 192.168.1.0
neighbor 192.168.1.134
!
no ip http server
no ip http secure-server
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
答案1
您可以使用分发列表来阻止 RIP 通告属于 EIGRP 和 RIP 进程的路由(即 192.168.1.16/28 和 192.168.1.128/30)
要做到这一点,只需允许 loopback 1 路由出去,并拒绝其余路由。或者,您可以编写一个访问列表,拒绝 192.168.1.16/28 和 192.168.1.128/30,并允许其余路由。
如果您希望子网长度有特定的匹配,您可能还希望使用前缀列表。请注意,下面的 ACL 实际上将允许任何属于 192.168.1.32/28 子集的路由(例如,如果 192.168.1.33/32 存在于您的 rip 过程中,它也将被允许)
router rip
distribute-list 10 out s0/1
access-list 10 permit 192.168.1.32 0.0.0.15
access-list 10 deny any
这是 RIP 的一个问题,因为它只能在有类网络上启用,不幸的是,在您的拓扑中,这意味着 RIP 在 192.168.1.0/24 网络的所有接口上运行。
正如您在使用 EIGRP 时注意到的那样,您不会遇到此问题,因为您可以分类指定参与接口。