侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

动态路由

2023-01-27 星期五 / 0 评论 / 0 点赞 / 74 阅读 / 4304 字

动态路由协议动态路由协议通过路由信息的交换生成并维护转发引擎所需的路由表。当网络拓扑结构改变时动态路由协议可以自动更新路由表,并负责决定数据传输最佳路径。在动态路由中,管理员不再需要与静态路由一样,手

.

动态路由协议

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

广告 广告

评论区