设为首页 友情链接
在线留言 发表文章
加入收藏 广告联系

刺猬首页

| 专案技术 | 网络技术 | 图形图象 | 网络编程 | 网页设计 | 操作系统 | 服务器 | 技术白皮书 | 在线实验室 | 刺猬论坛 |
小说专版  | 数据库 | 设计赏析 | 存储频道 | 网络安全 | 私服架设 |  Solaris | 网站评估 | PC维护技巧 | 下载中心 | 博 客 |
专   题: | Linux | java | cisco | 防病毒 | 刀片 | SOA | iscsi | ASP.NET | SQL | Oracle |
您现在的位置: IT公社 IT community >> 思科学堂 >> Cisco官方配置资料 >> 文章正文 用户登录 新用户注册
专 题 栏 目
最 新 热 门
最 新 推 荐
相 关 文 章
CSU/DSU:信道服务单元/
Internetworking Basics
Catalyst 3550-Configur
LAN Switching and VLAN
UDP Broadcast Flooding
  [组图]RIP and OSPF Redistribution         ★★★
RIP and OSPF Redistribution
 

RIP and OSPF Redistribution

This case study addresses the issue of integrating Routing Information Protocol (RIP) networks with Open Shortest Path First (OSPF) networks. Most OSPF networks also use RIP to communicate with hosts or to communicate with portions of the internetwork that do not use OSPF. Cisco supports both the RIP and OSPF protocols and provides a way to exchange routing information between RIP and OSPF networks. This case study provides examples of how to complete the following phases in redistributing information between RIP and OSPF networks, including the following topics:

  • Configuring a RIP Network

  • Adding OSPF to the Center of a RIP Network

  • Adding OSPF Areas

  • Setting Up Mutual Redistribution

Configuring a RIP Network

Figure 14-1 illustrates a RIP network. Three sites are connected with serial lines. The RIP network uses a Class B address and an 8-bit subnet mask. Each site has a contiguous set of network numbers.


Figure 14-1:
A RIP network.


Table 14-1 lists the network address assignments for the RIP network, including the network number, subnet range, and subnet masks. All interfaces indicate network 130.10.0.0; however, the specific address includes the subnet and subnet mask. For example, serial interface 0 on Router C has an IP address of 130.10.63.3 with a subnet mask of 255.255.255.0.


Table 14-1: RIP Network Address Assignments

Network Number

Subnets

Subnet Masks

130.10.0.0

Site A: 8 through 15

255.255.255.0

130.10.0.0

Site B: 16 through 23

255.255.255.0

130.10.0.0

Site C: 24 through 31

255.255.255.0

130.10.0.0

Serial Backbone: 62 through 64

255.255.255.0

 

Configuration File Examples

The following commands in the configuration file for Router A determine the IP address for each interface and enable RIP on those interfaces:

interface serial 0ip address 130.10.62.1 255.255.255.0 interface serial 1ip address 130.10.63.1 255.255.255.0interface ethernet 0 ip address 130.10.8.1 255.255.255.0interface tokenring 0 ip address 130.10.9.1 255.255.255.0router ripnetwork 130.10.0.0

The following commands in the configuration file for Router B determine the IP address for each interface and enable RIP on those interfaces:

interface serial 0ip address 130.10.62.2 255.255.255.0 interface serial 1ip address 130.10.64.2 255.255.255.0interface ethernet 0 ip address 130.10.17.2 255.255.255.0interface tokenring 0 ip address 130.10.16.2 255.255.255.0router ripnetwork 130.10.0.0

The following commands in the configuration file for Router C determine the IP address for each interface and enable RIP on those interfaces:

interface serial 0ip address 130.10.63.3 255.255.255.0 interface serial 1ip address 130.10.64.3 255.255.255.0interface ethernet 0 ip address 130.10.24.3 255.255.255.0router ripnetwork 130.10.0.0

Adding OSPF to the Center of a RIP Network

A common first step in converting a RIP network to OSPF is to add backbone routers that run both RIP and OSPF, while the remaining network devices run RIP. These backbone routers are OSPF autonomous system boundary routers. Each autonomous system boundary router controls the flow of routing information between OSPF and RIP. In Figure 14-2, Router A is configured as the autonomous system boundary router.


Figure 14-2:
RIP network with OSPF at the center.


RIP does not need to run between the backbone routers; therefore, RIP is suppressed on Router A with the following commands:

router rippassive-interface serial 0passive-interface serial 1

The RIP routes are redistributed into OSPF by all three routers with the following commands:

router ospf 109redistribute rip subnets

The subnets keyword tells OSPF to redistribute all subnet routes. Without the subnets keyword, only networks that are not subnetted will be redistributed by OSPF. Redistributed routes appear as external type 2 routes in OSPF. Each RIP domain receives information about networks in other RIP domains and in the OSPF backbone area from the following commands that redistribute OSPF routes into RIP:

router rip redistribute ospf 109 match internal external 1 external 2default-metric 10

The redistribute command uses the ospf keyword to specify that OSPF routes are to be redistributed into RIP. The keyword internal indicates the OSPF intra-area and interarea routes: External 1 is the external route type 1, and external 2 is the external route type 2. Because the command in the example uses the default behavior, these keywords may not appear when you use the write terminal or show configuration commands.

Because metrics for different protocols cannot be directly compared, you must specify the default metric in order to designate the cost of the redistributed route used in RIP updates. All routes that are redistributed will use the default metric.

In Figure 14-2, there are no paths directly connecting the RIP clouds. However, in typical networks, these paths, or "back doors," frequently exist, allowing the potential for feedback loops. You can use access lists to determine the routes that are advertised and accepted by each router. For example, access list 11 in the configuration file for Router A allows OSPF to redistribute information learned from RIP only for networks 130.10.8.0 through 130.10.15.0:

router ospf 109redistribute rip subnetdistribute-list 11 out rip access-list 11 permit 130.10.8.0 0.0.7.255 access-list 11 deny 0.0.0.0 255.255.255.255

These commands prevent Router A from advertising networks in other RIP domains onto the OSPF backbone, thereby preventing other boundary routers from using false information and forming a loop.

Configuration File Examples

The full configuration for Router A follows:

interface serial 0ip address 130.10.62.1 255.255.255.0 interface serial 1ip address 130.10.63.1 255.255.255.0interface ethernet 0 ip address 130.10.8.1 255.255.255.0interface tokenring 0 ip address 130.10.9.1 255.255.255.0!router ripdefault-metric 10 network 130.10.0.0passive-interface serial 0passive-interface serial 1 redistribute ospf 109 match internal external 1 external 2!router ospf 109 network 130.10.62.0 0.0.0.255 area 0network 130.10.63.0 0.0.0.255 area 0 redistribute rip subnetsdistribute-list 11 out rip! access-list 11 permit 130.10.8.0 0.0.7.255 access-list 11 deny 0.0.0.0 255.255.255.255

The full configuration for Router B follows:

interface serial 0ip address 130.10.62.2 255.255.255.0 interface serial 1ip address 130.10.64.2 255.255.255.0interface ethernet 0 ip address 130.10.17.2 255.255.255.0interface tokenring 0 ip address 130.10.16.2 255.255.255.0!router ripdefault-metric 10 network 130.10.0.0passive-interface serial 0passive-interface serial 1 redistribute ospf 109 match internal external 1 external 2!router ospf 109 network 130.10.62.0 0.0.0.255 area 0network 130.10.64.0 0.0.0.255 area 0 redistribute rip subnetsdistribute-list 11 out rip access-list 11 permit 130.10.16.0 0.0.7.255 access-list 11 deny 0.0.0.0 255.255.255.255

The full configuration for Router C follows:

interface serial 0ip address 130.10.63.3 255.255.255.0 interface serial 1ip address 130.10.64.3 255.255.255.0interface ethernet 0 ip address 130.10.24.3 255.255.255.0!router ripdefault-metric 10! network 130.10.0.0passive-interface serial 0passive-interface serial 1 redistribute ospf 109 match internal external 1 external 2! router ospf 109network 130.10.63.0 0.0.0.255 area 0 network 130.10.64.0 0.0.0.255 area 0redistribute rip subnets distribute-list 11 out rip access-list 11 permit 130.10.24.0 0.0.7.255 access-list 11 deny 0.0.0.0 255.255.255.255

Adding OSPF Areas

Figure 14-3 illustrates how each of the RIP clouds can be converted into an OSPF area. All three routers are area border routers. Area border routers control network information distribution between OSPF areas and the OSPF backbone. Each router keeps a detailed record of the topology of its area and receives summarized information from the other area border routers on their respective areas.


Figure 14-3:
Configuring route summarization between OSPF areas.


Figure 14-3 also illustrates variable-length subnet masks (VLSMs). VLSMs use different size network masks in different parts of the network for the same network number. VLSM conserves address space by using a longer mask in portions of the network that have fewer hosts. Table 14-2 lists the network address assignments for the network, including the network number, subnet range, and subnet masks. All interfaces indicate network 130.10.0.0.


Table 14-2: OSPF Address Assignments

Network Number

Subnets

Subnet Masks

130.10.0.0

Area 0: 62 through 64

255.255.255.248

130.10.0.0

Area 1: 8 through 15

255.255.255.0

130.10.0.0

Area 2: 16 through 23

255.255.255.0

130.10.0.0

Area 3: 24 through 31

255.255.255.0

 

To conserve address space, a mask of 255.255.255.248 is used for all the serial lines in area 0. If an area contains a contiguous range of network numbers, an area border router uses the range keyword with the area command to summarize the routes that are injected into the backbone:

router ospf 109network 130.10.8.0 0.0.7.255 area 1 area 1 range 130.10.8.0 255.255.248.0

These commands allow Router A to advertise one route, 130.10.8.0 255.255.248.0, which covers all subnets in Area 1 into Area 0. Without the range keyword in the area command, Router A would advertise each subnet individually; for example, one route for 130.10.8.0 255.255.255.0, one route for 130.10.9.0 255.255.255.0, and so forth.

Because Router A no longer needs to redistribute RIP routes, the router rip command can now be removed from the configuration file; however, it is common in some environments for hosts to use RIP to discover routers. When RIP is removed from the routers, the hosts must use an alternative technique to find the routers. Cisco routers support the following alternatives to RIP:

Configuration File Examples

The full configuration for Router A follows:

interface serial 0ip address 130.10.62.1 255.255.255.248 interface serial 1ip address 130.10.63.1 255.255.255.248interface ethernet 0 ip address 130.10.8.1 255.255.255.0ip irdpinterface tokenring 0 ip address 130.10.9.1 255.255.255.0ip irdprouter ospf 109 network 130.10.62.0 0.0.0.255 area 0network 130.10.63.0 0.0.0.255 area 0 network 130.10.8.0 0.0.7.255 area 1area 1 range 130.10.8.0 255.255.248.0

The full configuration for Router B follows:

interface serial 0ip address 130.10.62.2 255.255.255.248 interface serial 1ip address 130.10.64.2 255.255.255.248interface ethernet 0 ip address 130.10.17.2 255.255.255.0ip irdpinterface tokenring 0 ip address 130.10.16.2 255.255.255.0ip irdprouter ospf 109 network 130.10.62.0 0.0.0.255 area 0network 130.10.64.0 0.0.0.255 area 0 network 130.10.16.0 0.0.7.255 area 2area 2 range 130.10.16.0 255.255.248.0

The full configuration for Router C follows:

interface serial 0ip address 130.10.63.2 255.255.255.248 interface serial 1ip address 130.10.64.2 255.255.255.248interface ethernet 0 ip address 130.10.24.3 255.255.255.0ip irdprouter ospf 109 network 130.10.63.0 0.0.0.255 area 0network 130.10.64.0 0.0.0.255 area 0 network 130.10.24.0 0.0.0.255 area 3area 3 range 130.10.24.0 255.255.248.0

Setting Up Mutual Redistribution

It is sometimes necessary to accommodate more complex network topologies such as independent RIP and OSPF clouds that must perform mutual redistribution. In this scenario, it is critically important to prevent potential routing loops by filtering routes. The router in Figure 14-4 is running both OSPF and RIP.


Figure 14-4: Mutual redistribution between RIP and OSPF networks.


With the following commands, OSPF routes will be redistributed into RIP. You must specify the default metric to designate the cost of the redistributed route in RIP updates. All routes redistributed into RIP will have this default metric.

! passive interface subcommand from previous example is left out for clarity! router ripdefault-metric 10network 130.10.0.0redistribute ospf 109

It is a good practice to strictly control which routes are advertised when redistribution is configured. In the following example, a distribute-list out command causes RIP to ignore routes coming from the OSPF that originated from the RIP domain.

router ripdistribute-list 10 out ospf 109! access-list 10 deny 130.10.8.0 0.0.7.255 access-list 10 permit 0.0.0.0 255.255.255.255

Router A

The full configuration for the router follows:

interface serial 0ip add 130.10.62.1 255.255.255.0! interface serial 1ip add 130.10.63.1 255.255.255.0!interface ethernet 0 ip add 130.10.8.1 255.255.255.0!interface tokenring 0 ip add 130.10.9.1 255.255.255.0!router ripdefault-metric 10network 130.10.0.0 passive-interface serial 0passive-interface serial 1redistribute ospf 109 distribute-list 10 out ospf 109!router ospf 109 network 130.10.62.0 0.0.0.255 area 0network 130.10.63.0 0.0.0.255 area 0 redistribute rip subnetsdistribute-list 11 out rip! access-list 10 deny 130.10.8.0 0.0.7.255 access-list 10 permit 0.0.0.0 255.255.255.255 access-list 11 permit 130.10.8.0 0.0.7.255 access-list 11 deny 0.0.0.0 255.255.255.255

Summary

Because it is common for OSPF and RIP to be used together, it is important to use the practices described here in order to provide functionality for both protocols on an internetwork. You can configure autonomous system boundary routers that run both RIP and OSPF and redistribute RIP routes into the OSPF and vice versa. You can also create OSPF areas using area border routers that provide route summarizations. Use VLSM to conserve address space.

频道声明:本频道的文章除部分特别声明禁止转载的专稿外,可以自由转载.但请务必注明出出处和原始作者 文章版权归本频道与文章作者所有.对于被频道转载文章的个人和网站,我们表示深深的谢意。

原始作者:佚名 录入时间:2006-9-29 2:26:53
信息来源:不详 投稿信箱:itqoo@126.com
文章录入:itqoo    责任编辑:itqoo 
  • 上一篇文章:

  • 下一篇文章:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    - 关于我们 - 合作伙伴 - 友情链接 - 广告刊登 - 投稿热线 - 在线留言版权声明联系方式 -
    IT公社版权所有 粤ICP备05127012号
    Copyrigh@2005-2006 itqoo.com.Inc All Rights Reserved  推荐分辨率 1024*768
    联系站长:E-Mail:itqoo@126.com     MSN:urchincc@hotmail.com    QQ:点击这里给我发消息
    特别感谢:亿太网络提供空间支持