動態路由

動態路由協議

動態路由協議通過路由信息的交換生成並維護轉發引擎所需的路由表。當網絡拓撲結構改變時動態路由協議可以自動更新路由表,並負責決定數據傳輸最佳路徑。
在動態路由中,管理員不再需要與靜態路由一樣,手工對路由器上的路由表進行維護,而是在每臺路由器上運行一個路由協議。這個路由協議會根據路由器上的接口的配置(如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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章