HSRP(cisco) 和VRRP(通用) 是最常用的網關冗餘技術,HSRP 和VRRP 類似,由多個路由器
共同組成一個組,虛擬出一個網關,其中的一臺路由器處於活動狀態,當它故障時由備份路
由器接替它的工作,從而實現對用戶透明的切換。然而我們希望在冗餘的同時,能同時實現
負載平衡,以充分利用設備的能力,GLBP (cisco)同時提供了冗餘和負載平衡的能力。
配置步驟大致如下:
做好相關端口配置,設置好追蹤,設置網關組,根據不同流量設置相應網關,設置不同優先級實現相互分流和替用。
hsrp
router a:
interface f0/0
no shut
ip add 192.168.0.1 255.255.255.0
standby 1 ip 192.168.0.254
standby 1 preempt
standby 1 priority 120
standby 1 track f0/1 30
standby 1 authentication md5 key-string cisco
standby 2 ip 192.168.0.253
standby 2 preempt
standby 2 authentication md5 key-string cisco
router b:
interface f0/0
no shut
ip address 192.168.0.2 255.255.255.0
standby 1 ip 192.168.0.254
standby 1 preempt
standby 1 authentication md5 key-string cisco
standby 2 ip 192.168.0.253
standby 2 authentication md5 key-string cisco
standby 2 priotiry 120
standby 2 track f0/1 30
vrrp
router a:
track 100 interface f0/1 line-protocol
interface f0/0
vrrp 1 ip 192.168.0.254
vrrp 1 priority 120
vrrp 1 preempt
vrrp 1 authentication md5 key-string cisco
vrrp 1 track 100 decrement 30
vrrp 2 ip 192.168.0.253
vrrp 2 preempt
vrrp 2 authentication md5 key-string cisco
router b:
track 100 interface f0/0 line-protocol
interface f0/0
vrrp 1 ip 192.168.0.254
vrrp 1 preempt
vrrp 1 authentication key-string cisco
vrrp 2 ip 192.168.0.253
vrrp 2 preempt
vrrp 2 priority 120
vrrp 2 track 100 decrement 30
vrrp 2 authentication md5 key-string cisco
router a:
int f0/0
glbp 1 ip 192.168.1.254
glbp 1 priority 200
glbp 1 preempt
glbp 1 authentication md5 key-string cisco
router b:
int f0/0
glbp 1 ip 192.168.1.254
glbp 1 priority 180
glbp 1 preempt
glbp 1 authentication md5 key-string cisco
這樣,可以實現網關冗餘與負載均衡。