拓扑图

 

 

 

 

【实验】不会部署VRRP?看完就会了

规格

 

 

 

 

适用于所有版本、所有形态的AR路由器。

 

组网需求

 

 

 

 

如图1所示,作为RouterA和RouterB的AR路由器加入两个VRRP备份组以实现备份组中各设备既能相互备份,又能分担网络流量。

RouterA作为备份组1的Master,兼任备份组2的Backup。

RouterB作为备份组2的Master,兼任备份组1的Backup。

HostA使用备份组1作网关,HostC主机使用备份组2作为网关。

 

操作步骤

 

 

 

 

1.RouterA的配置

#

interface Ethernet1/0/0

 ip address 192.168.1.1 255.255.255.0 

#

interface Ethernet2/0/0

 ip address 10.1.1.1 255.255.255.0  

//连接HostA的接口的IP地址

 vrrp vrid 1 virtual-ip 10.1.1.111  

//配置备份组1的虚拟网关地址

 vrrp vrid 1 priority 120           

//配置RouterA在备份组1中的优先级为120

 vrrp vrid 2 virtual-ip 10.1.1.112  

//配置备份组2的虚拟网关地址

#

ospf 1

 area 0.0.0.0

  network 192.168.1.0 0.0.0.255

  network 10.1.1.0 0.0.0.255

#

 

2.RouterB的配置

#

interface Ethernet1/0/0

 ip address 192.168.2.1 255.255.255.0

#

interface Ethernet2/0/0

 ip address 10.1.1.2 255.255.255.0  

//连接HostC的接口的IP地址

 vrrp vrid 1 virtual-ip 10.1.1.111 

//配置备份组1的虚拟网关地址

 vrrp vrid 2 virtual-ip 10.1.1.112  

//配置备份组2的虚拟网关地址

 vrrp vrid 2 priority 120          

 //配置RouterB在备份组2中的优先级为120

#

ospf 1

 area 0.0.0.0

  network 192.168.2.0 0.0.0.255

  network 10.1.1.0 0.0.0.255

#

 

3.RouterC的配置

#

interface Ethernet1/0/0

 ip address 192.168.1.2 255.255.255.0 

#

interface Ethernet2/0/0

 ip address 192.168.2.2 255.255.255.0

#

interface Ethernet3/0/0

 ip address 20.1.1.1 255.255.255.0

#

ospf 1

 area 0.0.0.0

  network 192.168.1.0 0.0.0.255

  network 192.168.2.0 0.0.0.255

  network 20.1.1.0 0.0.0.255

#

 

4.验证配置结果

# 在HostA上对HostB进行tracert测试,可以看到HostA经过RouterA和RouterC到达HostB。显示信息看如下:

 

【实验】不会部署VRRP?看完就会了

 

# 在HostC上对HostB进行tracert测试,可以看到HostC经过RouterB和RouterC到达HostB。显示信息看如下:

 

【实验】不会部署VRRP?看完就会了

 

# 在RouterA上执行display vrrp命令,可以看到RouterA分别作为备份组1的Master和备份组2的Backup。其中备份组1的“state”为Master,备份组2的“state”为Backup

display vrrp

  Ethernet2/0/0 | Virtual Router 1

    state          : Master

    Virtual IP     : 10.1.1.111

    Master IP      : 10.1.1.1

    PriorityRun    : 120

    PriorityConfig : 120

    MasterPriority : 120

    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

    Backup-forward : disabled

    Create time    : 2007-11-22 16:02:21

    Last change time : 2007-11-22 16:02:25

  Ethernet2/0/0 | Virtual Router 2

    state          : Backup

    Virtual IP     : 10.1.1.112

    Master IP      : 10.1.1.2

    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-0102

    Check TTL      : YES

    Config type    : normal-vrrp

    Backup-forward : disabled

    Create time    : 2007-11-22 16:03:05

    Last change time : 2007-11-22 16:03:09

 

# 在RouterB的Ethernet2/0/0接口上执行shutdown命令,模拟备份组2的网关故障。在RouterA上执行display vrrp命令,可以看到RouterA分别作为备份组1的Master和备份组2的Master。其中,备份组1和备份组2的“state”均为Master。此时,两个VRRP备份组的虚拟网关都在RouterA上。

display vrrp

  Ethernet2/0/0 | Virtual Router 1

    state          : Master

    Virtual IP     : 10.1.1.111

    Master IP      : 10.1.1.1

    PriorityRun    : 120

    PriorityConfig : 120

    MasterPriority : 120

    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

    Backup-forward : disabled

    Create time    : 2007-11-22 16:02:21

    Last change time : 2007-11-22 16:02:25

  Ethernet2/0/0 | Virtual Router 2

    state          : Master

    Virtual IP     : 10.1.1.112

    Master IP      : 10.1.1.1

    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-0102

    Check TTL      : YES

    Config type    : normal-vrrp

    Backup-forward : disabled

    Create time    : 2007-11-22 16:03:05

    Last change time : 2007-11-22 16:03:09

相关文章: