2014年3月10日 星期一

VRRP

(VRRP:Virtual Router Redundancy Protocol)
虛擬路由器冗餘協議(VRRP)是一種選擇協議,它可以把一個虛擬路由器的責任動態分配到區域網上的 VRRP 路由器中的一台。控制虛擬路由器 IP 地址的 VRRP 路由器稱為主路由器,它負責轉發數據包到這些虛擬 IP 地址。一旦主路由器不可用,這種選擇過程就提供了動態的故障轉移機制,這就允許虛擬路由器的 IP 地址可以作為終端主機的默認第一跳路由器。使用 VRRP 的好處是有更高的默認路徑的可用性而無需在每個終端主機上配置動態路由或路由發現協議。(http://www.twwiki.com/wiki/VRRP)

Juniper 

EX-3200 為例

Virtual IP : 192.168.1.10
第一台 IP : 192.168.1.11
第二台 IP : 192.168.1.12

#set vlans VLAN10 vlan-id 10
#set vlans VLAN10 l3-interface vlan.10

第一台
#set interfaces vlan unit 10 family inet address 192.168.1.11/24
#set interfaces vlan unit 10 family inet address 192.168.1.11/24 vrrp-group 0 virtual-address 192.168.1.10
#set interfaces vlan unit 10 family inet address 192.168.1.11/24 vrrp-group 0 priority 200
 ***priority 高的為 Master***


第二台
#set interfaces vlan unit 10 family inet address 192.168.1.12/24
#set interfaces vlan unit 10 family inet address 192.168.1.12/24 vrrp-group 0 virtual-address 192.168.1.10
#set interfaces vlan unit 10 family inet address 192.168.1.12/24 vrrp-group 0 priority 100

>show vrrp


Cisco

第一台
R1(config)# interface ethernet0/1
R1(config-if)# ip address 192.168.1.11 255.255.255.0
R1(config-if)# vrrp 1 ip 192.168.1.10
R1(config-if)# vrrp 1 priority 200
R1(config-if)# vrrp 1 authentication md5 key-string cisco
R1(config-if)# no shut

第二台
R2(config)# interface ethernet0/1
R2(config-if)# ip address 192.168.1.12 255.255.255.0
R1(config-if)# vrrp 1 ip 192.168.1.10
R1(config-if)# vrrp 1 priority 100
R2(config-if)# vrrp 1 authentication md5 key-string cisco
R2(config-if)# no shut