分享

路由重分发工作原理

 luxinghui2016 2016-09-08
路由重分发工作原理
网络协议有很多种,例如isis、rip、ospf、bgp等,在大型公司中经常会出现网络设备之间运行多种网络协议的情况,各种网络协议之间如果不进行一定的配置那么设备之间是不能进行互通信息的,在这种情况下就出现了路由重分发技术,路由重分发的作用就是为了实现多种路由协议之间的协同工作。
路由重分发的工作原理:通过在各种路由协议的配置中添加一定的配置使将路由协议广播到另外的路由协议中,让各个路由协议都能检测到运行其他的路由协议的网段,从而实现数据的传输。
路由重分发技术需要用到redistribute命令
rip协议的redistribute命令 redistribute protocol 【metric metric-value】 【match internal | external nssa-external type】 【route-map map-tag】
protocol:路由重分发的源路由协议 metric metric-value:设置路由重分发的度量值(1···6),没有将使用default-metric命令设置的metric值 match internal | external nssa-external type:设置重分发路由的条件,只适合重分发的源路由协议是ospf route-map map-tag应用路由图进行重分发
ospf协议的redistribute命令 redistribute protocol 【subnets】 【metric metric-value】 【metric-type{1 | 2}】 【tag tag-value】 【route-map map-tag】
protocol:路由重分发的源路由协议 subnets:设置是否重分发子网 metric metric-value:设置路由重分发的度量值(1···16777214),没有将使用default-metric命令设置的metric值 metric metric-type:设置重分发的路由度量类型,默认值为2 tag tag-value:设置重分发的路由的tag(0···2147483647)默认为0 route-map map-tag应用路由图进行重分发
重分发到ospf中的时候,除了直连路由和默认路由外,其他重分发的路由的默认的度量值是20,默认度量值类型是2,且默认不重分发子网。
eigrp协议的redistribute命令 redistribute protocol 【metric metric-value】 带宽 延迟 可靠性 负载 mtu参数值
因为 EIGRP 的度量相对复杂,所以重分布时需要分别指定带宽、延迟、可靠性、负载以及 MTU 参数的值。
isis协议的redistribute命令 redistribute protocol 【metric metric-value】 【match internal | external nssa-external type】 【route-map map-tag】
内容和rip的基本相同,在重分发isis协议时,使用isis协议的本地接口是不被重分发出去的,这个端口要使用直联网段重分发,否则会造成局部的网络不可达。
举例:
⑴ 将ospf、直联路由、默认路由、静态路由、eigrp重分发到rip中
[plain]
router rip
redistribute ospf metric 2
[plain]
router rip
redistribute conneted //重分发直连路由,默认度量值是1
[plain]
router rip
redistribute static //重分发静态路由,默认度量值是1
[plain]
router rip  
default-information originate //重分发默认路由,不使用路由图进行重分发控制,前面加上no是关闭重分发默认路由或删除其相关的route-map
router rip  
redistribute eigrp 1 ⑵ 将rip、直连路由、默认路由、静态路由、isis、eigrp重分发到ospf中
  
router ospf 1  
redistribute rip subnets metric 50
router ospf 1  
redistribute connected subnets //默认度量值是20
router ospf 1  
redistribute static subnets //默认度量值是20
router ospf 1  
default-information originate //default-information originate 【always】 【metric metric-value】 【metric-type type-value】 // 【route-map map-name】 always指总是公告默认路由,不管该路由是否存在,默认度量值是10
router ospf 1  
redistribute isis level-2 metric 50 subnets //将isis重分发到ospf中⑶ 将rip、osp重分发到isis中
  
router isis  
redistribute ospf 1 metric 20 //rip和ospf是一样的

⑷ 将rip重分发到eigrp中

router eigrp 1redistribute rip metric 1000 100 255 1 1500

在路由重分发中选择路由协议的时候,除了要看度量值和度量类型,还要看管理距离,在路由器中定义了一些常用的路由协议的默认管理距离,有时默认管理距离无法满足人们的需要,这时候就需要人们手动改变路由协议的管理距离,需要代码为distance weight {ip-address | wildcard | 【access-list-number】} 在这里面weight指路由管理距离,取值为1——255之间,管理距离为255的路由将被丢弃 ip-address指路由源的ip地址,ospf要求该ip地址为路由器标识

wildcard指比较路由源ip地址的匹配符,0表示比较,1表示忽略 access-list-number指访问控制列表号(1-99),只对符合访问控制列表的路由进行管理距离的修改。

  

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多