首页 > 其他 > 详细

动态路由

时间:2018-05-25 14:46:38      阅读:263      评论:0      收藏:0      [点我收藏+]
动态路由协议

动态路由协议通过路由信息的交换生成并维护转发引擎所需的路由表。当网络拓扑结构改变时动态路由协议可以自动更新路由表,并负责决定数据传输最佳路径。
在动态路由中,管理员不再需要与静态路由一样,手工对路由器上的路由表进行维护,而是在每台路由器上运行一个路由协议。这个路由协议会根据路由器上的接口的配置(如IP地址的配置)及所连接的链路的状态,生成路由表中的路由表项。

路由交换

tcp/ip 静态路由 精确的指向 默认路由
动态路由 -让路由器自己选择最佳路径添加到路由表
度量类型划分

距离矢量路由协议 RIP 协议
路由器的挑唆
链路状态协议 OSPF ISIS
区域位置划分
内部网关路由协议 OSPF RIP ISIS 在同一个
外部网关路由协议 BGP

DR和BDR

网段上ROUTER ID 最大的路由将选为DR 第二大 的将选举为BDR 自动选举
手工选择DR 和BDR
优先级范围是0-255 数值越大 优先级越高 默认为1
如果优先相同,则需要比较router ID
如果路由器的优先级被设置为0 ,它将不参与DR和DER 选举

路由器的优先级可以影响一个选举过程,但是它不能强制更换已经存在的DR和BDR的路由器
OSPF 的组播地址 224.0.0.2 244.0.0.6
当在路由器直连网段断 路由器会把244.0.0.6 封装并且转发给 DR 和 BDR
DR 发生变更 发送224.0.0.5 发送给下面路由器 并且告诉路由器更改路由表

技术分享图片

  • R1#conf t
  • R1(config)#int f0/0 进入端口
  • R1(config-if)#ip add 192.168.10.1 配置地址 255.255.255.0
  • R1(config-if)#no shut 开启端口
  • R1(config-if)#ex
  • R1(config)#int f0/1
  • R1(config-if)#ip add 192.168.20.1 255.255.255.0
  • R1(config-if)#no shut
  • R1(config)#router ospf 1 进入 ospf 路由协议
  • R1(config-router)#router-id 1.1.1.1 配置端口
  • R1(config-router)#network 192.168.10.0 0.0.0.255 area 0 发送自己的直链网段
  • R1(config-router)#network 192.168.20.0 0.0.0.255 area 0
  • R1#show ip route 查看详细
  • O 192.168.30.0/24 [110/20] via 192.168.20.2, 00:06:25, FastEthernet0/1
  • C 192.168.10.0/24 is directly connected, FastEthernet0/0
  • O 192.168.40.0/24 [110/30] via 192.168.20.2, 00:06:25, FastEthernet0/1
  • C 192.168.20.0/24 is directly connected, FastEthernet0/1
  • R2(config)#int f0/0
  • R2(config-if)#ip add 192.168.20.2 255.255.255.0
  • R2(config-if)#no shut
  • R2(config-if)#ex
  • R2(config)#int f0/1
  • R2(config-if)#ip add 192.168.30.1 255.255.255.0
  • R2(config-if)#no shut
  • R2(config-if)#ex
  • R2(config-router)#router-id 2.2.2.2
  • R2(config-router)#network 192.168.20.0 0.0.0.255 area 0
  • R2(config-router)#network 192.168.30.0 0.0.0.255 area 0
  • R2(config-router)#do show ip route
  • C 192.168.30.0/24 is directly connected, FastEthernet0/1
  • O 192.168.10.0/24 [110/20] via 192.168.20.1, 00:09:50, FastEthernet0/0
  • O 192.168.40.0/24 [110/20] via 192.168.30.2, 00:09:50, FastEthernet0/1
  • C 192.168.20.0/24 is directly connected, FastEthernet0/0
    技术分享图片

  • R3(config)#int f0/0
  • R3(config-if)#ip add 192.168.30.2 255.255.255.0
  • R3(config-if)#no shut
  • R3(config-if)#ex
  • R3(config)#router ospf 1
  • R3(config-router)#router-id 3.3.3.3
  • R3(config-router)#network 192.168.30.0 0.0.0.255 area 0
  • R3(config-router)#network 192.168.40.0 0.0.0.255 area 0
  • R3(config)#do show ip route
  • C 192.168.30.0/24 is directly connected, FastEthernet0/0
  • O 192.168.10.0/24 [110/30] via 192.168.30.1, 00:12:03, FastEthernet0/0
  • C 192.168.40.0/24 is directly connected, FastEthernet0/1
  • O 192.168.20.0/24 [110/20] via 192.168.30.1, 00:12:03, FastEthernet0/0

动态路由

原文:http://blog.51cto.com/13660858/2120212

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!