该网上邻居的路由从路由表中清除。RIP-1不具备报文加密验证功能,而在RIP-2中实现了该功能。 RIP使用跳数(Hop Count)来衡量到达信宿机的距离,称为路由权(Routing Metric)。在RIP中,路由器到与它直接相连网络的跳数为0,通过一个路由器可达的网络的跳数为1,其余依此类推。为限制收敛时间,RIP规定metric取值0~15之间的整数,大于或等于16的跳数被定义为无穷大,即目的网络或主机不可达。
为提高性能,防止产生路由环,RIP支持水平分割(Split Horizon)和毒性逆转(Poison Reverse)。RIP还可引入其它路由协议所得到的路由。 RIP启动和运行的整个过程可描述如下:
l 某路由器刚启动RIP时,以广播的形式向相邻路由器发送请求报文,相邻路由器的RIP收到请求报文后,响应该请求,回送包含本地路由表信息的响应报文。
l 路由器收到响应报文后,修改本地路由表,同时向相邻路由器发送触发修改报文,广播路由修改信息。相邻路由器收到触发修改报文后,又向其各自的相邻路由器发送触发修改报文。在一连串的触发修改广播后,各路由器都能得到并保持最新的路由信息。
l 同时,RIP每隔30秒向相邻路由器广播本地路由表,相邻路由器在收到报文后,对本地路由进行维护,选择一条最佳路由,再向其各自相邻网络广播修改信息,使更新的路由最终能达到全局有效。同时,RIP采用超时机制对过时的路由进行超时处理,以保证路由的实时性和有效性。
Catalyst 3560RIP配置命令请见下表。
Command Purpose
Step 1 configure terminal Enter global configuration mode.
Step 2 ip routing Enable IP routing. (Required only if IP routing is disabled.) Step 3 router rip Enable a RIP routing process, and enter router configuration mode. Step 4 network network number Associate a network with a RIP routing process. You can specify multiple network commands. RIP routing updates are sent and received through interfaces only on these networks.
Step 8 version {1 | 2} (Optional) Configure the switch to receive and send only RIP Version 1 or RIP Version 2 packets. By default, the switch receives Version 1 and 2 but sends only Version
1. You can also use the interface commands ip rip {send | receive} version 1 | 2 | 1 2} to control what versions are used for sending and receiving on interfaces.
Step 9 no auto summary (Optional) Disable automatic summarization. By default, the switch summarizes subprefixes when crossing classful network boundaries. Disable summarization (RIP Version 2 only) to advertise subnet and host routing information to classful network boundaries. Step 12 end Return to privileged EXEC mode. Step 13 show ip protocols Verify your entries.
Step 14 copy running-config startup-config (Optional) Save your entries in the configuration file.
To turn off the RIP routing process, use the no router rip global configuration command. Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Switch(config)# ip routing Switch(config)# router rip
Switch(config-router)# network 10.0.0.0 Switch(config-router)# end
6.1.3 OSPF路由
开放最短路由优先协议OSPF(Open Shortest Path First)是IETF组织开发的一个基于链路状态的内部网关协议。目前使用的是版本2(RFC2328),其特性如下:
l 适应范围——支持各种规模的网络,最多可支持几百台路由器。
l 快速收敛——在网络的拓扑结构发生变化后立即发送更新报文,使这一变化在自治系统中同步。 l 无自环——由于OSPF根据收集到的链路状态用最短路径树算法计算路由,从算法本身保证了不会生成自环路由。
l 区域划分——允许自治系统的网络被划分成区域来管理,区域间传送的路由信息被进一步抽象,从而减少了占用的网络带宽。
l 等值路由——支持到同一目的地址的多条等值路由。
l 路由分级——使用4类不同的路由,按优先顺序来说分别是:区域内路由、区域间路由、第一类
外部路由、第二类外部路由。
l 支持验证——支持基于接口的报文验证以保证路由计算的安全性。 l 组播发送——支持组播地址。 OSPF协议路由的计算过程
OSPF协议路由的计算过程可简单描述如下:
l 每个支持OSPF协议的路由器都维护着一份描述整个自治系统拓扑结构的链路状态数据库LSDB(Link State Database)。每台路由器根据自己周围的网络拓扑结构生成链路状态广播LSA(Link State Advertisement),通过相互之间发送协议报文将LSA发送给网络中其它路由器。这样每台路由器都收到了其它路由器的LSA,所有的LSA放在一起便组成了链路状态数据库。
l 由于LSA是对路由器周围网络拓扑结构的描述,那么LSDB则是对整个网络的拓扑结构的描述。路由器很容易将LSDB转换成一张带权的有向图,这张图便是对整个网络拓扑结构的真实反映。显然,各个路由器得到的是一张完全相同的图。
l 每台路由器都使用SPF算法计算出一棵以自己为根的最短路径树,这棵树给出了到自治系统中各节点的路由,外部路由信息为叶子节点,外部路由可由广播它的路由器进行标记以记录关于自治系统的额外信息。显然,各个路由器各自得到的路由表是不同的。
此外,为使每台路由器能将本地状态信息(如可用接口信息、可达邻居信息等)广播到整个自治系统中,在路由器之间要建立多个邻接关系,这使得任何一台路由器的路由变化都会导致多次传递,既没有必要,也浪费了宝贵的带宽资源。为解决这一问题,OSPF协议定义了“指定路由器”DR(Designated Router),所有路由器都只将信息发送给DR,由DR将网络链路状态广播出去。这样就减少了多址访问网络上各路由器之间邻接关系的数量。
OSPF协议支持基于接口的报文验证以保证路由计算的安全性;并使用IP多播方式发送和接收报文。
Catalyst 3560 OSPF配置命令请见下表。
Command Purpose
Step 1 configure terminal Enter global configuration mode.
Step 2 router ospf process-id Enable OSPF routing, and enter router configuration mode. The process ID is an internally used identification parameter that is locally assigned and can be any
positive integer. Each OSPF routing process has a unique value.
Step 3 network address wildcard-mask area area-id Define an interface on which OSPF runs and the area ID for that interface. You can use the wildcard-mask to use a single command to define one or more multiple interfaces to be associated with a specific OSPF area. The area ID can be a decimal value or an IP address.
Step 4 end Return to privileged EXEC mode. Step 5 show ip protocols Verify your entries. Step 6 copy running-config startup-config (Optional)
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Switch(config)# ip routing Switch(config)# router ospf 109
Switch(config-router)# network 131.108.0.0 255.255.255.0 area 0
<欢迎投稿> <论坛讨论>