2010-10-08
 
实验目的:
  1. 了解水平分割的原理及作用
 
  什么是水平分割?
水平分割是在距离矢量路由协议中最常用的避免环路发生的解决方案之一。 产生环路的一种情况是:路由器 A 将从路由器 B 学习到的路由信息又告诉给了路由器 B 。最终,路由器 B 认为通过路由器 A 能够到达目标网络,路由器 A 认为通过路由器 B 能够到达目标网络。路由数据包的时候,数据将在两个路由器间不停地循环,直至 TTL 的值为 0 ,将此数据包丢弃。水平分割的思想就是:在路由信息传送过程中,不再把路由信息发送到接收到此路由信息的接口上。从而在一定程度上避免了环路的产生。
 
  1. 了解在NBMA环境中的不足(下篇中介绍,)
 
测试使用软件: Cisco Packet Tracer
 
Figure:
路由配置:
 
路由 A:
interface Loopback0
 ip address 10.0.1.1 255.255.255.255
!
interface FastEthernet0/0
 ip address 192.168.1.1 255.255.255.0
 duplex full
 speed auto
!
interface Serial2/0
 ip address 192.168.0.1 255.255.255.0
 no ip split-horizon
 encapsulation frame-relay
 frame-relay interface-dlci 100
!
router rip
 version 2
 network 192.168.0.0
 network 192.168.1.0

路由 B:
interface Loopback0
 ip address 10.0.1.2 255.255.255.255
!
interface FastEthernet0/0
 ip address 192.168.2.1 255.255.255.0
 duplex full
 speed auto
!
interface Serial2/0
 ip address 192.168.0.2 255.255.255.0
 no ip split-horizon
 encapsulation frame-relay
 frame-relay interface-dlci 200
!
router rip
 version 2
 network 192.168.0.0
 network 192.168.2.0
**************************************************************************
正常连接及工作正常时的路由表(未启用 split horizon ):
A#show ip route
     10.0.0.0/32 is subnetted, 1 subnets
C        10.0.1.1 is directly connected, Loopback0
C     192.168.0.0/24 is directly connected, Serial2/0
C     192.168.1.0/24 is directly connected, FastEthernet0/0
R     192.168.2.0/24 [120/1] via 192.168.0.2, 00:00:25, Serial2/0
 
B#show ip route
     10.0.0.0/32 is subnetted, 1 subnets
C        10.0.1.2 is directly connected, Loopback0
C     192.168.0.0/24 is directly connected, Serial2/0
R     192.168.1.0/24 [120/1] via 192.168.0.1, 00:00:18, Serial2/0
C     192.168.2.0/24 is directly connected, FastEthernet0/0
 
为了看到效果,我将路由 A F0/0 连线移走,此时路由 A 将会从路由 B 中学会到,去 192.168.1.0/24 这个网段的路由是指向路由 B serial 2/0 口,即 192.168.0.2 ,而路由 B 的路由表中会显示,去到此网段的路由是指向 192.168.0.1 的,此时会导致路由环路,如下:
 
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down ( 当移走连线时的提示 )
A>enable
A#show ip route
     10.0.0.0/32 is subnetted, 1 subnets
C        10.0.1.1 is directly connected, Loopback0
C     192.168.0.0/24 is directly connected, Serial2/0
R     192.168.1.0/24 [120/2] via 192.168.0.2, 00:00:17, Serial2/0
R     192.168.2.0/24 [120/1] via 192.168.0.2, 00:00:17, Serial2/0
 
B#show ip route
     10.0.0.0/32 is subnetted, 1 subnets
C        10.0.1.2 is directly connected, Loopback0
C     192.168.0.0/24 is directly connected, Serial2/0
R     192.168.1.0/24 [120/1] via 192.168.0.1, 00:00:38, Serial2/0
C     192.168.2.0/24 is directly connected, FastEthernet0/0
 
启用 split horizon 命令,配置路由 B 相同,
A(config)#interface serial 2/0
A(config-if)#ip split-horizon
 
为了验证 split horizon 的作用,我在路由 A,B 中启用 split horizon ,再次将路由 A F0/0 连接线移走,看看路由表有什么变化,如下图,将会发现路由 A 中未学习到路由 192.168.1.0 ,就是说启用 split horizon 后,路由 B 不会把从路由 A 接口 serial 2/0 学习到的路由回传给路由 A serial 2/0 ,从而避免环路的产生。
 
 
 
 
Alan