虚拟路由器冗余协议(VRRP)原理与实验
生活随笔
收集整理的這篇文章主要介紹了
虚拟路由器冗余协议(VRRP)原理与实验
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一、基礎知識: 虛擬路由冗余協議(VRRP)與熱備份路由協議(HSRP)都是一種默認網關冗余方法,它們都是讓一組路由器構成一臺虛擬路由器。和HSRP不同的是,VRRP是開發的協議,而HSRP是思科專屬的。 使用VRRP創建的虛擬路由器被稱為VRRP組,它代表一組路由器。 在VRRP組中是通過優先級來決定主虛擬路由器的。 優先級范圍:1—255。如果優先級設置為0,那么主路由器和任何路由器將不再是VRRP組中的路由器。(通過將優先級設置為0來讓主路由器自動辭職。) 二、VRRP的配置與驗證: 配置主要命令: 1.定義VRRP組 Vrrp?group-number?ip?virtual-ip-address 2.配置指定VRRP路由器的優先級: Vrrp?group-number?priority?priority-value 3.允許主虛擬路由器失效的情況下切換到備用虛擬路由器: Vrrp?group-number?preempt ????? 驗證命令: 1.查看VRRP詳細配置信息: Show vrrp all 2.查看VRRP簡要配置信息: Show vrrp brief 3.查看VRRP接口配置信息: Show vrrp interface FastEthernet*/* 三、實驗: 拓撲圖: 實驗目的: 在這個實驗配置了兩個VRRP組——vrrp 1和vrrp 2。在vrrp 1中,路由器R1為主虛擬路由器,R2為備用虛擬路由器;在vrrp 2中,路由器R1為備用虛擬路由器,路由器R1為主虛擬路由器。在兩個路由器都正常工作的時候,PC1和PC2通過R1訪問遠端,PC3通過R2訪問遠端。 具體配置: 路由器R1的具體配置: R1(config)#int f0/0 R1(config-if)#ip address 10.0.0.253 255.255.255.0 R1(config-if)#no shutdown R1(config-if)#int s1/0 R1(config-if)#ip add 200.0.1.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)#int f0/0 R1(config-if)#vrrp 1 ip 10.0.0.253 R1(config-if)#vrrp 1 priority 200 R1(config-if)#vrrp 1 preempt R1(config-if)#vrrp 2 ip 10.0.0.254 R1(config-if)#vrrp 2 priority 100 R1(config-if)#vrrp 2 preempt R1(config-if)#exit R1(config)#router rip R1(config)#ver 2 R1(config)#no auto-summary R1(config)#network 10.0.0.0 R1(config)#network 200.0.1.0 路由器R2的配置: R2#sh run Building configuration... Current configuration : 1019 bytes ! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R2 ! boot-start-marker boot-end-marker ! memory-size iomem 5 no aaa new-model ip subnet-zero !?? ip cef ! no ftp-server write-enable ! interface FastEthernet0/0 ip address 10.0.0.254 255.255.255.0 duplex auto speed auto vrrp 1 ip 10.0.0.253 vrrp 1 priority 150 vrrp 2 ip 10.0.0.254 vrrp 2 priority 200 ! interface Serial1/0 ip address 200.0.2.1 255.255.255.0 serial restart-delay 0 ! interface Serial1/1 no ip address shutdown serial restart-delay 0 ! interface Serial1/2 no ip address shutdown serial restart-delay 0 ! interface Serial1/3 no ip address shutdown serial restart-delay 0 ! router rip version 2 network 10.0.0.0 network 200.0.2.0 no auto-summary ! ip http server ip classless ! control-plane ! line con 0 transport preferred all transport output all line aux 0 transport preferred all transport output all line vty 0 4 ! End 路由器R3的配置: R3#sh run Building configuration... Current configuration : 965 bytes ! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R3 ! boot-start-marker boot-end-marker ! memory-size iomem 5 no aaa new-model ip subnet-zero ! ip cef ! no ftp-server write-enable ! interface Serial0/0 ip address 200.0.1.2 255.255.255.0 serial restart-delay 0 ! interface Serial0/1 ip address 200.0.2.2 255.255.255.0 serial restart-delay 0 ! interface Serial0/2 no ip address shutdown serial restart-delay 0 ! interface Serial0/3 no ip address shutdown serial restart-delay 0 ! interface FastEthernet1/0 ip address 200.0.0.254 255.255.255.0 duplex auto speed auto ! router rip version 2 network 200.0.0.0 network 200.0.1.0 network 200.0.2.0 no auto-summary ! ip http server ip classless ! control-plane ! line con 0 transport preferred all transport output all line aux 0 transport preferred all transport output all line vty 0 4 ! End 在交換機上要記得將連接路由器、主機的接口用NO SHUTDOWN開啟! 驗證配置: 在路由器R1上: 在路由器R2上: 實驗做完了,當然,大家也可以通過關閉接口等方法來驗證VRRP是否有效果~
本文轉自 tiger506 51CTO博客,原文鏈接:http://blog.51cto.com/tiger506/114949,如需轉載請自行聯系原作者
本文轉自 tiger506 51CTO博客,原文鏈接:http://blog.51cto.com/tiger506/114949,如需轉載請自行聯系原作者
總結
以上是生活随笔為你收集整理的虚拟路由器冗余协议(VRRP)原理与实验的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: gluPerspective和gluLo
- 下一篇: JAVA并发-为现有的线程安全类添加原子