1、VRRP作為網(wǎng)關(guān)可靠性的常用方法,基本思路是,兩臺路由器組成一個(gè)虛擬路由器,通過VRRP協(xié)議對內(nèi)網(wǎng)呈現(xiàn)一個(gè)虛擬的網(wǎng)關(guān)ip, 以便讓局域網(wǎng)內(nèi)部的終端通過這個(gè)虛擬網(wǎng)關(guān)對外進(jìn)行通信。
創(chuàng)新互聯(lián)自2013年創(chuàng)立以來,先為新城等服務(wù)建站,新城等地企業(yè),進(jìn)行企業(yè)商務(wù)咨詢服務(wù)。為新城企業(yè)網(wǎng)站制作PC+手機(jī)+微官網(wǎng)三網(wǎng)同步一站式服務(wù)解決您的所有建站問題。2、VRRP的最簡單配置就是一條命令,分別在兩個(gè)路由器的對內(nèi)網(wǎng)端口上配置。
vrrp vrid 1 virtual-ip x
3、VRRP也可以實(shí)現(xiàn)為負(fù)載均衡的配置,實(shí)現(xiàn)兩個(gè)路由器同時(shí)轉(zhuǎn)發(fā)流量。
4、VRRP也可以配置監(jiān)測上行端口的擁塞情況,作為VRRP主動調(diào)整自己的優(yōu)先級的依據(jù),從而讓兩個(gè)路由器協(xié)商出更好的網(wǎng)關(guān)。
4、以eNSP的實(shí)驗(yàn)為例,
組網(wǎng)圖:
關(guān)鍵配置:
VRRP配置:
R1的配置:
#
interface GigabitEthernet0/0/1
ip address 192.168.0.10 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.0.1
#
R2的配置:
#
interface GigabitEthernet0/0/2
ip address 192.168.0.20 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.0.1
#
等價(jià)路由的配置:
R3上配置到192.168.0.0 網(wǎng)段的兩條等價(jià)路由
#
ip route-static 192.168.0.0 255.255.255.0 2.0.0.10
ip route-static 192.168.0.0 255.255.255.0 3.0.0.10
#
檢查VRRP運(yùn)行結(jié)果:
在R1上查看VRRP的運(yùn)行結(jié)果:
GigabitEthernet0/0/1 | Virtual Router 1
State : Master
Virtual IP : 192.168.0.1
Master IP : 192.168.0.10
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 100
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Create time : 2017-10-22 17:21:39 UTC-08:00
Last change time : 2017-10-22 17:21:43 UTC-08:00
VRID State Interface Type Virtual IP
----------------------------------------------------------------
1 Master GE0/0/1 Normal 192.168.0.1
----------------------------------------------------------------
Total:1 Master:1 Backup:0 Non-active:0
在R2上查看VRRP的運(yùn)行結(jié)果
GigabitEthernet0/0/2 | Virtual Router 1
State : Backup
Virtual IP : 192.168.0.1
Master IP : 192.168.0.10
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 100
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Create time : 2017-10-22 17:34:29 UTC-08:00
Last change time : 2017-10-22 17:34:29 UTC-08:00
VRID State Interface Type Virtual IP
----------------------------------------------------------------
1 Backup GE0/0/2 Normal 192.168.0.1
----------------------------------------------------------------
Total:1 Master:0 Backup:1 Non-active:0
從上述結(jié)果看,左邊的路由器是VRRP的主路由器。
驗(yàn)證路由器故障的情況:
1、關(guān)閉左邊路由器
查看R2上VRRP狀態(tài)
VRID State Interface Type Virtual IP
----------------------------------------------------------------
1 Master GE0/0/2 Normal 192.168.0.1
----------------------------------------------------------------
Total:1 Master:1 Backup:0 Non-active:0
GigabitEthernet0/0/2 | Virtual Router 1
State : Master
Virtual IP : 192.168.0.1
Master IP : 192.168.0.20
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 100
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Create time : 2017-10-22 17:34:29 UTC-08:00
Last change time : 2017-10-22 17:58:11 UTC-08:00
驗(yàn)證從PC1 ping PC3,可見可以ping 通
PC>ping 10.0.0.102
Ping 10.0.0.102: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 10.0.0.102: bytes=32 seq=2 ttl=126 time=187 ms
From 10.0.0.102: bytes=32 seq=3 ttl=126 time=94 ms
From 10.0.0.102: bytes=32 seq=4 ttl=126 time=94 ms
From 10.0.0.102: bytes=32 seq=5 ttl=126 time=109 ms
--- 10.0.0.102 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/121/187 ms
PC>