萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 程式設計 >  >> 伺服器教學

Cisco 路由器動態路由協議配置指令大全 (RIP/OSPF/EIGRP/IGRP)

彙整 Cisco 路由器四大動態路由協議 (RIP、IGRP、OSPF、EIGRP) 的啟用、網路宣告、查看與關鍵參數指令。

基礎模式

Router> enable
Router# configure terminal
Router(config)# interface s0/0
Router(config-if)# ip address 192.168.1.1 255.255.255.252
Router(config-if)# clock rate 500000   # DCE 端設定時鐘
Router(config-if)# bandwidth 64        # 影響路由度量
Router(config)# ip routing             # 三層交換/路由器預設已開

RIP v2

router rip
 version 2
 network 192.168.1.0
 network 192.168.2.0
 no auto-summary

查看:show ip route rip

IGRP (舊式,已淘汰)

router igrp 100   # 100 為自治系統號
 network 192.168.1.0
 network 192.168.2.0

OSPF

router ospf 1
 network 192.168.1.0 0.0.0.255 area 0
 network 192.168.2.0 0.0.0.255 area 0

查看:show ip route ospf、show ip ospf neighbor

EIGRP (Cisco 專有,現已開放)

router eigrp 200
 network 192.168.1.0 0.0.0.255
 network 192.168.2.0 0.0.0.255
 no auto-summary

關鍵:no auto-summary 關閉自動彙總,支援 VLSM/CIDR。

通用驗證

show ip route
show ip protocols
ping 192.168.2.1

實務建議:中小網路首選 OSPF (廠商中立) 或 EIGRP (Cisco 環境收斂快);RIP 僅供教學或極小網路。

copyright © 萬盛學電腦網 all rights reserved