🛣️ Juniper RIP 設定範例教學(Junos OS 動態路由入門)
更新日期:2025 年 10 月 22 日 | 作者:WWFandy
💡 一、RIP 是什麼?
RIP(Routing Information Protocol) 是一種距離向量(Distance Vector)動態路由協定, 常用於中小型網路的自動路由學習。它透過「跳數(Hop Count)」判斷最佳路徑,最大跳數為 15。 在 Juniper Junos OS 中,支援 RIP v1 與 v2,並能透過驗證與版本控制強化安全性。
- 📡 版本 1: 不支援子網遮罩與驗證。
- 🔐 版本 2: 支援 VLSM、MD5 驗證與多播傳輸。
- ⚙️ 常見應用: 實驗室測試、小規模內部路由。
📘 二、範例網路架構
假設有兩台 Juniper 路由器:
R1 (Juniper) Interface em1: 192.168.10.1/24 Interface em2: 10.0.0.1/30 → 連至 R2 R2 (Juniper) Interface em1: 192.168.20.1/24 Interface em2: 10.0.0.2/30 → 連至 R1
🎯 目標:讓 R1 學到 192.168.20.0/24,R2 學到 192.168.10.0/24。
⚙️ 三、R1 設定步驟(192.168.10.1 ↔ 10.0.0.1)
configure set interfaces em1 unit 0 family inet address 192.168.10.1/24 set interfaces em2 unit 0 family inet address 10.0.0.1/30 set protocols rip group RIP-GRP neighbor 10.0.0.2 set protocols rip group RIP-GRP export direct set protocols rip group RIP-GRP import all commit
⚙️ 四、R2 設定步驟(192.168.20.1 ↔ 10.0.0.2)
configure set interfaces em1 unit 0 family inet address 192.168.20.1/24 set interfaces em2 unit 0 family inet address 10.0.0.2/30 set protocols rip group RIP-GRP neighbor 10.0.0.1 set protocols rip group RIP-GRP export direct set protocols rip group RIP-GRP import all commit
💡 說明:export direct→ 發布本機直連網段。import all→ 接收所有 RIP 廣播的路由。
🧭 五、驗證與除錯
- 查看 RIP 鄰居狀態:
show rip neighbor
show route protocol rip
show route
若設定正確,R1 應該會看到:
192.168.20.0/24 *[RIP/100] 00:00:18 > via 10.0.0.2, em2.0
而 R2 則會看到:
192.168.10.0/24 *[RIP/100] 00:00:20 > via 10.0.0.1, em2.0
🧩 六、進階設定選項
- 📍 限制 RIP 廣播的介面:
set protocols rip group RIP-GRP interface em2
set protocols rip group RIP-GRP version 2
set protocols rip group RIP-GRP authentication-type md5 set protocols rip group RIP-GRP authentication-key "Juniper123"
🛡️ 建議在企業環境中啟用驗證機制,以防止惡意路由更新或錯誤宣告。
🔗 七、延伸閱讀
— WWFandy・網路與系統筆記
沒有留言: