07-VRRP典型配置指导
本章节下载: 07-VRRP典型配置指导 (613.46 KB)
本章所指的路由器代表了一般意义下的路由器,以及运行了路由协议的三层交换机。为提高可读性,在手册的描述中将不另行说明。
如图1-1所示,通常,同一网段内的所有主机都设置一条相同的、以网关为下一跳的缺省路由。主机发往其他网段的报文将通过缺省路由发往网关,再由网关进行转发,从而实现主机与外部网络的通信。当网关发生故障时,本网段内所有以网关为缺省路由的主机将无法与外部网络通信。
缺省路由为用户的配置操作提供了方便,但是对缺省网关设备提出了很高的稳定性要求。增加出口网关是提高系统可靠性的常见方法,此时如何在多个出口之间进行选路就成为需要解决的问题。
VRRP(Virtual Router Redundancy Protocol,虚拟路由器冗余协议)将可以承担网关功能的一组路由器加入到备份组中,形成一台虚拟路由器,由VRRP的选举机制决定哪台路由器承担转发任务,局域网内的主机只需将虚拟路由器配置为缺省网关。
VRRP是一种容错协议,在提高可靠性的同时,简化了主机的配置。在具有多播或广播能力的局域网(如以太网)中,借助VRRP能在某台路由器出现故障时仍然提供高可靠的缺省链路,有效避免单一链路发生故障后网络中断的问题,而无需修改动态路由协议、路由发现协议等配置信息。
设备支持两种模式的VRRP:
l 标准协议模式:基于RFC实现的VRRPv2和VRRPv3。其中,VRRPv2基于IPv4,VRRPv3基于IPv6。VRRPv2和VRRPv3在功能实现上并没有区别,只是应用的网络环境不同。
l 负载均衡模式:在标准协议模式的基础上进行了扩展,实现了负载均衡功能。
在VRRP标准协议模式下,借助VRRP单备份组组网,使用两台或多台交换机组成一个虚拟备份组,负责提供两条或多条通往外部网络的稳定的链路,避免备份组内的单台或多台交换机发生故障而引起的通信中断。VRRP标准协议模式下业务仅由Master承担。当Master出现故障时,才会由选举出来的Backup接替它工作。
图1-2 VRRP单备份组配置组网图
l 用户网络中采用VRRP技术进行网关设备的备份,提高可靠性;
l 要求正常情况下,局域网内的主机通过Switch A访问外部网络;当Switch A出现故障或其连接Internet的VLAN接口3不可用时,Switch B能够快速检测到故障并接替其工作,局域网内的主机改为通过Switch B访问外部网络。
l 在Switch A和Switch B上分别创建VRRP备份组1,配置其虚拟IP地址为202.38.160.111;
l Host A的缺省网关设为202.38.160.111;
l 配置Switch A在备份组1中具有较高的优先级,从而保证正常情况下Switch A被选为Master;
l 配置Switch A监视连接Internet的VLAN接口3的状态,当被监视的接口DOWN掉时,Switch A的优先级会自动降低20,使备份组内Switch B的优先级高于Switch A,从而实现主备切换;
l 配置Switch A和Switch B工作在抢占方式,以保证原Master设备故障恢复后,能再次抢占成为Master。为了避免频繁地进行状态切换,配置抢占延迟时间为5秒;
l 为了防止非法用户构造报文攻击备份组,通过简单字符认证方法验证备份组1中的VRRP报文,认证字为hello。
表1-1 配置适用的产品与软件版本关系
产品 |
软件版本 |
S7500E系列以太网交换机 |
Release 6300系列,Release 6600系列,Release 6610系列 |
S7600系列以太网交换机 |
Release 6600系列,Release 6610系列 |
S5800&S5820X系列以太网交换机 |
Release 1110,Release 1211 |
CE3000-32F以太网交换机 |
Release 1211 |
S5810系列以太网交换机 |
Release 1102 |
S5500-EI系列以太网交换机 |
Release 2202,Release 2208 |
S5500-EI-D系列以太网交换机 |
Release 2208 |
S3610&S5510系列以太网交换机 |
Release 5301,Release 5303,Release 5306,Release 5309 |
S3500-EA系列以太网交换机 |
Release 5303,Release 5309 |
# 配置VLAN3。
<SwitchA> system-view
[SwitchA] vlan 3
[SwitchA-vlan3] port GigabitEthernet1/0/3
[SwitchA-vlan3] quit
[SwitchA] interface Vlan-interface 3
[SwitchA-Vlan-interface3] ip address 100.0.0.2 24
[SwitchA-Vlan-interface3] quit
# 配置VLAN2。
[SwitchA] vlan 2
[SwitchA-vlan2] port GigabitEthernet1/0/5
[SwitchA-vlan2] quit
[SwitchA] interface Vlan-interface 2
[SwitchA-Vlan-interface2] ip address 202.38.160.1 255.255.255.0
# 创建VRRP备份组1,其虚拟IP地址为202.38.160.111/24。
[SwitchA-Vlan-interface2] vrrp vrid 1 virtual-ip 202.38.160.111
# 设置Switch A在备份组中的优先级为110。
[SwitchA-Vlan-interface2] vrrp vrid 1 priority 110
# 设置备份组的认证方式为SIMPLE认证,认证字为hello。
[SwitchA-Vlan-interface2] vrrp vrid 1 authentication-mode simple hello
#设置Switch A工作在抢占方式,抢占延迟时间为5秒。
[SwitchA-Vlan-interface2] vrrp vrid 1 preempt-mode timer delay 5
# 设置监视Switch A连接Internet的VLAN接口3。当被监视的接口不可用时,Switch A的优先级会自动降低20,使备份组内Switch B的优先级高于Switch A,从而实现主备切换。
[SwitchA-Vlan-interface2] vrrp vrid 1 track interface vlan-interface 3 reduced 20
(2) 配置Switch B
# 配置VLAN2。
<SwitchB> system-view
[SwitchB] vlan 2
[SwitchB-Vlan2] port GigabitEthernet1/0/5
[SwitchB-Vlan2] quit
[SwitchB] interface Vlan-interface 2
[SwitchB-Vlan-interface2] ip address 202.38.160.2 255.255.255.0
# 创建一个VRRP备份组1,其虚拟IP地址为202.38.160.111/24。
[SwitchB-Vlan-interface2] vrrp vrid 1 virtual-ip 202.38.160.111
# 设置备份组的认证方式为SIMPLE认证,认证字为hello。
[SwitchB-Vlan-interface2] vrrp vrid 1 authentication-mode simple hello
# 设置Switch B工作在抢占方式,抢占延迟时间为5秒。
[SwitchB-Vlan-interface2] vrrp vrid 1 preempt-mode timer delay 5
(3) 配置主机
配置Host A的缺省网关为202.38.160.111,具体配置过程略。
(4) 验证配置结果
配置完成后,在Host A上可以ping通Host B。通过display vrrp verbose命令查看配置后的结果。
# 显示Switch A上备份组1的详细信息。
[SwitchA-Vlan-interface2] display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : 202.38.160.111
Virtual MAC : 0000-5e00-0101
Master IP : 202.38.160.1
VRRP Track Information:
Track Interface: Vlan3 State : Up Pri Reduced : 20
# 显示Switch B上备份组1的详细信息。
[SwitchB-Vlan-interface2] display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : 202.38.160.111
Master IP : 202.38.160.1
以上显示信息表示在备份组1中Switch A为Master,Switch B为Backup,Host A发送给Host B的报文通过Switch A转发。
Switch A出现故障后,在Host A上仍然可以ping通Host B。通过display vrrp verbose命令查看Switch B上备份组的详细信息。
# Switch A出现故障后,显示Switch B上备份组1的详细信息。
[SwitchB-Vlan-interface2] display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : 202.38.160.111
Virtual MAC : 0000-5e00-0101
Master IP : 202.38.160.2
以上显示信息表示Switch A出现故障后,Switch B成为Master,Host A发送给Host B的报文通过Switch B转发。
Switch A连接Internet的VLAN接口3不可用时,在Host A上仍然可以ping通Host B。通过display vrrp verbose命令查看备份组的信息。
# Switch A的VLAN接口3不可用时,显示Switch A上备份组1的详细信息。
[SwitchA-Vlan-interface2] display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 110 Running Pri : 90
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : 202.38.160.111
Master IP : 202.38.160.2
VRRP Track Information:
Track Interface: Vlan3 State : Down Pri Reduced : 20
# Switch A的VLAN接口3不可用时,显示Switch B上备份组1的详细信息。
[SwitchB-Vlan-interface2] display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : 202.38.160.111
Virtual MAC : 0000-5e00-0101
Master IP : 202.38.160.2
以上显示信息表示Switch A的VLAN接口3不可用时,Switch A的优先级降低为90,成为Backup,Switch B成为Master,Host A发送给Host B的报文通过Switch B转发。
l Switch A上的配置
#
vlan 2 to 3
#
interface Vlan-interface2
ip address 202.38.160.1 255.255.255.0
vrrp vrid 1 virtual-ip 202.38.160.111
vrrp vrid 1 priority 110
vrrp vrid 1 preempt-mode timer delay 5
vrrp vrid 1 track interface vlan-interface 3 reduced 20
vrrp vrid 1 authentication-mode simple hello
#
interface Vlan-interface3
ip address 100.0.0.2 255.255.255.0
#
interface GigabitEthernet1/0/3
port access vlan 3
#
interface GigabitEthernet1/0/5
port access vlan 2
#
l SwitchB上的配置
vlan 2
#
interface Vlan-interface2
ip address 202.38.160.2 255.255.255.0
vrrp vrid 1 virtual-ip 202.38.160.111
vrrp vrid 1 preempt-mode timer delay 5
vrrp vrid 1 authentication-mode simple hello
#
interface GigabitEthernet1/0/5
port access vlan 2
#
l 虚拟IP地址和接口IP地址必须在同一网段,且为合法的主机地址,不能为全零地址(0.0.0.0)、广播地址(255.255.255.255)、环回地址、非A/B/C类地址和其它非法IP地址(如0.0.0.1),否则备份组无法正常工作。
l 对于同一个VRRP备份组的配置,必须保证备份组虚拟路由器的IP地址个数、每个备份组虚拟路由器的IP地址、定时器间隔时间和认证方式完全一样。
l 建议不要在Super VLAN对应的VLAN接口下创建VRRP备份组,以免对网络性能造成影响。
l 如果网络流量过大或者不同的交换机上的定时器差异等因素,会导致Backup设备的定时器异常超时而发生状态转换。对于这种情况,可以通过将VRRP通告报文的发送时间间隔延长和设置抢占延迟时间的办法来解决。
l 设备在某个备份组中作为IP地址拥有者(接口IP地址与该接口上VRRP虚拟IP地址相同的设备被称为“IP地址拥有者”)时,如果在该设备上配置该备份组监视其上行接口或指定Track项,则该配置不会生效。该设备不再作为IP地址拥有者后,之前的配置才会生效。
l 建议用户在配置监视接口功能时,在下行Trunk端口禁止VRRP备份组监视接口所对应的VLAN通过。
l 被监视接口的状态由down变为up后,对应设备的优先级数会自动恢复。
l 用户在配置降低优先级幅度时,需要确保降低后的优先级,比备份组内其他交换机的优先级要低,确保备份组内有其他交换机被选为Master交换机。
VRRP功能可以实现设备的主备备份,在Master设备故障时自动进行主备切换,启用Backup设备,避免流量的中断。但是如果Master设备本身工作正常,而Master设备到达某网络的上行链路出现了故障,VRRP无法自动感知并进行主备设备切换,主机就无法通过此Master设备远程访问该网络。
此时,可以通过监视指定接口上行链路功能,解决这个问题。
当Master设备发现上行链路出现故障后,主动降低自己的优先级(使其自身优先级低于Backup),并立即发送VRRP报文。Backup设备接收到优先级比自己低的VRRP报文后,抢占成为新的Master,协助主机完成网络通讯。
目前有两种方案:
l 利用NQA技术监视上行链路连接的远端主机或者网络状况:在Master设备上启动NQA的ICMP-echo探测功能来探测远端主机的可达性,同时创建和该NQA测试关联的Track项,VRRP通过监测该Track项即可以及时获取其上行链路的状态。具体请参见1.3.1 使用NQA监视Master上行链路典型配置指导。
l 利用BFD技术监视上行链路连接的远端主机或者网络状况:在Master设备上使用BFD技术监视其上行设备的物理状态,同时创建和BFD关联的Track项,VRRP通过监测该Track项即可以快速检测到其上行链路的状态。由于BFD的精度可以到达10ms,通过BFD检测链路状态的变化,可以达到快速抢占的目的。具体请参见1.3.2 使用BFD监视Master上行链路典型配置指导。
图1-3 VRRP与Track、NQA联动监视Master上行链路配置组网图
l 用户网络中采用VRRP技术进行网关设备的备份,提高可靠性;
l 要求正常情况下,局域网内的主机通过Switch A访问外部网络;当Switch A出现故障或其连接Internet的上行链路出现故障时,Switch B能够快速检测到故障并接替其工作,局域网内的主机改为通过Switch B访问外部网络。
l 在Switch A和Switch B上分别创建VRRP备份组1,配置其虚拟IP地址为10.1.1.10;
l Host A的缺省网关设为10.1.1.10;
l 配置Switch A在备份组1中具有较高的优先级,从而保证正常情况下Switch A被选为Master;
l 在Switch A上配置NQA ICMP-echo测试组并创建和该NQA测试关联的Track项,监测Switch A上行链路的连通情况,当监测到其上行链路不通时,Switch A的优先级会自动降低20,使备份组内Switch B的优先级高于Switch A,从而实现主备切换;
l 配置Switch A和Switch B工作在抢占方式,以保证原Master设备故障恢复后,能再次抢占成为Master。为了避免频繁地进行状态切换,配置抢占延迟时间为5秒;
l 为了防止非法用户构造报文攻击备份组,通过简单字符认证方法验证备份组1中的VRRP报文,认证字为hello。
表1-2 配置适用的产品与软件版本关系
产品 |
软件版本 |
S7500E系列以太网交换机 |
Release 6300系列,Release 6600系列,Release 6610系列 |
S7600系列以太网交换机 |
Release 6600系列,Release 6610系列 |
S5800&S5820X系列以太网交换机 |
Release 1110,Release 1211 |
CE3000-32F以太网交换机 |
Release 1211 |
S5500-EI系列以太网交换机 |
Release 2202,Release 2208 |
S5500-EI-D系列以太网交换机 |
Release 2208 |
S3610&S5510系列以太网交换机 |
Release 5306,Release 5309 |
S3500-EA系列以太网交换机 |
Release 5309 |
(1) 按照图1-3配置各接口的IP地址
下面以Switch A Vlan-interface 2为例进行介绍,其它接口的配置过程类似,不再一一赘述。
# 配置Switch A Vlan-interface 2的接口地址。
<SwitchA> system-view
[SwitchA] vlan 2
[SwitchA-vlan2] port GigabitEthernet1/0/5
[SwitchA-vlan2] quit
[SwitchA] interface Vlan-interface 2
[SwitchA-Vlan-interface2] ip address 10.1.1.1 255.255.255.0
[SwitchA-Vlan-interface2] quit
(2) 在Switch A上配置NQA测试组
# 创建管理员名为admin、操作标签为test的NQA测试组。
[SwitchA] nqa entry admin test
# 配置测试类型为ICMP-echo。
[SwitchA-nqa-admin-test] type icmp-echo
# 配置目的地址为10.1.2.2。
[SwitchA-nqa-admin-test-icmp-echo] destination ip 10.1.2.2
# 测试频率为100ms。
[SwitchA-nqa-admin-test-icmp-echo] frequency 100
# 配置联动项1(连续失败5次触发联动)。
[SwitchA-nqa-admin-test-icmp-echo] reaction 1 checked-element probe-fail threshold-type consecutive 5 action-type trigger-only
[SwitchA-nqa-admin-test-icmp-echo] quit
# 启动探测。
[SwitchA] nqa schedule admin test start-time now lifetime forever
(3) 在Switch A上配置Track项
# 配置Track项1,关联NQA测试组(管理员为admin,操作标签为test)的联动项1。
[SwitchA] track 1 nqa entry admin test reaction 1
(4) 在Switch A上配置VRRP
# 创建备份组1,并配置备份组1的虚拟IP地址为10.1.1.10。
[SwitchA] interface vlan-interface 2
[SwitchA-Vlan-interface2] vrrp vrid 1 virtual-ip 10.1.1.10
# 设置Switch A在备份组1中的优先级为110。
[SwitchA-Vlan-interface2] vrrp vrid 1 priority 110
# 设置备份组的认证方式为SIMPLE,认证字为hello。
[SwitchA-Vlan-interface2] vrrp vrid 1 authentication-mode simple hello
# 设置Switch A工作在抢占方式,抢占延迟时间为5秒。
[SwitchA-Vlan-interface2] vrrp vrid 1 preempt-mode timer delay 5
# 设置监视Track项。
[SwitchA-Vlan-interface2] vrrp vrid 1 track 1 reduced 20
(5) 在Switch B上配置VRRP
<SwitchB> system-view
[SwitchB] interface vlan-interface 2
# 创建备份组1,并配置备份组1的虚拟IP地址为10.1.1.10。
[SwitchB-Vlan-interface2] vrrp vrid 1 virtual-ip 10.1.1.10
# 设置备份组的认证方式为SIMPLE,认证字为hello。
[SwitchB-Vlan-interface2] vrrp vrid 1 authentication-mode simple hello
# 设置Switch B工作在抢占方式,抢占延迟时间为5秒。
[SwitchB-Vlan-interface2] vrrp vrid 1 preempt-mode timer delay 5
(6) 配置主机
配置Host A的缺省网关为10.1.1.10,具体配置过程略。
(7) 验证配置结果
配置完成后,在Host A上可以ping通Host B。通过display vrrp命令查看配置后的结果。
# 显示Switch A上备份组1的详细信息。
[SwitchA-Vlan-interface2] display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : 10.1.1.10
Virtual MAC : 0000-5e00-0101
Master IP : 10.1.1.1
VRRP Track Information:
Track Object : 1 State : Positive Pri Reduced : 20
# 显示Switch B上备份组1的详细信息。
[SwitchB-Vlan-interface2] display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : 10.1.1.10
Master IP : 10.1.1.1
以上显示信息表示在备份组1中Switch A为Master,Switch B为Backup,Host A发送给Host B的报文通过Switch A转发。
Switch A与Switch C不通时,在Host A上仍然可以ping通Host B。通过display vrrp命令查看备份组的信息。
# Switch A与Switch C不通时,显示Switch A上备份组1的详细信息。
[SwitchA-Vlan-interface2] display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 110 Running Pri : 90
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : 10.1.1.10
Master IP : 10.1.1.2
VRRP Track Information:
Track Object : 1 State : Negative Pri Reduced : 20
# Switch A与Switch C不通时,显示Switch B上备份组1的详细信息。
[SwitchB-Vlan-interface2] display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : 10.1.1.10
Virtual MAC : 0000-5e00-0101
Master IP : 10.1.1.2
以上显示信息表示Switch A与Switch C不通时,Switch A的优先级降低为90,成为Backup,Switch B成为Master,Host A发送给Host B的报文通过Switch B转发。
l Switch A上的配置
#
vlan 2 to 3
#
interface Vlan-interface2
ip address 10.1.1.1 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.10
vrrp vrid 1 priority 110
vrrp vrid 1 authentication-mode simple hello
vrrp vrid 1 preempt-mode timer delay 5
vrrp vrid 1 track 1 reduced 20
#
interface Vlan-interface3
ip address 10.1.2.1 255.255.255.0
#
interface GigabitEthernet1/0/5
port access vlan 2
#
interface GigabitEthernet1/0/6
port access vlan 3
#
nqa entry admin test
type icmp-echo
destination ip 10.1.2.2
frequency 100
reaction 1 checked-element probe-fail threshold-type consecutive 5 action-type trigger-only
#
track 1 nqa entry admin test reaction 1
#
nqa schedule admin test start-time now lifetime forever
#
l Switch B上的配置
#
vlan 2
#
interface Vlan-interface2
ip address 10.1.1.2 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.10
vrrp vrid 1 authentication-mode simple hello
vrrp vrid 1 preempt-mode timer delay 5
#
interface GigabitEthernet1/0/5
port access vlan 2
#
l 虚拟IP地址和接口IP地址必须在同一网段,且为合法的主机地址,不能为全零地址(0.0.0.0)、广播地址(255.255.255.255)、环回地址、非A/B/C类地址和其它非法IP地址(如0.0.0.1),否则备份组无法正常工作。
l 对于同一个VRRP备份组的配置,必须保证备份组虚拟路由器的IP地址个数、每个备份组虚拟路由器的IP地址、定时器间隔时间和认证方式完全一样。
l 如果网络流量过大或者不同的交换机上的定时器差异等因素,会导致Backup设备的定时器异常超时而发生状态转换。对于这种情况,可以通过将VRRP通告报文的发送时间间隔延长和设置抢占延迟时间的办法来解决。
图1-4 VRRP与Track、BFD联动监视Master上行链路配置组网图
l 用户网络中采用VRRP技术进行网关设备的备份,提高可靠性;
l 要求正常情况下,局域网内的主机通过Switch A访问外部网络;当Switch A出现故障或其连接Internet的上行链路出现故障时,Switch B能够快速检测到故障并接替其工作,局域网内的主机改为通过Switch B访问外部网络。
l 在Switch A和Switch B上分别创建VRRP备份组1,配置其虚拟IP地址为192.168.0.10;
l Host A的缺省网关设为192.168.0.10;
l 配置Switch A在备份组1中具有较高的优先级,从而保证正常情况下Switch A被选为Master;
l 在Switch A上配置BFD功能,并创建和BFD会话关联的Track项,当Switch A监听到该Track项状态变为Negative时,Switch A的优先级会自动降低20,使备份组内Switch B的优先级高于Switch A,从而实现主备切换;
l 配置Switch A和Switch B工作在抢占方式,以保证原Master设备故障恢复后,能再次抢占成为Master。为了避免频繁地进行状态切换,配置抢占延迟时间为5秒;
l 为了防止非法用户构造报文攻击备份组,通过简单字符认证方法验证备份组1中的VRRP报文,认证字为hello。
本案例要求Master上行设备支持BFD功能。
表1-3 配置适用的产品与软件版本关系
产品 |
软件版本 |
S7500E系列以太网交换机 |
Release 6600系列,Release 6610系列 |
S7600系列以太网交换机 |
Release 6600系列,Release 6610系列 |
S5800&S5820X系列以太网交换机 |
Release 1110,Release 1211 |
CE3000-32F以太网交换机 |
Release 1211 |
S5500-EI系列以太网交换机 |
Release 2202,Release 2208 |
S5500-EI-D系列以太网交换机 |
Release 2208 |
S3610&S5510系列以太网交换机 |
Release 5306,Release 5309 |
S3500-EA系列以太网交换机 |
Release 5309 |
(1) 按照图1-4配置各接口的IP地址
下面以Switch A Vlan-interface 2为例进行介绍,其它接口的配置过程类似,不再一一赘述。
# 配置Switch A Vlan-interface 2的接口地址。
<SwitchA> system-view
[SwitchA] vlan 2
[SwitchA-vlan2] port GigabitEthernet1/0/5
[SwitchA-vlan2] quit
[SwitchA] interface Vlan-interface 2
[SwitchA-Vlan-interface2] ip address 192.168.0.101 255.255.255.0
[SwitchA-Vlan-interface2] quit
(2) 在Switch A上配置BFD功能
# 配置BFD echo报文的源地址为10.10.10.10。
[SwitchA] bfd echo-source-ip 10.10.10.10
(3) 在Switch A上创建和BFD会话关联的Track项
# 创建和BFD会话关联的Track项1,检测IP地址为1.1.1.2的上行设备是否可达。
[SwitchA] track 1 bfd echo interface vlan-interface 3 remote ip 1.1.1.2 local ip 1.1.1.1
(4) 在Switch A上配置VRRP
# 创建备份组1,配置备份组1的虚拟IP地址为192.168.0.10。
[SwitchA] interface vlan-interface 2
[SwitchA-Vlan-interface2] vrrp vrid 1 virtual-ip 192.168.0.10
# 配置Switch A在备份组1中的优先级为110。
[SwitchA-Vlan-interface2] vrrp vrid 1 priority 110
# 设置Switch A工作在抢占方式,抢占延迟时间为5秒。
[SwitchA-Vlan-interface2] vrrp vrid 1 preempt-mode timer delay 5
# 设置备份组的认证方式为SIMPLE认证,认证字为hello。
[SwitchA-Vlan-interface2] vrrp vrid 1 authentication-mode simple hello
# 配置备份组1监视Track项1的状态,当Track项状态为Negative时,Switch A的优先级降低20。
[SwitchA-Vlan-interface2] vrrp vrid 1 track 1 reduced 20
[SwitchA-Vlan-interface2] return
(5) 在Switch B上配置VRRP
# 创建备份组1,配置备份组1的虚拟IP地址为192.168.0.10。
<SwitchB> system-view
[SwitchB] interface vlan-interface 2
[SwitchB-Vlan-interface2] vrrp vrid 1 virtual-ip 192.168.0.10
# 设置Switch B工作在抢占方式,抢占延迟时间为5秒。
[SwitchB-Vlan-interface2] vrrp vrid 1 preempt-mode timer delay 5
# 设置备份组的认证方式为SIMPLE认证,认证字为hello。
[SwitchB-Vlan-interface2] vrrp vrid 1 authentication-mode simple hello
[SwitchB-Vlan-interface2] return
(6) 配置主机
配置局域网内主机的缺省网关为192.168.0.10,具体配置过程略。
(7) 验证配置结果
# 显示Switch A上备份组的详细信息。
<SwitchA> display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : 192.168.0.10
Virtual MAC : 0000-5e00-0101
Master IP : 192.168.0.101
VRRP Track Information:
Track Object : 1 State : Positive Pri Reduced : 20
# 显示Switch A上Track项1的信息。
<SwitchA> display track 1
Track ID: 1
Status: Positive
Notification delay: Positive 0, Negative 0 (in seconds)
Reference object:
BFD session:
Packet type: Echo
Interface : Vlan-interface2
Remote IP : 1.1.1.2
Local IP : 1.1.1.1
# 显示Switch B上备份组的详细信息。
<SwitchB> display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : 192.168.0.10
Master IP : 192.168.0.101
以上显示信息表示Track项1的状态为Positive时,Switch A为Master,Switch B为Backup。
# 当Switch A监视的上行链路出现故障时,Track项1的状态变为Negative。
<SwitchA> display track 1
Track ID: 1
Status: Negative
Notification delay: Positive 0, Negative 0 (in seconds)
Reference object:
BFD session:
Packet type: Echo
Interface : Vlan-interface2
Remote IP : 1.1.1.2
Local IP : 1.1.1.1
# 查看Switch A上备份组的详细信息。
<SwitchA> display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 110 Running Pri : 90
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : 192.168.0.10
Master IP : 192.168.0.102
VRRP Track Information:
Track Object : 1 State : Negative Pri Reduced : 20
# 显示Switch B上备份组的详细信息。
<SwitchB> display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : 192.168.0.10
Virtual MAC : 0000-5e00-0101
Master IP : 192.168.0.102
以上显示信息表示Switch A通过BFD检测到上行链路不通时,将自己的优先级降低为90,从而保证Switch B抢占成为Master。
l Switch A上的配置
#
bfd echo-source-ip 10.10.10.10
#
vlan 2 to 3
#
interface Vlan-interface2
ip address 192.168.0.101 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.0.10
vrrp vrid 1 priority 110
vrrp vrid 1 authentication-mode simple hello
vrrp vrid 1 preempt-mode timer delay 5
vrrp vrid 1 track 1 reduced 20
#
interface Vlan-interface3
ip address 1.1.1.1 255.255.255.0
#
interface GigabitEthernet1/0/5
port access vlan 2
#
interface GigabitEthernet1/0/6
port access vlan 3
#
track 1 bfd echo interface Vlan-interface3 remote ip 1.1.1.2 local ip 1.1.1.1
#
l Switch B上的配置
#
vlan 2
#
interface Vlan-interface2
ip address 192.168.0.102 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.0.10
vrrp vrid 1 authentication-mode simple hello
vrrp vrid 1 preempt-mode timer delay 5
#
interface GigabitEthernet1/0/5
port access vlan 2
#
l 虚拟IP地址和接口IP地址必须在同一网段,且为合法的主机地址,不能为全零地址(0.0.0.0)、广播地址(255.255.255.255)、环回地址、非A/B/C类地址和其它非法IP地址(如0.0.0.1),否则备份组无法正常工作。
l 对于同一个VRRP备份组的配置,必须保证备份组虚拟路由器的IP地址个数、每个备份组虚拟路由器的IP地址、定时器间隔时间和认证方式完全一样。
l 如果网络流量过大或者不同的交换机上的定时器差异等因素,会导致Backup设备的定时器异常超时而发生状态转换。对于这种情况,可以通过将VRRP通告报文的发送时间间隔延长和设置抢占延迟时间的办法来解决。
l 配置Track与BFD联动时,不要将BFD会话探测的本地地址和远端地址配置为VRRP备份组的虚拟IP地址。
VRRP备份组的Master设备出现故障时,Backup设备若只依赖于VRRP通告报文的超时时间来判断是否应该抢占,切换时间一般在3秒~4秒之间,无法达到秒级以下的切换速度;如果Backup通过BFD检测Master的运行状态,则能够在100ms以内发现Master的故障,立即抢占成为Master,加快切换速度。
图1-5 VRRP与Track、BFD联动实现快速切换配置组网图
l 用户网络中采用VRRP技术进行网关设备的备份,提高可靠性;
l 要求当Switch A正常工作时,局域网内的主机通过Switch A访问外部网络;当Switch A出现故障时,Switch B能够快速检测到故障并接替其工作,局域网内的主机通过Switch B访问外部网络。
l Switch A和Switch B属于虚拟IP地址为192.168.0.10的备份组1,局域网内的主机上设置缺省网关为192.168.0.10;
l 配置Switch A具有较高的优先级,从而保证正常情况下Switch A被选为Master;
l 在Switch B上配置BFD功能,并创建和BFD会话关联的Track项,当Switch B监听到该Track项状态变为Negative时,Switch B快速从Backup切换为Master状态,从而提高切换速度;
l 配置Switch A和Switch B工作在抢占方式,以保证原Master设备故障恢复后,能再次抢占成为Master。为了避免频繁地进行状态切换,配置抢占延迟时间为5秒;
l 为了防止非法用户构造报文攻击备份组,通过简单字符认证方法验证备份组1中的VRRP报文,认证字为hello。
表1-4 配置适用的产品与软件版本关系
产品 |
软件版本 |
S7500E系列以太网交换机 |
Release 6600系列,Release 6610系列 |
S7600系列以太网交换机 |
Release 6600系列,Release 6610系列 |
S5800&S5820X系列以太网交换机 |
Release 1110,Release 1211 |
CE3000-32F以太网交换机 |
Release 1211 |
S5500-EI系列以太网交换机 |
Release 2202,Release 2208 |
S5500-EI-D系列以太网交换机 |
Release 2208 |
S3610&S5510系列以太网交换机 |
Release 5306,Release 5309 |
S3500-EA系列以太网交换机 |
Release 5309 |
(1) 按照图1-5配置各接口的IP地址
下面以Switch A Vlan-interface 2为例进行介绍,其它接口的配置过程类似,不再一一赘述。
# 配置Switch A Vlan-interface 2的接口地址。
<SwitchA> system-view
[SwitchA] vlan 2
[SwitchA-vlan2] port GigabitEthernet1/0/5
[SwitchA-vlan2] quit
[SwitchA] interface Vlan-interface 2
[SwitchA-Vlan-interface2] ip address 192.168.0.101 255.255.255.0
(2) 在Switch A上配置VRRP
# 创建备份组1,并配置备份组1的虚拟IP地址为192.168.0.10。
[SwitchA-Vlan-interface2] vrrp vrid 1 virtual-ip 192.168.0.10
# 配置Switch A在备份组1中的优先级为110。
[SwitchA-Vlan-interface2] vrrp vrid 1 priority 110
# 设置Switch A工作在抢占方式,抢占延迟时间为5秒。
[SwitchA-Vlan-interface2] vrrp vrid 1 preempt-mode timer delay 5
# 设置备份组的认证方式为SIMPLE认证,认证字为hello。
[SwitchA-Vlan-interface2] vrrp vrid 1 authentication-mode simple hello
[SwitchA-Vlan-interface2] return
(3) 在Switch B上配置BFD功能
# 配置BFD echo报文的源地址为10.10.10.10。
<SwitchB> system-view
[SwitchB] bfd echo-source-ip 10.10.10.10
(4) 在Switch B上创建和BFD会话关联的Track项
# 创建和BFD会话关联的Track项1,检测Switch A是否可达。
[SwitchB] track 1 bfd echo interface vlan-interface 2 remote ip 192.168.0.101 local ip 192.168.0.102
(5) 在Switch B上配置VRRP
# 创建备份组1,并配置备份组1的虚拟IP地址为192.168.0.10。
[SwitchB] interface vlan-interface 2
[SwitchB-Vlan-interface2] vrrp vrid 1 virtual-ip 192.168.0.10
# 设置Switch B工作在抢占方式,抢占延迟时间为5秒。
[SwitchB-Vlan-interface2] vrrp vrid 1 preempt-mode timer delay 5
# 设置备份组的认证方式为SIMPLE认证,认证字为hello。
[SwitchB-Vlan-interface2] vrrp vrid 1 authentication-mode simple hello
# 配置备份组1监视Track项1的状态,当Track项状态为Negative时,Switch B快速从Backup切换为Master状态。
[SwitchB-Vlan-interface2] vrrp vrid 1 track 1 switchover
[SwitchB-Vlan-interface2] return
(6) 配置主机
配置局域网内主机的缺省网关为192.168.0.10,具体配置过程略。
(7) 验证配置结果
# 显示Switch A上备份组的详细信息。
<SwitchA> display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : 192.168.0.10
Virtual MAC : 0000-5e00-0101
Master IP : 192.168.0.101
# 显示Switch B上备份组的详细信息。
<SwitchB> display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 100 Ru nning Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : 192.168.0.10
Master IP : 192.168.0.101
VRRP Track Information:
Track Object : 1 State : Positive Switchover
# 显示Switch B上Track项的信息。
<SwitchB> display track 1
Track ID: 1
Status: Positive
Notification delay: Positive 0, Negative 0 (in seconds)
Reference object:
BFD session:
Packet type: Echo
Interface : Vlan-interface2
Remote IP : 192.168.0.101
Local IP : 192.168.0.102
以上显示信息表示Track项状态为Positive时,Switch A为Master,Switch B为Backup。
# 打开Switch B的VRRP状态调试信息开关和BFD事件调试信息开关。
<SwitchB> terminal debugging
<SwitchB> terminal monitor
<SwitchB> debugging vrrp state
<SwitchB> debugging bfd event
# Switch A出现故障时,Switch B上输出如下调试信息。
*Dec 17 14:44:34:142 2008 SwitchB BFD/7/EVENT:Send sess-down Msg, [Src:192.168.0.102,Dst:192.168.0.101,Vlan-interface2,Echo], instance:0, protocol:Track
*Dec 17 14:44:34:144 2008 SwitchB VRRP/7/DebugState: IPv4 Vlan-interface2 | Virtual Router 1 : Backup --> Master reason: The status of the tracked object changed
# 显示Switch B上备份组的详细信息。
<SwitchB> display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : 192.168.0.10
Virtual MAC : 0000-5e00-0101
Master IP : 192.168.0.102
VRRP Track Information:
Track Object : 1 State : Negative Switchover
以上调试信息表示,BFD探测到Switch A出现故障后,立即由Track通知VRRP模块将Switch B的状态切换为Master,不再等待VRRP通告报文的超时时间,从而保证Backup设备能够快速切换为Master。
l Switch A上的配置
#
vlan 2
#
interface Vlan-interface2
ip address 192.168.0.101 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.0.10
vrrp vrid 1 priority 110
vrrp vrid 1 authentication-mode simple hello
vrrp vrid 1 preempt-mode timer delay 5
#
interface GigabitEthernet1/0/5
port access vlan 2
#
l Switch B上的配置
#
bfd echo-source-ip 10.10.10.10
#
vlan 2
#
interface Vlan-interface2
ip address 192.168.0.102 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.0.10
vrrp vrid 1 authentication-mode simple hello
vrrp vrid 1 preempt-mode timer delay 5
vrrp vrid 1 track 1 switchover
#
interface Vlan-interface3
ip address 1.1.1.1 255.255.255.0
#
interface GigabitEthernet1/0/5
port access vlan 2
#
track 1 bfd echo interface vlan-interface 2 remote ip 192.168.0.101 local ip 192.168.0.102
#
l 虚拟IP地址和接口IP地址必须在同一网段,且为合法的主机地址,不能为全零地址(0.0.0.0)、广播地址(255.255.255.255)、环回地址、非A/B/C类地址和其它非法IP地址(如0.0.0.1),否则备份组无法正常工作。
l 对于同一个VRRP备份组的配置,必须保证备份组虚拟路由器的IP地址个数、每个备份组虚拟路由器的IP地址、定时器间隔时间和认证方式完全一样。
l 如果网络流量过大或者不同的交换机上的定时器差异等因素,会导致Backup设备的定时器异常超时而发生状态转换。对于这种情况,可以通过将VRRP通告报文的发送时间间隔延长和设置抢占延迟时间的办法来解决。
l 配置Track与BFD联动时,不要将BFD会话探测的本地地址和远端地址配置为VRRP备份组的虚拟IP地址。
在VRRP标准协议模式中,只有Master设备可以转发报文,Backup设备只能处于监听状态,无法转发报文。通过在设备上创建多个备份组,可以实现不同VLAN数据的负载分担。
在设备上创建多个VRRP备份组,使得该设备在一个VRRP备份组中作为Master,同时在其他的VRRP备份组中作为Backup。
图1-6 多个VRRP备份组负载分担配置组网图
l 用户网络中采用VRRP技术进行网关设备的备份,提高可靠性;
l 要求正常情况下,VLAN2内的主机通过Switch A访问外部网络,VLAN3内的主机通过Switch B访问外部网络;
l 当Switch A或Switch B自身出现故障,或是其连接上行链路的接口出现故障时,主机可以通过另一台设备继续通信,避免通信中断。
l 用户也可以在Master设备上配置VRRP与Track、NQA(或BFD)的联动,监视其上行链路的状态,避免在Master自身工作正常的情况下因Master上行链路故障造成的通信中断,具体配置方法请参见1.3 VRRP与Track联动监视Master上行链路典型配置指导;
l 用户可以在Backup设备上配置VRRP与Track、BFD的联动,监视Master的状态,从而提高主备切换速度,具体配置方法请参见1.4 VRRP与Track、BFD联动实现快速切换典型配置指导。
l 在Switch A和Switch B上分别创建两个VRRP备份组,备份组1的虚拟IP地址为202.38.160.100/25,备份组2的虚拟IP地址为202.38.160.200/25;
l 配置VLAN 2内主机的缺省网关为202.38.160.100/25;VLAN 3内主机的缺省网关为202.38.160.200/25;
l 配置备份组1中Switch A的优先级高于Switch B,备份组2中Switch B的优先级高于Switch A,从而保证正常情况下VLAN 2和VLAN 3内的主机分别通过Switch A和Switch B通信;
l 配置Switch A和Switch B均监视其连接Internet的VLAN接口4的状态,当被监视的接口DOWN掉时,设备的优先级会自动降低30,从而触发主备切换;
l 配置Switch A和Switch B工作在抢占方式,以保证原Master设备故障恢复后,能再次抢占成为Master。为了避免频繁地进行状态切换,配置抢占延迟时间为5秒。
表1-5 配置适用的产品与软件版本关系
产品 |
软件版本 |
S7500E系列以太网交换机 |
Release 6300系列,Release 6600系列,Release 6610系列 |
S7600系列以太网交换机 |
Release 6600系列,Release 6610系列 |
S5800&S5820X系列以太网交换机 |
Release 1110,Release 1211 |
CE3000-32F以太网交换机 |
Release 1211 |
S5810系列以太网交换机 |
Release 1102 |
S5500-EI系列以太网交换机 |
Release 2202,Release 2208 |
S5500-EI-D系列以太网交换机 |
Release 2208 |
S3610&S5510系列以太网交换机 |
Release 5301,Release 5303,Release 5306,Release 5309 |
S3500-EA系列以太网交换机 |
Release 5303,Release 5309 |
(1) 配置Switch A
# 配置VLAN2。
<SwitchA> system-view
[SwitchA] vlan 2
[SwitchA-vlan2] port gigabitethernet 1/0/5
[SwitchA-vlan2] quit
[SwitchA] interface Vlan-interface 2
[SwitchA-Vlan-interface2] ip address 202.38.160.1 255.255.255.128
# 创建一个备份组1,并配置备份组1的虚拟IP地址为202.38.160.100。
[SwitchA-Vlan-interface2] vrrp vrid 1 virtual-ip 202.38.160.100
# 设置Switch A在备份组1中的优先级为110。
[SwitchA-Vlan-interface2] vrrp vrid 1 priority 110
# 设置Switch A工作在抢占方式,抢占延迟时间为5秒。
[SwitchA-Vlan-interface2] vrrp vrid 1 preempt-mode timer delay 5
# 设置监视Switch A连接Internet的VLAN接口4。当被监视的接口DOWN掉时,Switch A的优先级会自动降低30,使备份组内Switch B的优先级高于Switch A,从而实现主备切换。
[SwitchA-Vlan-interface2] vrrp vrid 1 track interface vlan-interface 4 reduced 30
[SwitchA-Vlan-interface2] quit
# 配置VLAN 3。
[SwitchA] vlan 3
[SwitchA-vlan3] port gigabitethernet 1/0/6
[SwitchA-vlan3] quit
[SwitchA] interface vlan-interface 3
[SwitchA-Vlan-interface3] ip address 202.38.160.130 255.255.255.128
# 创建一个备份组2,并配置备份组2的虚拟IP地址为202.38.160.200。
[SwitchA-Vlan-interface3] vrrp vrid 2 virtual-ip 202.38.160.200
# 设置Switch A工作在抢占方式,抢占延迟时间为5秒。
[SwitchA-Vlan-interface3] vrrp vrid 2 preempt-mode timer delay 5
(2) 配置Switch B
# 配置VLAN2。
<SwitchB> system-view
[SwitchB] vlan 2
[SwitchB-vlan2] port gigabitethernet 1/0/5
[SwitchB-vlan2] quit
[SwitchB] interface Vlan-interface 2
[SwitchB-Vlan-interface2] ip address 202.38.160.2 255.255.255.128
# 创建一个备份组1,并配置备份组1的虚拟IP地址为202.38.160.100。
[SwitchB-Vlan-interface2] vrrp vrid 1 virtual-ip 202.38.160.100
# 设置Switch B工作在抢占方式,抢占延迟时间为5秒。
[SwitchB-Vlan-interface2] vrrp vrid 1 preempt-mode timer delay 5
[SwitchB-Vlan-interface2] quit
# 配置VLAN 3。
[SwitchB] vlan 3
[SwitchB-vlan3] port gigabitethernet 1/0/6
[SwitchB-vlan3] quit
[SwitchB] interface vlan-interface 3
[SwitchB-Vlan-interface3] ip address 202.38.160.131 255.255.255.128
# 创建一个备份组2,并配置备份组2的虚拟IP地址为202.38.160.200。
[SwitchB-Vlan-interface3] vrrp vrid 2 virtual-ip 202.38.160.200
# 设置Switch B在备份组2中的优先级为110。
[SwitchB-Vlan-interface3] vrrp vrid 2 priority 110
# 设置Switch B工作在抢占方式,抢占延迟时间为5秒。
[SwitchB-Vlan-interface3] vrrp vrid 2 preempt-mode timer delay 5
# 设置监视Switch B连接Internet的VLAN接口4。当被监视的接口DOWN掉时,Switch B的优先级会自动降低30,使备份组内Switch A的优先级高于Switch B,从而实现主备切换。
[SwitchB-Vlan-interface3] vrrp vrid 2 track interface vlan-interface 4 reduced 30
(3) 配置主机
配置VLAN 2内主机的缺省网关为202.38.160.100/25,VLAN 3内主机的缺省网关为202.38.160.200/25,具体配置过程略。
(4) 验证配置结果
可以通过display vrrp verbose命令查看配置后的结果。
# 显示Switch A上备份组的详细信息。
[SwitchA-Vlan-interface3] display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 2
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 202.38.160.100
Virtual MAC : 0000-5e00-0101
Master IP : 202.38.160.1
Interface Vlan-interface3
VRID : 2 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 202.38.160.200
Master IP : 202.38.160.131
# 显示Switch B上备份组的详细信息。
[SwitchB-Vlan-interface3] display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 2
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 202.38.160.100
Master IP : 202.38.160.1
Interface Vlan-interface3
VRID : 2 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 202.38.160.200
Virtual MAC : 0000-5e00-0102
Master IP : 202.38.160.131
以上显示信息表示在备份组1中Switch A为Master,Switch B为Backup,缺省网关为202.38.160.100/25的主机通过Switch A访问Internet;备份组2中Switch A为Backup,Switch B为Master,缺省网关为202.38.160.200/25的主机通过Switch B访问Internet。
Switch A出现故障后,再次通过display vrrp verbose命令查看Switch B上备份组的详细信息。
# Switch A出现故障后,显示Switch B上备份组1的详细信息。
[SwitchB-Vlan-interface3] display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 2
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 202.38.160.100
Master IP : 202.38.160.2
Interface Vlan-interface3
VRID : 2 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 202.38.160.200
Virtual MAC : 0000-5e00-0102
Master IP : 202.38.160.131
以上显示信息表示Switch A出现故障后,Switch B成为VRRP备份组1的Master,VLAN 2内的主机发送给外网的报文改为通过Switch B转发。
l Switch A上的配置
#
vlan 2 to 3
#
interface Vlan-interface2
ip address 202.38.160.1 255.255.255.128
vrrp vrid 1 virtual-ip 202.38.160.100
vrrp vrid 1 priority 110
vrrp vrid 1 preempt-mode timer delay 5
vrrp vrid 1 track interface vlan-interface 4 reduced 30
#
interface Vlan-interface3
ip address 202.38.160.130 255.255.255.128
vrrp vrid 2 virtual-ip 202.38.160.200
vrrp vrid 2 preempt-mode timer delay 5
#
interface GigabitEthernet1/0/5
port access vlan 2
#
interface GigabitEthernet1/0/6
port access vlan 3
#
l Switch B上的配置
#
vlan 2 to 3
#
interface Vlan-interface2
ip address 202.38.160.2 255.255.255.128
vrrp vrid 1 virtual-ip 202.38.160.100
vrrp vrid 1 preempt-mode timer delay 5
#
interface Vlan-interface3
ip address 202.38.160.131 255.255.255.128
vrrp vrid 2 virtual-ip 202.38.160.200
vrrp vrid 2 priority 110
vrrp vrid 2 preempt-mode timer delay 5
vrrp vrid 2 track interface vlan-interface 4 reduced 30
#
interface GigabitEthernet1/0/5
port access vlan 2
#
interface GigabitEthernet1/0/6
port access vlan 3
#
l 虚拟IP地址和接口IP地址必须在同一网段,且为合法的主机地址,不能为全零地址(0.0.0.0)、广播地址(255.255.255.255)、环回地址、非A/B/C类地址和其它非法IP地址(如0.0.0.1),否则备份组无法正常工作。
l 对于同一个VRRP备份组的配置,必须保证备份组虚拟路由器的IP地址个数、每个备份组虚拟路由器的IP地址、定时器间隔时间和认证方式完全一样。
l 如果网络流量过大或者不同的交换机上的定时器差异等因素,会导致Backup设备的定时器异常超时而发生状态转换。对于这种情况,可以通过将VRRP通告报文的发送时间间隔延长和设置抢占延迟时间的办法来解决。
在图1-7所示的VRRP组网中,如果Master设备的下行链路发生故障,VRRP通告报文将无法到达Backup设备,Backup设备会认为Master设备出现故障,转为Master状态。来自区域A的数据流量将改为沿Switch B到达外网。
可见,在这种组网情况下,下行链路的故障也会造成VRRP备份组的主备切换。
图1-7 VRRP组网图
在数据中心网络中,VRRP一般部署在汇聚层,同时汇聚层设备和核心层设备之间运行动态路由协议,图1-7所示的VRRP组网方式下,下行链路的故障也会造成VRRP备份组的主备切换,引起汇聚层设备和核心层设备之间的路由震荡,为解决这种问题,可以采用图1-8所示VRRP和MSTP混合组网的方式:用VRRP实现网关设备备份,同时用MSTP实现下行链路的链路备份,在下行链路故障发生时,MSTP将会放开阻塞的端口,用户数据改沿备份链路经Backup设备转发至Master设备,仍然从Master设备转发至外网,避免了下行链路故障造成的VRRP主备切换。
图1-8 VRRP与MSTP混合组网示意图
VRRP+MSTP组网与VRRP单独组网相比,各有优缺点,请用户根据实际需要进行选择。
VRRP+MSTP组网与VRRP单独组网相比的优点:
l 可以防御多种链路故障。只要两条上行链路和两条下行链路中各有一条可达链路,即可保证通信不会中断。
l 可以避免链路故障、网关正常工作时错误地进行Master和Backup状态切换。
l 扩展性好,同一个VLAN下部署多台L2交换机时,不会引入环路。
VRRP+MSTP组网与VRRP单独组网相比的缺点:
l 网络规模大时,MSTP计算时间长,流量中断时间长。
图1-9 VRRP与MSTP混合组网图
l 用户网络采用VRRP技术进行网关设备的备份,提高网络可靠性;
l 要求在网关设备工作正常时,区域A用户通过网关设备Switch A进行数据转发;区域B用户通过网关设备Switch B进行数据转发,实现流量的负载分担;
l 当一台网关设备出现故障时,局域网内的主机仍然可以通过另一台网关设备访问外部网络;
l 局域网内进行二层链路的冗余备份,保证网关设备下行链路故障时不影响VRRP的工作状态。
用户可以将Switch A和Switch B之间的直连链路配置为聚合链路,以提高可靠性。
l Switch A、Switch B上分别创建两个VRRP备份组;
l 二层交换机Switch C连接的主机都将备份组1作为网关,二层交换机Switch D连接的主机都将备份组2作为网关;
l 配置Switch A在备份组1内具有更高的优先级,即正常情况下Switch A作为备份组1的Master设备;配置Switch B在备份组2内具有更高的优先级,即正常情况下Switch B作为备份组2的Master设备;从而实现数据的负载分担;
l Switch A、Switch B和二层交换机之间启用MSTP多实例,并使得各实例中均以Master设备为根桥、Backup设备为备份根桥,保证正常情况下阻塞Switch C和Switch D的GE1/0/2端口(如图1-9所示)。
表1-6 配置适用的产品与软件版本关系
产品 |
软件版本 |
S7500E系列以太网交换机 |
Release 6300系列,Release 6600系列,Release 6610系列 |
S7600系列以太网交换机 |
Release 6600系列,Release 6610系列 |
S5800&S5820X系列以太网交换机 |
Release 1110,Release 1211 |
CE3000-32F以太网交换机 |
Release 1211 |
S5810系列以太网交换机 |
Release 1102 |
S5500-EI系列以太网交换机 |
Release 2202,Release 2208 |
S5500-EI-D系列以太网交换机 |
Release 2208 |
S3610&S5510系列以太网交换机 |
Release 5301,Release 5303,Release 5306,Release 5309 |
S3500-EA系列以太网交换机 |
Release 5303,Release 5309 |
(1) 配置Switch A
# 配置GE1/0/1属于VLAN101、GE1/0/3属于VLAN102、GE1/0/2属于VLAN4092,配置两个网关设备间采用trunk口直连,允许VLAN101和102的报文通过。
<SwitchA> system-view
[SwitchA] vlan 101
[SwitchA-vlan101] port Gigabitethernet 1/0/1
[SwitchA-vlan101] quit
[SwitchA] vlan 102
[SwitchA-vlan102] port Gigabitethernet 1/0/3
[SwitchA-vlan102] quit
[SwitchA] vlan 4092
[SwitchA-vlan4092] port Gigabitethernet 1/0/2
[SwitchA-vlan4092] quit
[SwitchA] interface GigabitEthernet1/0/4
[SwitchA-GigabitEthernet1/0/4] port link-type trunk
[SwitchA-GigabitEthernet1/0/4] undo port trunk permit vlan 1
[SwitchA-GigabitEthernet1/0/4] port trunk permit vlan 101 to 102
[SwitchA-GigabitEthernet1/0/4] port trunk pvid vlan 101
[SwitchA-GigabitEthernet1/0/4] quit
# 配置上行接口IP地址。
[SwitchA] interface vlan-interface 4092
[SwitchA-Vlan-interface4092] ip address 10.1.1.2 24
# 创建VRRP备份组1,配置备份组1优先级为110。
[SwitchA] interface vlan-interface 101
[SwitchA-Vlan-interface101] ip address 10.10.101.2 24
[SwitchA-Vlan-interface101] vrrp vrid 1 virtual-ip 10.10.101.1
[SwitchA-Vlan-interface101] vrrp vrid 1 priority 110
# 配置VRRP备份组1监视上行接口。
[SwitchA-Vlan-interface101] vrrp vrid 1 track interface Vlan-interface4092 reduced 20
[SwitchA-Vlan-interface101] quit
# 创建VRRP备份组2。
[SwitchA] interface vlan-interface 102
[SwitchA-Vlan-interface102] ip address 10.10.102.2 24
[SwitchA-Vlan-interface102] vrrp vrid 1 virtual-ip 10.10.102.1
[SwitchA–Vlan-interface102] quit
# 配置MSTP。
[SwitchA] stp region-configuration
[SwitchA-mst-region] region-name vrrp
[SwitchA-mst-region] instance 1 vlan 101
[SwitchA-mst-region] instance 2 vlan 102
[SwitchA-mst-region] active region-configuration
[SwitchA-mst-region] quit
[SwitchA] stp instance 1 root primary
[SwitchA] stp instance 2 root secondary
[SwitchA] stp enable
(2) 配置Switch B
# 配置GE1/0/1属于VLAN101、GE1/0/3属于VLAN102、GE1/0/2属于VLAN4093,配置两个网关设备间采用trunk口直连,允许VLAN101和102的报文通过。
<SwitchB> system-view
[SwitchB] vlan 101
[SwitchB-vlan101] port Gigabitethernet 1/0/1
[SwitchB-vlan101] quit
[SwitchB] vlan 102
[SwitchB-vlan102] port Gigabitethernet 1/0/3
[SwitchB-vlan102] quit
[SwitchB] vlan 4093
[SwitchB-vlan4093] port Gigabitethernet 1/0/2
[SwitchB-vlan4093] quit
[SwitchB] interface GigabitEthernet1/0/4
[SwitchB-GigabitEthernet1/0/4] port link-type trunk
[SwitchB-GigabitEthernet1/0/4] undo port trunk permit vlan 1
[SwitchB-GigabitEthernet1/0/4] port trunk permit vlan 101 to 102
[SwitchB-GigabitEthernet1/0/4] port trunk pvid vlan 101
[SwitchB-GigabitEthernet1/0/4] quit
# 配置上行接口IP地址。
[SwitchB] interface vlan-interface 4093
[SwitchB-Vlan-interface4093] ip address 10.1.2.2 24
# 创建VRRP备份组1。
[SwitchB] interface vlan-interface 101
[SwitchB-Vlan-interface101] ip address 10.10.101.3 24
[SwitchB-Vlan-interface101] vrrp vrid 1 virtual-ip 10.10.101.1
[SwitchB–Vlan-interface101] quit
# 创建VRRP备份组2,配置备份组2优先级为110。
[SwitchB] interface vlan-interface 102
[SwitchB-Vlan-interface102] ip address 10.10.102.3 24
[SwitchB-Vlan-interface102] vrrp vrid 1 virtual-ip 10.10.102.1
[SwitchB-Vlan-interface102] vrrp vrid 1 priority 110
# 配置VRRP备份组2监视上行接口。
[SwitchB-Vlan-interface102] vrrp vrid 1 track interface Vlan-interface4093 reduced 20
[SwitchB-Vlan-interface102] quit
# 配置MSTP。
[SwitchB] stp region-configuration
[SwitchB-mst-region] region-name vrrp
[SwitchB-mst-region] instance 1 vlan 101
[SwitchB-mst-region] instance 2 vlan 102
[SwitchB-mst-region] active region-configuration
[SwitchB-mst-region] quit
[SwitchB] stp instance 2 root primary
[SwitchB] stp instance 1 root secondary
[SwitchB] stp enable
(3) 配置Switch C
# 配置VLAN101。
<SwitchC> system-view
[SwitchC] vlan 101
[SwitchC-vlan101] port Gigabitethernet 1/0/1 to Gigabitethernet 1/0/2
[SwitchC-vlan101] quit
# 配置MSTP。
[SwitchC] stp region-configuration
[SwitchC-mst-region] region-name vrrp
[SwitchC-mst-region] instance 1 vlan 101
[SwitchC-mst-region] instance 2 vlan 102
[SwitchC-mst-region] active region-configuration
[SwitchC-mst-region] quit
[SwitchC] stp enable
(4) 配置Switch D
# 配置VLAN102。
<SwitchD> system-view
[SwitchD] vlan 102
[SwitchD-vlan102] port Gigabitethernet 1/0/1 to Gigabitethernet 1/0/2
[SwitchD-vlan102] quit
# 配置MSTP。
[SwitchD] stp region-configuration
[SwitchD-mst-region] region-name vrrp
[SwitchD-mst-region] instance 1 vlan 101
[SwitchD-mst-region] instance 2 vlan 102
[SwitchD-mst-region] active region-configuration
[SwitchD-mst-region] quit
[SwitchD] stp enable
(5) 配置主机
配置区域A内主机的缺省网关为10.10.101.1,区域B内主机的缺省网关为10.10.102.1,具体配置过程略。
(6) 验证配置结果
完成配置后用户可以使用display vrrp verbose命令查看备份组的详细信息;同时可以使用display stp brief命令查看各设备上生成树的简要信息。
l Switch A上的配置
#
vlan 101 to 102
#
vlan 4092
#
stp instance 1 root primary
stp instance 2 root secondary
stp enable
stp region-configuration
region-name vrrp
instance 1 vlan 101
instance 2 vlan 102
active region-configuration
#
interface Vlan-interface101
ip address 10.10.101.2 255.255.255.0
vrrp vrid 1 virtual-ip 10.10.101.1
vrrp vrid 1 priority 110
vrrp vrid 1 track interface Vlan-interface4092 reduced 20
#
interface Vlan-interface102
ip address 10.10.102.2 255.255.255.0
vrrp vrid 1 virtual-ip 10.10.102.1
#
interface Vlan-interface4092
ip address 10.1.1.2 255.255.255.0
#
interface GigabitEthernet1/0/1
port access vlan 101
#
interface GigabitEthernet1/0/2
port access vlan 4092
stp disable
#
interface GigabitEthernet1/0/3
port access vlan 102
#
interface GigabitEthernet1/0/4
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 101 to 102
port trunk pvid vlan 101
#
l Switch B上的配置
#
vlan 101 to 102
#
vlan 4093
#
stp instance 1 root secondary
stp instance 2 root primary
stp enable
stp region-configuration
region-name vrrp
instance 1 vlan 101
instance 2 vlan 102
active region-configuration
#
interface Vlan-interface101
ip address 10.10.101.3 255.255.255.0
vrrp vrid 1 virtual-ip 10.10.101.1
#
interface Vlan-interface102
ip address 10.10.102.3 255.255.255.0
vrrp vrid 1 virtual-ip 10.10.102.1
vrrp vrid 1 priority 110
vrrp vrid 1 track interface Vlan-interface4093 reduced 20
#
interface Vlan-interface4093
ip address 10.1.2.2 255.255.255.0
#
interface GigabitEthernet1/0/1
port access vlan 101
#
interface GigabitEthernet1/0/2
port access vlan 4093
stp disable
#
interface GigabitEthernet1/0/3
port access vlan 102
#
interface GigabitEthernet1/0/4
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 101 to 102
port trunk pvid vlan 101
#
l Switch C上的配置
#
vlan 101
#
stp enable
stp region-configuration
region-name vrrp
instance 1 vlan 101
instance 2 vlan 102
active region-configuration
#
interface GigabitEthernet1/0/1
port access vlan 101
#
interface GigabitEthernet1/0/2
port access vlan 101
#
l Switch D上的配置
#
vlan 102
#
stp enable
stp region-configuration
region-name vrrp
instance 1 vlan 101
instance 2 vlan 102
active region-configuration
#
interface GigabitEthernet1/0/1
port access vlan 102
#
interface GigabitEthernet1/0/2
port access vlan 102
#
l 虚拟IP地址和接口IP地址必须在同一网段,且为合法的主机地址,不能为全零地址(0.0.0.0)、广播地址(255.255.255.255)、环回地址、非A/B/C类地址和其它非法IP地址(如0.0.0.1),否则备份组无法正常工作。
l 对于同一个VRRP备份组的配置,必须保证备份组虚拟路由器的IP地址个数、每个备份组虚拟路由器的IP地址、定时器间隔时间和认证方式完全一样。
l 如果网络流量过大或者不同的交换机上的定时器差异等因素,会导致Backup设备的定时器异常超时而发生状态转换。对于这种情况,可以通过将VRRP通告报文的发送时间间隔延长和设置抢占延迟时间的办法来解决。
在VRRP标准协议模式中,只有Master设备可以转发报文,Backup设备处于监听状态,无法转发报文。虽然创建多个备份组可以实现多个路由器之间的负载分担,但是局域网内的主机需要设置不同的网关,增加了配置的复杂性。
VRRP负载均衡模式在VRRP提供的虚拟网关冗余备份功能基础上,增加了负载均衡功能。其实现原理为:将一个虚拟IP地址与多个虚拟MAC地址对应,VRRP备份组中的每个路由器都对应一个虚拟MAC地址;使用不同的虚拟MAC地址应答主机的ARP请求,从而使得不同主机的流量发送到不同的路由器,备份组中的每个路由器都能转发流量。
在VRRP负载均衡模式中,只需创建一个备份组,就可以实现备份组中多个路由器之间的负载分担,避免了VRRP备份组中Backup设备始终处于空闲状态、网络资源利用率不高的问题。
l VRRP负载均衡模式以VRRP标准协议模式为基础,VRRP标准协议模式中的工作机制(如Master设备的选举、抢占、监视功能等),VRRP负载均衡模式均支持。
l VRRP负载均衡模式下,Backup设备也可以转发数据,因此在配置监视Master上行接口状态功能时,需要使用vrrp vrid virtual-router-id weight track track-entry-number [ reduced weight-reduced ]命令,降低上行接口故障设备上虚拟转发器的权重。配置该命令后,当Track项状态为Negative或Invalid时,路由器上所有虚拟转发器的权重都将降低指定的数额(weight-reduced);被监视的Track项状态由Negative或Invalid变为Positive后,路由器中所有虚拟转发器的权重会自动恢复。
图1-10 VRRP负载均衡模式配置组网图
l 要求通过一个VRRP备份组实现负载分担,充分利用网关资源;
l 要求正常情况下,Switch A用作Master设备;
l 要求在Master和Backup设备上行接口出现故障时,VRRP能够监测到该故障,禁止数据经此设备进行转发,避免通信中断。
l 在Switch A、Switch B和Switch C上分别创建VRRP备份组1,其虚拟IP地址为10.1.1.1/24;
l 10.1.1.0/24网段内主机的缺省网关均设为10.1.1.1/24;
l 配置备份组1工作在负载均衡模式,通过一个备份组实现负载分担;
l 配置VRRP备份组1中Switch A的优先级高于Switch B,Switch B的优先级高于Switch C;
l 配置Switch A工作在抢占方式,以保证Switch A故障恢复后,能再次抢占成为Master,即只要Switch A正常工作,Switch A就会成为Master。为了避免频繁地进行状态切换,配置抢占延迟时间为5秒;
l 在Switch A、Switch B和Switch C上配置虚拟转发器通过Track项监视上行接口(VLAN接口3)的状态。当上行接口出现故障时,降低该接口所在设备虚拟转发器的权重,以便其他设备接管该设备的转发任务。
表1-7 配置适用的产品与软件版本关系
产品 |
软件版本 |
S5800&S5820X系列以太网交换机 |
Release 1110,Release 1211 |
CE3000-32F以太网交换机 |
Release 1211 |
S5500-EI系列以太网交换机 |
Release 2208 |
S5500-EI-D系列以太网交换机 |
Release 2208 |
# 配置VLAN2。
<SwitchA> system-view
[SwitchA] vlan 2
[SwitchA-vlan2] port gigabitethernet 1/0/5
[SwitchA-vlan2] quit
# 配置VRRP工作在负载均衡模式。
[SwitchA] vrrp mode load-balance
# 创建备份组1,并配置备份组1的虚拟IP地址为10.1.1.1。
[SwitchA] interface vlan-interface 2
[SwitchA-Vlan-interface2] ip address 10.1.1.2 24
[SwitchA-Vlan-interface2] vrrp vrid 1 virtual-ip 10.1.1.1
# 配置Switch A在备份组1中的优先级为120,高于Switch B的优先级110和Switch C的优先级100,以保证Switch A成为Master。
[SwitchA-Vlan-interface2] vrrp vrid 1 priority 120
# 配置Switch A工作在抢占方式,以保证Switch A故障恢复后,能再次抢占成为Master,即只要Switch A正常工作, Switch A就会成为Master。为了避免频繁地进行状态切换,配置抢占延迟时间为5秒。
[SwitchA-Vlan-interface2] vrrp vrid 1 preempt-mode timer delay 5
[SwitchA-Vlan-interface2] quit
# 创建和VLAN接口3物理状态关联的Track项1。如果Track项的状态为Negative,则说明Switch A的上行接口出现故障。
[SwitchA] track 1 interface vlan-interface 3
# 配置虚拟转发器监视Track项1。Track项的状态为Negative时,降低Switch A上虚拟转发器的权重,使其低于失效下限10,即权重降低的数额大于245,以便其他设备接替Switch A的转发任务。本例中,配置虚拟转发器权重降低数额为250。
[SwitchA] interface vlan-interface 2
[SwitchA-Vlan-interface2] vrrp vrid 1 weight track 1 reduced 250
(2) 配置Switch B
# 配置VLAN2。
<SwitchB> system-view
[SwitchB] vlan 2
[SwitchB-vlan2] port gigabitethernet 1/0/5
[SwitchB-vlan2] quit
# 配置VRRP工作在负载均衡模式。
[SwitchB] vrrp mode load-balance
# 创建备份组1,并配置备份组1的虚拟IP地址为10.1.1.1。
[SwitchB] interface vlan-interface 2
[SwitchB-Vlan-interface2] ip address 10.1.1.3 24
[SwitchB-Vlan-interface2] vrrp vrid 1 virtual-ip 10.1.1.1
# 配置Swtich B在备份组1中的优先级为110,高于Switch C的优先级,以保证Switch A出现故障时,Switch B成为Master。
[SwitchB-Vlan-interface2] vrrp vrid 1 priority 110
# 配置Switch B工作在抢占方式,抢占延迟时间为5秒。
[SwitchB-Vlan-interface2] vrrp vrid 1 preempt-mode timer delay 5
[SwitchB-Vlan-interface2] quit
# 创建和VLAN接口3物理状态关联的Track项1。如果Track项的状态为Negative,则说明Switch B的上行接口出现故障。
[SwitchB] track 1 interface vlan-interface 3
# 配置虚拟转发器监视Track项1。Track项的状态为Negative时,降低Switch B上虚拟转发器的权重,使其低于失效下限10,即权重降低的数额大于245,以便其他设备接替Switch B的转发任务。本例中,配置虚拟转发器权重降低数额为250。
[SwitchB] interface vlan-interface 2
[SwitchB-Vlan-interface2] vrrp vrid 1 weight track 1 reduced 250
(3) 配置Switch C
# 配置VLAN2。
<SwitchC> system-view
[SwitchC] vlan 2
[SwitchC-vlan2] port gigabitethernet 1/0/5
[SwitchC-vlan2] quit
# 配置VRRP工作在负载均衡模式。
[SwitchC] vrrp mode load-balance
# 创建备份组1,并配置备份组1的虚拟IP地址为10.1.1.1。
[SwitchC] interface vlan-interface 2
[SwitchC-Vlan-interface2] ip address 10.1.1.4 24
[SwitchC-Vlan-interface2] vrrp vrid 1 virtual-ip 10.1.1.1
# 配置Switch C工作在抢占方式,抢占延迟时间为5秒。
[SwitchC-Vlan-interface2] vrrp vrid 1 preempt-mode timer delay 5
[SwitchC-Vlan-interface2] quit
# 创建和VLAN接口3物理状态关联的Track项1。如果Track项的状态为Negative,则说明Switch C的上行接口出现故障。
[SwitchC] track 1 interface vlan-interface 3
# 配置虚拟转发器监视Track项1。Track项的状态为Negative时,降低Switch C上虚拟转发器的权重,使其低于失效下限10,即权重降低的数额大于245,以便其他设备接替Switch C的转发任务。本例中,配置虚拟转发器权重降低数额为250。
[SwitchC] interface vlan-interface 2
[SwitchC-Vlan-interface2] vrrp vrid 1 weight track 1 reduced 250
(4) 验证配置结果
配置完成后,在Host A上可以ping通外网。通过display vrrp verbose命令查看配置后的结果。
# 显示Switch A上备份组1的详细信息。
[SwitchA-Vlan-interface2] display vrrp verbose
IPv4 Standby Information:
Run Mode : Load Balance
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 120 Running Pri : 120
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.1.1.1
Member IP List : 10.1.1.2 (Local, Master)
10.1.1.3 (Backup)
10.1.1.4 (Backup)
Forwarder Information: 3 Forwarders 1 Active
Config Weight : 255
Running Weight : 255
Forwarder 01
State : Active
Virtual MAC : 000f-e2ff-0011 (Owner)
Owner ID : 0000-5e01-1101
Priority : 255
Active : local
Forwarder 02
State : Listening
Virtual MAC : 000f-e2ff-0012 (Learnt)
Owner ID : 0000-5e01-1103
Priority : 127
Active : 10.1.1.3
Forwarder 03
State : Listening
Virtual MAC : 000f-e2ff-0013 (Learnt)
Owner ID : 0000-5e01-1105
Priority : 127
Active : 10.1.1.4
Forwarder Weight Track Information:
Track Object : 1 State : Positive Weight Reduced : 250
# 显示Switch B上备份组1的详细信息。
[SwitchB-Vlan-interface2] display vrrp verbose
IPv4 Standby Information:
Run Mode : Load Balance
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.1.1.1
Member IP List : 10.1.1.3 (Local, Backup)
10.1.1.2 (Master)
10.1.1.4 (Backup)
Forwarder Information: 3 Forwarders 1 Active
Config Weight : 255
Running Weight : 255
Forwarder 01
State : Listening
Virtual MAC : 000f-e2ff-0011 (Learnt)
Owner ID : 0000-5e01-1101
Priority : 127
Active : 10.1.1.2
Forwarder 02
State : Active
Virtual MAC : 000f-e2ff-0012 (Owner)
Owner ID : 0000-5e01-1103
Priority : 255
Active : local
Forwarder 03
State : Listening
Virtual MAC : 000f-e2ff-0013 (Learnt)
Owner ID : 0000-5e01-1105
Priority : 127
Active : 10.1.1.4
Forwarder Weight Track Information:
Track Object : 1 State : Positive Weight Reduced : 250
# 显示Switch C上备份组1的详细信息。
[SwitchC-Vlan-interface2] display vrrp verbose
IPv4 Standby Information:
Run Mode : Load Balance
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.1.1.1
Member IP List : 10.1.1.4 (Local, Backup)
10.1.1.2 (Master)
10.1.1.3 (Backup)
Forwarder Information: 3 Forwarders 1 Active
Config Weight : 255
Running Weight : 255
Forwarder 01
State : Listening
Virtual MAC : 000f-e2ff-0011 (Learnt)
Owner ID : 0000-5e01-1101
Priority : 127
Active : 10.1.1.2
Forwarder 02
State : Listening
Virtual MAC : 000f-e2ff-0012 (Learnt)
Owner ID : 0000-5e01-1103
Priority : 127
Active : 10.1.1.3
Forwarder 03
State : Active
Virtual MAC : 000f-e2ff-0013 (Owner)
Owner ID : 0000-5e01-1105
Priority : 255
Active : local
Forwarder Weight Track Information:
Track Object : 1 State : Positive Weight Reduced : 250
以上显示信息表示在备份组1中Switch A为Master,Switch B和Switch C 为Backup。Switch A、Switch B和Switch C上各自存在一个AVF,并存在作为备份的两个LVF。
# 当Switch A的上行接口(VLAN接口3)出现故障后,通过display vrrp verbose命令查看Switch A上备份组的详细信息。
[SwitchA-Vlan-interface2] display vrrp verbose
IPv4 Standby Information:
Run Mode : Load Balance
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 120 Running Pri : 120
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.1.1.1
Member IP List : 10.1.1.2 (Local, Master)
10.1.1.3 (Backup)
10.1.1.4 (Backup)
Forwarder Information: 3 Forwarders 0 Active
Config Weight : 255
Running Weight : 5
Forwarder 01
State : Initialize
Virtual MAC : 000f-e2ff-0011 (Owner)
Owner ID : 0000-5e01-1101
Priority : 0
Active : 10.1.1.4
Forwarder 02
State : Initialize
Virtual MAC : 000f-e2ff-0012 (Learnt)
Owner ID : 0000-5e01-1103
Priority : 0
Active : 10.1.1.3
Forwarder 03
State : Initialize
Virtual MAC : 000f-e2ff-0013 (Learnt)
Owner ID : 0000-5e01-1105
Priority : 0
Active : 10.1.1.4
Forwarder Weight Track Information:
Track Object : 1 State : Negative Weight Reduced : 250
# 通过display vrrp verbose命令查看Switch C上备份组的详细信息。
[SwitchC-Vlan-interface2] display vrrp verbose
IPv4 Standby Information:
Run Mode : Load Balance
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.1.1.1
Member IP List : 10.1.1.4 (Local, Backup)
10.1.1.2 (Master)
10.1.1.3 (Backup)
Forwarder Information: 3 Forwarders 2 Active
Config Weight : 255
Running Weight : 255
Forwarder 01
State : Active
Virtual MAC : 000f-e2ff-0011 (Take Over)
Owner ID : 0000-5e01-1101
Priority : 85
Active : local
Redirect Time : 93 secs
Time-out Time : 1293 secs
Forwarder 02
State : Listening
Virtual MAC : 000f-e2ff-0012 (Learnt)
Owner ID : 0000-5e01-1103
Priority : 85
Active : 10.1.1.3
Forwarder 03
State : Active
Virtual MAC : 000f-e2ff-0013 (Owner)
Owner ID : 0000-5e01-1105
Priority : 255
Active : local
Forwarder Weight Track Information:
Track Object : 1 State : Positive Weight Reduced : 250
以上显示信息表示Switch A的上行接口出现故障后,Switch A上虚拟转发器的权重降低为5,低于失效下限。Switch A上所有虚拟转发器的状态均变为Initialized,不能再用于转发。Switch C成为虚拟MAC地址000f-e2ff-0011对应虚拟转发器的AVF,接管Switch A的转发任务。
# Timeout Timer超时后(约1800秒后),查看Switch C上备份组的详细信息。
[SwitchC-Vlan-interface2] display vrrp verbose
IPv4 Standby Information:
Run Mode : Load Balance
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.1.1.1
Member IP List : 10.1.1.4 (Local, Backup)
10.1.1.2 (Master)
10.1.1.3 (Backup)
Forwarder Information: 2 Forwarders 1 Active
Config Weight : 255
Running Weight : 255
Forwarder 02
State : Listening
Virtual MAC : 000f-e2ff-0012 (Learnt)
Owner ID : 0000-5e01-1103
Priority : 127
Active : 10.1.1.3
Forwarder 03
State : Active
Virtual MAC : 000f-e2ff-0013 (Owner)
Owner ID : 0000-5e01-1105
Priority : 255
Active : local
Forwarder Weight Track Information:
Track Object : 1 State : Positive Weight Reduced : 250
以上显示信息表示,Timeout Timer超时后,删除虚拟MAC地址000f-e2ff-0011对应的虚拟转发器,不再转发目的MAC地址为该MAC的报文。
# Switch A出现故障后,通过display vrrp verbose命令查看Switch B上备份组的详细信息。
[SwitchB-Vlan-interface2] display vrrp verbose
IPv4 Standby Information:
Run Mode : Load Balance
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.1.1.1
Member IP List : 10.1.1.3 (Local, Master)
10.1.1.4 (Backup)
Forwarder Information: 2 Forwarders 1 Active
Config Weight : 255
Running Weight : 255
Forwarder 02
State : Active
Virtual MAC : 000f-e2ff-0012 (Owner)
Owner ID : 0000-5e01-1103
Priority : 255
Active : local
Forwarder 03
State : Listening
Virtual MAC : 000f-e2ff-0013 (Learnt)
Owner ID : 0000-5e01-1105
Priority : 127
Active : 10.1.1.4
Forwarder Weight Track Information:
Track Object : 1 State : Positive Weight Reduced : 250
以上显示信息表示Switch A出现故障后,Switch B的优先级高于Switch C,将抢占成为Master。
l Switch A上的配置
#
vrrp mode load-balance
#
vlan 2
#
interface Vlan-interface2
ip address 10.1.1.2 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.1
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 5
vrrp vrid 1 weight track 1 reduced 250
#
interface GigabitEthernet1/0/5
port access vlan 2
#
track 1 interface vlan-interface 3
#
l Switch B上的配置
vrrp mode load-balance
#
vlan 2
#
interface Vlan-interface2
ip address 10.1.1.3 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.1
vrrp vrid 1 priority 110
vrrp vrid 1 preempt-mode timer delay 5
vrrp vrid 1 weight track 1 reduced 250
#
interface GigabitEthernet1/0/5
port access vlan 2
#
track 1 interface vlan-interface 3
#
l Switch C上的配置
#
vrrp mode load-balance
#
vlan 2
#
interface Vlan-interface2
ip address 10.1.1.4 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.1
vrrp vrid 1 preempt-mode timer delay 5
vrrp vrid 1 weight track 1 reduced 250
#
interface GigabitEthernet1/0/5
port access vlan 2
#
track 1 interface vlan-interface 3
#
l VRRP工作在负载均衡模式时,虚拟IP地址不能与VRRP备份组中路由器的接口IP地址相同,即负载均衡模式的VRRP备份组中不能存在IP地址拥有者。
l 缺省情况下,虚拟转发器的权重为255;虚拟转发器的失效下限为10。VF Owner的权重高于或等于失效下限时,它的优先级始终为255,不会根据虚拟转发器的权重改变。因此只有配置的权重降低数额能够保证监视的上行链路出现故障时VF Owner的权重低于失效下限,其他的虚拟转发器才能接替VF Owner成为AVF。
l 虚拟IP地址和接口IP地址必须在同一网段,且为合法的主机地址,不能为全零地址(0.0.0.0)、广播地址(255.255.255.255)、环回地址、非A/B/C类地址和其它非法IP地址(如0.0.0.1),否则备份组无法正常工作。
l 对于同一个VRRP备份组的配置,必须保证备份组虚拟路由器的IP地址个数、每个备份组虚拟路由器的IP地址、定时器间隔时间和认证方式完全一样。
l 如果网络流量过大或者不同的交换机上的定时器差异等因素,会导致Backup设备的定时器异常超时而发生状态转换。对于这种情况,可以通过将VRRP通告报文的发送时间间隔延长和设置抢占延迟时间的办法来解决。
VRRP协议的实现有VRRPv2和VRRPv3两个版本。其中,VRRPv2基于IPv4,VRRPv3基于IPv6。两个版本的VRRP在功能实现上并没有区别,只是在IPv4设备上和IPv6设备上使用的命令不同。
在VRRP标准协议模式下,借助VRRPv3单备份组组网,使用两台或多台交换机组成一个虚拟备份组,负责提供两条或多条通往外部网络的稳定的链路,避免备份组内的单台或多台交换机发生故障而引起的通信中断。VRRP标准协议模式下业务仅由Master设备承担。当Master设备出现故障时,才会由选举出来的Backup设备接替它工作。
图2-1 VRRPv3单备份组配置组网图
l 用户IPv6网络中采用VRRPv3技术进行网关设备的备份,提高可靠性;
l 要求正常情况下,局域网内的主机通过Switch A访问外部网络;当Switch A出现故障或其连接Internet的VLAN接口3不可用时,Switch B能够快速检测到故障并接替其工作,局域网内的主机改为通过Switch B访问外部网络。
l 在Switch A和Switch B上分别创建VRRP备份组1,配置其虚拟IPv6地址为1::10/64和FE80::10;
l Host A的缺省网关设为1::10/64;
l 配置Switch A在备份组1中具有较高的优先级,从而保证正常情况下Switch A被选为Master设备;
l 配置Switch A工作在抢占方式,以保证Switch A故障恢复后,能再次抢占成为Master。为了避免频繁地进行状态切换,配置抢占延迟时间为5秒。
l 配置Switch A监视连接Internet的VLAN接口3的状态,当被监视的接口DOWN掉时,Switch A的优先级会自动降低30,使备份组内Switch B的优先级高于Switch A,从而实现主备切换。
l 为了防止非法用户构造报文攻击备份组,通过简单字符认证方法验证备份组1中的VRRP报文,认证字为hello。
表2-1 配置适用的产品与软件版本关系
产品 |
软件版本 |
S7500E系列以太网交换机 |
Release 6300系列,Release 6600系列,Release 6610系列 |
S7600系列以太网交换机 |
Release 6600系列,Release 6610系列 |
S5800&S5820X系列以太网交换机 |
Release 1110,Release 1211 |
CE3000-32F以太网交换机 |
Release 1211 |
S5810系列以太网交换机 |
Release 1102 |
S5500-EI系列以太网交换机 |
Release 2202,Release 2208 |
S5500-EI-D系列以太网交换机 |
Release 2208 |
S3610&S5510系列以太网交换机 |
Release 5301,Release 5303,Release 5306,Release 5309 |
S3500-EA系列以太网交换机 |
Release 5303,Release 5309 |
对于S3610/S5510系列以太网交换机,在使能IPv6功能之前,必须先将设备运行模式切换到IPv4/IPv6双协议栈模式,即执行switch-mode dual-ipv4-ipv6命令;否则,即使使能IPv6,设备也不支持IPv6报文的转发。另外需要注意的是,执行switch-mode命令切换的协议栈只有在重启设备后才能生效。
(1) 配置Switch A
# 全局使能IPv6。
<SwitchA> system-view
[SwitchA] ipv6
# 配置VLAN3。
[SwitchA] vlan 3
[SwitchA-vlan3] port gigabitethernet 1/0/3
[SwitchA-vlan3] quit
[SwitchA] interface vlan-interface 3
[SwitchA-Vlan-interface3] ipv6 address 2003::2 64
[SwitchA-Vlan-interface3] quit
# 配置VLAN2。
[SwitchA] vlan 2
[SwitchA-vlan2] port gigabitethernet 1/0/5
[SwitchA-vlan2] quit
[SwitchA] interface vlan-interface 2
[SwitchA-Vlan-interface2] ipv6 address fe80::1 link-local
[SwitchA-Vlan-interface2] ipv6 address 1::1 64
# 创建备份组1,并配置备份组1的虚拟IPv6地址为FE80::10和1::10。
[SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
[SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip 1::10
# 配置Switch A在备份组1中的优先级为110。
[SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 priority 110
# 设置备份组的认证方式为SIMPLE,认证字为hello。
[SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 authentication-mode simple hello
# 配置Switch A工作在抢占方式,抢占延迟时间为5秒。
[SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 preempt-mode timer delay 5
# 设置监视Switch A连接Internet的VLAN接口3。当被监视的接口不可用时,Switch A的优先级会自动降低30,使备份组内Switch B的优先级高于Switch A,从而实现主备切换。
[SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 track interface vlan-interface 3 reduced 30
# 配置允许发布RA消息,以便Host A通过RA消息学习到缺省网关地址。
[SwitchA-Vlan-interface2] undo ipv6 nd ra halt
(2) 配置Switch B
# 配置VLAN2。
<SwitchB> system-view
[SwitchB] ipv6
[SwitchB] vlan 2
[SwitchB-vlan2] port gigabitethernet 1/0/5
[SwitchB-vlan2] quit
[SwitchB] interface vlan-interface 2
[SwitchB-Vlan-interface2] ipv6 address fe80::2 link-local
[SwitchB-Vlan-interface2] ipv6 address 1::2 64
# 创建备份组1,并配置备份组1的虚拟IPv6地址为FE80::10和1::10。
[SwitchB-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
[SwitchB-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip 1::10
# 设置备份组的认证方式为SIMPLE,认证字为hello。
[SwitchB-Vlan-interface2] vrrp ipv6 vrid 1 authentication-mode simple hello
# 配置Switch B工作在抢占方式,抢占延迟时间为5秒。
[SwitchB-Vlan-interface2] vrrp ipv6 vrid 1 preempt-mode timer delay 5
# 配置允许发布RA消息,以便Host A通过RA消息学习到缺省网关地址。
[SwitchB-Vlan-interface2] undo ipv6 nd ra halt
(3) 配置主机
配置Host A的缺省网关为1::10/64,具体配置过程略。
(4) 验证配置结果
配置完成后,在Host A上可以ping通Host B。通过display vrrp ipv6 verbose命令查看配置后的结果。
# 显示Switch A上备份组1的详细信息。
[SwitchA-Vlan-interface2] display vrrp ipv6 verbose
IPv6 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 500
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : FE80::10
1::10
Virtual MAC : 0000-5e00-0201
Master IP : FE80::1
VRRP Track Information:
Track Interface: Vlan3 State : Up Pri Reduced : 30
# 显示Switch B上备份组1的详细信息。
[SwitchB-Vlan-interface2] display vrrp ipv6 verbose
IPv6 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 500
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : FE80::10
1::10
Master IP : FE80::1
以上显示信息表示在备份组1中Switch A为Master设备,Switch B为Backup设备,Host A发送给Host B的报文通过Switch A转发。
Switch A连接Internet的VLAN接口3不可用时,在Host A上仍然可以ping通Host B。通过display vrrp ipv6 verbose命令查看备份组的信息。
# Switch A的VLAN接口3不可用时,显示Switch A上备份组1的详细信息。
[SwitchA-Vlan-interface2] display vrrp ipv6 verbose
IPv6 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 500
Admin Status : Up State : Backup
Config Pri : 110 Running Pri : 80
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : FE80::10
1::10
Master IP : FE80::2
VRRP Track Information:
Track Interface: Vlan3 State : Down Pri Reduced : 30
# Switch A的VLAN接口3不可用时,显示Switch B上备份组1的详细信息。
[SwitchB-Vlan-interface2] display vrrp ipv6 verbose
IPv6 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 500
Admin Status : Up State : Master
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : Simple Key : hello
Virtual IP : FE80::10
1::10
Virtual MAC : 0000-5e00-0201
Master IP : FE80::2
以上显示信息表示Switch A的VLAN接口3不可用时,Switch A的优先级降低为80,成为Backup设备,Switch B成为Master设备,Host A发送给Host B的报文通过Switch B转发。
l Switch A上的配置
#
ipv6
#
vlan 2 to 3
#
interface Vlan-interface2
ipv6 address fe80::1 link-local
ipv6 address 1::1 64
undo ipv6 nd ra halt
vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
vrrp ipv6 vrid 1 virtual-ip 1::10
vrrp ipv6 vrid 1 priority 110
vrrp ipv6 vrid 1 preempt-mode timer delay 5
vrrp ipv6 vrid 1 track interface vlan-interface 3 reduced 30
vrrp ipv6 vrid 1 authentication-mode simple hello
#
interface Vlan-interface3
ipv6 address 2003::2/64
#
interface GigabitEthernet1/0/3
port access vlan 3
#
interface GigabitEthernet1/0/5
port access vlan 2
#
l SwitchB上的配置
#
ipv6
#
vlan 2
#
interface Vlan-interface2
ipv6 address fe80::2 link-local
ipv6 address 1::2 64
undo ipv6 nd ra halt
vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
vrrp ipv6 vrid 1 virtual-ip 1::10
vrrp ipv6 vrid 1 preempt-mode timer delay 5
vrrp ipv6 vrid 1 authentication-mode simple hello
#
interface GigabitEthernet1/0/5
port access vlan 2
#
l 对于同一个VRRP备份组的配置,必须保证备份组虚拟路由器的IP地址个数、每个备份组虚拟路由器的IP地址、定时器间隔时间和认证方式完全一样。
l 不允许对IP地址拥有者进行监视指定接口的配置。
l 建议用户在配置监视接口功能时,在上行Trunk端口禁止VRRP备份组监视接口所对应的VLAN通过。被监视接口的状态由down变为up后,对应设备的优先级数会自动恢复。
l 用户在配置降低优先级幅度时,需要确保降低后的优先级,比备份组内其他交换机的优先级要低,确保备份组内有其他交换机被选为Master交换机。
l 如果网络流量过大或者不同的交换机上的定时器差异等因素,会导致Backup设备的定时器异常超时而发生状态转换。对于这种情况,可以通过将VRRP通告报文的发送时间间隔延长和设置抢占延迟时间的办法来解决。
在VRRP标准协议模式中,只有Master设备可以转发报文,Backup设备只能处于监听状态,无法转发报文。通过创建多个备份组可以实现不同VLAN数据的负载分担。
在设备上创建多个VRRPv3备份组,使得该设备在一个VRRPv3备份组中作为Master设备,同时在其他的VRRPv3备份组中作为Backup设备。
图2-2 多个VRRPv3备份组负载分担配置组网图
l 用户IPv6网络中采用VRRPv3技术进行网关设备的备份,提高可靠性;
l 要求正常情况下,VLAN2内的主机通过Switch A访问外部网络,VLAN3内的主机通过Switch B访问外部网络;
l 当Switch A或Switch B出现故障时,主机可以通过另一台设备继续通信,避免通信中断。
l 在Switch A和Switch B上分别创建两个VRRP备份组,备份组1的虚拟IPv6地址为1::10/64、FE80::10,备份组2的虚拟IPv6地址为2::10/64、FE90::10;
l 配置VLAN 2内主机的缺省网关为1::10/64;VLAN 3内主机的缺省网关为2::10/64;
l 在备份组1中Switch A的优先级高于Switch B,在备份组2中Switch B的优先级高于Switch A,从而保证VLAN 2和VLAN 3内的主机分别通过Switch A和Switch B通信;
l 配置Switch A和Switch B均监视其连接Internet的VLAN接口4的状态,当被监视的接口DOWN掉时,设备的优先级会自动降低30,从而触发主备切换;
l 配置Switch A和Switch B工作在抢占方式,以保证原Master设备故障恢复后,能再次抢占成为Master。为了避免频繁地进行状态切换,配置抢占延迟时间为5秒。
表2-2 配置适用的产品与软件版本关系
产品 |
软件版本 |
S7500E系列以太网交换机 |
Release 6300系列,Release 6600系列,Release 6610系列 |
S7600系列以太网交换机 |
Release 6600系列,Release 6610系列 |
S5800&S5820X系列以太网交换机 |
Release 1110,Release 1211 |
CE3000-32F以太网交换机 |
Release 1211 |
S5810系列以太网交换机 |
Release 1102 |
S5500-EI系列以太网交换机 |
Release 2202,Release 2208 |
S5500-EI-D系列以太网交换机 |
Release 2208 |
S3610&S5510系列以太网交换机 |
Release 5301,Release 5303,Release 5306,Release 5309 |
S3500-EA系列以太网交换机 |
Release 5303,Release 5309 |
对于S3610/S5510系列以太网交换机,在使能IPv6功能之前,必须先将设备运行模式切换到IPv4/IPv6双协议栈模式,即执行switch-mode dual-ipv4-ipv6命令;否则,即使使能IPv6,设备也不支持IPv6报文的转发。另外需要注意的是,执行switch-mode命令切换的协议栈只有在重启设备后才能生效。
(1) 配置Switch A
# 配置VLAN 2。
<SwitchA> system-view
[SwitchA] ipv6
[SwitchA] vlan 2
[SwitchA-vlan2] port gigabitethernet 1/0/5
[SwitchA-vlan2] quit
[SwitchA] interface vlan-interface 2
[SwitchA-Vlan-interface2] ipv6 address fe80::1 link-local
[SwitchA-Vlan-interface2] ipv6 address 1::1 64
# 创建备份组1,并配置备份组1的虚拟IPv6地址为FE80::10和1::10。
[SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
[SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip 1::10
# 设置Switch A在备份组1中的优先级为110。
[SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 priority 110
# 设置Switch A工作在抢占方式,抢占延迟时间为5秒。
[SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 preempt-mode timer delay 5
# 设置监视Switch A连接Internet的VLAN接口4。当被监视的接口DOWN掉时,Switch A的优先级会自动降低30,使备份组内Switch B的优先级高于Switch A,从而实现主备切换。
[SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 track interface vlan-interface 4 reduced 30
# 配置允许发布RA消息,以便VLAN 2内主机通过RA消息学习到缺省网关地址。
[SwitchA-Vlan-interface2] undo ipv6 nd ra halt
[SwitchA-Vlan-interface2] quit
# 配置VLAN 3。
[SwitchA] vlan 3
[SwitchA-vlan3] port gigabitethernet 1/0/6
[SwitchA-vlan3] quit
[SwitchA] interface vlan-interface 3
[SwitchA-Vlan-interface3] ipv6 address fe90::1 link-local
[SwitchA-Vlan-interface3] ipv6 address 2::1 64
# 创建备份组2,并配置备份组2的虚拟IPv6地址为FE90::10和2::10。
[SwitchA-Vlan-interface3] vrrp ipv6 vrid 2 virtual-ip fe90::10 link-local
[SwitchA-Vlan-interface3] vrrp ipv6 vrid 2 virtual-ip 2::10
# 设置Switch A工作在抢占方式,抢占延迟时间为5秒。
[SwitchA-Vlan-interface3] vrrp ipv6 vrid 2 preempt-mode timer delay 5
# 配置允许发布RA消息,以便VLAN 3内主机通过RA消息学习到缺省网关地址。
[SwitchA-Vlan-interface3] undo ipv6 nd ra halt
(2) 配置Switch B
# 配置VLAN 2。
<SwitchB> system-view
[SwitchB] ipv6
[SwitchB-vlan2] port gigabitethernet 1/0/5
[SwitchB-vlan2] quit
[SwitchB] interface vlan-interface 2
[SwitchB-Vlan-interface2] ipv6 address fe80::2 link-local
[SwitchB-Vlan-interface2] ipv6 address 1::2 64
# 创建备份组1,并配置备份组1的虚拟IPv6地址为FE80::10和1::10。
[SwitchB-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
[SwitchB-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip 1::10
# 设置Switch B工作在抢占方式,抢占延迟时间为5秒。
[SwitchB-Vlan-interface2] vrrp ipv6 vrid 1 preempt-mode timer delay 5
# 配置允许发布RA消息,以便VLAN 2内主机通过RA消息学习到缺省网关地址。
[SwitchB-Vlan-interface2] undo ipv6 nd ra halt
[SwitchB-Vlan-interface2] quit
# 配置VLAN 3。
[SwitchB] vlan 3
[SwitchB-vlan3] port gigabitethernet 1/0/6
[SwitchB-vlan3] quit
[SwitchB] interface vlan-interface 3
[SwitchB-Vlan-interface3] ipv6 address fe90::2 link-local
[SwitchB-Vlan-interface3] ipv6 address 2::2 64
# 创建备份组2,并配置备份组2的虚拟IPv6地址为FE90::10和2::10。
[SwitchB-Vlan-interface3] vrrp ipv6 vrid 2 virtual-ip fe90::10 link-local
[SwitchB-Vlan-interface3] vrrp ipv6 vrid 2 virtual-ip 2::10
# 设置Switch B在备份组2中的优先级为110。
[SwitchB-Vlan-interface3] vrrp ipv6 vrid 2 priority 110
# 设置Switch B工作在抢占方式,抢占延迟时间为5秒。
[SwitchB-Vlan-interface3] vrrp ipv6 vrid 2 preempt-mode timer delay 5
# 设置监视Switch B连接Internet的VLAN接口4。当被监视的接口DOWN掉时,Switch B的优先级会自动降低30,使备份组内Switch A的优先级高于Switch B,从而实现主备切换。
[SwitchB-Vlan-interface3] vrrp ipv6 vrid 2 track interface vlan-interface 4 reduced 30
# 配置允许发布RA消息,以便VLAN 3内主机通过RA消息学习到缺省网关地址。
[SwitchB-Vlan-interface3] undo ipv6 nd ra halt
(3) 配置主机
配置VLAN 2内主机的缺省网关为1::10/64,VLAN 3内主机的缺省网关为2::10/64,具体配置过程略。
(4) 验证配置结果
可以通过display vrrp ipv6 verbose命令查看配置后的结果。
# 显示Switch A上备份组的详细信息。
[SwitchA-Vlan-interface3] display vrrp ipv6 verbose
IPv6 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 2
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : FE80::10
1::10
Virtual MAC : 0000-5e00-0201
Master IP : FE80::1
Interface Vlan-interface3
VRID : 2 Adver Timer : 100
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : FE90::10
2::10
Master IP : FE90::2
# 显示Switch B上备份组的详细信息。
[SwitchB-Vlan-interface3] display vrrp ipv6 verbose
IPv6 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 2
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : FE80::10
1::10
Master IP : FE80::1
Interface Vlan-interface3
VRID : 2 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : FE90::10
2::10
Virtual MAC : 0000-5e00-0202
Master IP : FE90::2
以上显示信息表示在备份组1中Switch A为Master设备,Switch B为Backup设备,缺省网关为1::10/64的主机通过Switch A访问Internet;备份组2中Switch A为Backup设备,Switch B为Master设备,缺省网关为2::10/64的主机通过Switch B访问Internet。
Switch A出现故障后,再次通过display vrrp verbose命令查看Switch B上备份组的详细信息。
# Switch A出现故障后,显示Switch B上备份组1的详细信息。
[SwitchB-Vlan-interface3] display vrrp ipv6 verbose
IPv6 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 2
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : FE80::10
1::10
Master IP : FE80::2
Interface Vlan-interface3
VRID : 2 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : FE90::10
2::10
Virtual MAC : 0000-5e00-0202
Master IP : FE90::2
以上显示信息表示Switch A出现故障后,Switch B成为VRRPv3备份组1的Master设备,VLAN 2内的主机发送给外网的报文改为通过Switch B转发。
l Switch A上的配置
#
ipv6
#
vlan 2 to 3
#
interface Vlan-interface2
ipv6 address fe80::1 link-local
ipv6 address 1::1 64
undo ipv6 nd ra halt
vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
vrrp ipv6 vrid 1 virtual-ip 1::10
vrrp ipv6 vrid 1 priority 110
vrrp ipv6 vrid 1 preempt-mode timer delay 5
vrrp ipv6 vrid 1 track interface vlan-interface 4 reduced 30
#
interface Vlan-interface3
ipv6 address fe90::1 link-local
ipv6 address 2::1 64
undo ipv6 nd ra halt
vrrp ipv6 vrid 2 virtual-ip fe90::10 link-local
vrrp ipv6 vrid 2 virtual-ip 2::10
vrrp ipv6 vrid 2 preempt-mode timer delay 5
#
interface Ethernet1/0/5
port access vlan 2
#
interface Ethernet1/0/6
port access vlan 3
#
l SwitchB上的配置
#
ipv6
#
vlan 2 to 3
#
interface Vlan-interface2
ipv6 address fe80::2 link-local
ipv6 address 1::2 64
undo ipv6 nd ra halt
vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
vrrp ipv6 vrid 1 virtual-ip 1::10
vrrp ipv6 vrid 1 preempt-mode timer delay 5
#
interface Vlan-interface3
ipv6 address fe90::2 link-local
ipv6 address 2::2 64
undo ipv6 nd ra halt
vrrp ipv6 vrid 2 virtual-ip fe90::20 link-local
vrrp ipv6 vrid 2 virtual-ip 2::10
vrrp ipv6 vrid 2 priority 110
vrrp ipv6 vrid 2 preempt-mode timer delay 5
vrrp ipv6 vrid 2 track interface vlan-interface 4 reduced 30
#
interface Ethernet1/0/5
port access vlan 2
#
interface Ethernet1/0/6
port access vlan 3
#
l 在实际组网应用中,一般都使用多备份组。IPv6网络中,主机需要手动配置默认网关才能实现VRRP备份组负载分担的功能。
l 对于同一个VRRP备份组的配置,必须保证备份组虚拟路由器的IP地址个数、每个备份组虚拟路由器的IP地址、定时器间隔时间和认证方式完全一样。
l 如果网络流量过大或者不同的交换机上的定时器差异等因素,会导致Backup设备的定时器异常超时而发生状态转换。对于这种情况,可以通过将VRRP通告报文的发送时间间隔延长和设置抢占延迟时间的办法来解决。
图2-3 VRRPv3多备份组与MSTP混合组网图
l 用户IPv6网络采用VRRPv3技术进行网关设备的备份,提高网络可靠性;
l 要求在网关设备工作正常时,区域A用户通过网关设备Switch A进行数据转发;区域B用户通过网关设备Switch B进行数据转发,实现流量的负载分担;
l 当一台网关设备出现故障时,局域网内的主机仍然可以通过另一台网关设备访问外部网络;
l 局域网内进行二层链路的冗余备份,保证网关设备下行链路故障时不影响VRRP的工作状态。
用户可以将Switch A和Switch B之间的直连链路配置为聚合链路,以提高可靠性。
l Switch A、Switch B上分别创建两个VRRP备份组;
l 二层交换机Switch C连接的主机都将备份组1作为网关,二层交换机Switch D连接的主机都将备份组2作为网关;
l 配置Switch A在备份组1内具有更高的优先级,即正常情况下Switch A作为备份组1的Master设备;配置Switch B在备份组2内具有更高的优先级,即正常情况下Switch B作为备份组2的Master设备;从而实现数据的负载分担。
l Switch A、Switch B和二层交换机之间启用MSTP多实例,并使得各实例中均以Master设备为根桥、Backup设备为备份根桥,保证正常情况下阻塞Switch C和Switch D的GE1/0/2端口(如图2-3所示)。
表2-3 配置适用的产品与软件版本关系
产品 |
软件版本 |
S7500E系列以太网交换机 |
Release 6300系列,Release 6600系列,Release 6610系列 |
S7600系列以太网交换机 |
Release 6600系列,Release 6610系列 |
S5800&S5820X系列以太网交换机 |
Release 1110,Release 1211 |
CE3000-32F以太网交换机 |
Release 1211 |
S5810系列以太网交换机 |
Release 1102 |
S5500-EI系列以太网交换机 |
Release 2202,Release 2208 |
S5500-EI-D系列以太网交换机 |
Release 2208 |
S3610&S5510系列以太网交换机 |
Release 5301,Release 5303,Release 5306,Release 5309 |
S3500-EA系列以太网交换机 |
Release 5303,Release 5309 |
对于S3610/S5510系列以太网交换机,在使能IPv6功能之前,必须先将设备运行模式切换到IPv4/IPv6双协议栈模式,即执行switch-mode dual-ipv4-ipv6命令;否则,即使使能IPv6,设备也不支持IPv6报文的转发。另外需要注意的是,执行switch-mode命令切换的协议栈只有在重启设备后才能生效。
(1) 配置Switch A
# 全局使能IPv6。
<SwitchA> system-view
[SwitchA] ipv6
# 配置VLAN101、VLAN102和VLAN4092。两设备间采用trunk口直连。
[SwitchA] vlan 101
[SwitchA-vlan101] port Gigabitethernet 1/0/1
[SwitchA-vlan101] quit
[SwitchA] vlan 102
[SwitchA-vlan102] port Gigabitethernet 1/0/3
[SwitchA-vlan102] quit
[SwitchA] vlan 4092
[SwitchA-vlan4092] port Gigabitethernet 1/0/2
[SwitchA-vlan4092] quit
[SwitchA] interface GigabitEthernet1/0/4
[SwitchA-GigabitEthernet1/0/4] interface GigabitEthernet1/0/4
[SwitchA-GigabitEthernet1/0/4] port link-type trunk
[SwitchA-GigabitEthernet1/0/4] undo port trunk permit vlan 1
[SwitchA-GigabitEthernet1/0/4] port trunk permit vlan 101 to 102
[SwitchA-GigabitEthernet1/0/4] port trunk pvid vlan 101
[SwitchA-GigabitEthernet1/0/4] quit
# 配置上行接口。
[SwitchA] interface vlan-interface 4092
[SwitchA-Vlan-interface4092] ipv6 address 2003::2 64
# 创建VRRP备份组1。
[SwitchA] interface vlan-interface 101
[SwitchA-Vlan-interface101] ipv6 address fe80::2 link-local
[SwitchA-Vlan-interface101] ipv6 address 2001::2 64
[SwitchA-Vlan-interface101] vrrp ipv6 vrid 1 virtual-ip FE80::1 link-local
[SwitchA-Vlan-interface101] vrrp ipv6 vrid 1 virtual-ip 2001::1
# 配置备份组1优先级为110。
[SwitchA-Vlan-interface101] vrrp ipv6 vrid 1 priority 110
# 配置监视上行接口。
[SwitchA-Vlan-interface101] vrrp ipv6 vrid 1 track interface Vlan-interface4092 reduced 20
# 配置允许发布RA消息。
[SwitchA-Vlan-interface101] undo ipv6 nd ra halt
[SwitchA-Vlan-interface101] quit
# 创建VRRP备份组2。
[SwitchA] interface vlan-interface 102
[SwitchA-Vlan-interface102] ipv6 address fe90::2 link-local
[SwitchA-Vlan-interface102] ipv6 address 2002::2 64
[SwitchA-Vlan-interface102] vrrp ipv6 vrid 1 virtual-ip FE90::1 link-local
[SwitchA-Vlan-interface102] vrrp ipv6 vrid 1 virtual-ip 2002::1
# 配置允许发布RA消息。
[SwitchA-Vlan-interface102] undo ipv6 nd ra halt
[SwitchA-Vlan-interface102] quit
# 配置MSTP。
[SwitchA] stp region-configuration
[SwitchA-mst-region] region-name vrrp
[SwitchA-mst-region] instance 1 vlan 101
[SwitchA-mst-region] instance 2 vlan 102
[SwitchA-mst-region] active region-configuration
[SwitchA-mst-region] quit
[SwitchA] stp instance 1 root primary
[SwitchA] stp instance 2 root secondary
[SwitchA] stp enable
(2) 配置Switch B
# 全局使能IPv6
<SwitchB> system-view
[SwitchB] ipv6
# 配置VLAN101、VLAN102和VLAN4093。两设备间采用trunk口直连。
[SwitchB] vlan 101
[SwitchB-vlan101] port Gigabitethernet 1/0/1
[SwitchB-vlan101] quit
[SwitchB] vlan 102
[SwitchB-vlan102] port Gigabitethernet 1/0/3
[SwitchB-vlan102] quit
[SwitchB] vlan 4093
[SwitchB-vlan4093] port Gigabitethernet 1/0/2
[SwitchB-vlan4093] quit
[SwitchB] interface GigabitEthernet1/0/4
[SwitchB-GigabitEthernet1/0/4] port link-type trunk
[SwitchB-GigabitEthernet1/0/4] undo port trunk permit vlan 1
[SwitchB-GigabitEthernet1/0/4] port trunk permit vlan 101 to 102
[SwitchB-GigabitEthernet1/0/4] port trunk pvid vlan 101
[SwitchB-GigabitEthernet1/0/4] quit
# 配置上行接口。
[SwitchB] interface vlan-interface 4093
[SwitchB-Vlan-interface4093] ipv6 address 2004::2 64
# 创建VRRP备份组1。
[SwitchB] interface vlan-interface 101
[SwitchB-Vlan-interface101] ipv6 address fe80::3 link-local
[SwitchB-Vlan-interface101] ipv6 address 2001::3 64
[SwitchB-Vlan-interface101] vrrp ipv6 vrid 1 virtual-ip FE80::1 link-local
[SwitchB-Vlan-interface101] vrrp ipv6 vrid 1 virtual-ip 2001::1
# 配置允许发布RA消息。
[SwitchB-Vlan-interface101] undo ipv6 nd ra halt
[SwitchB-Vlan-interface101] quit
# 创建VRRP备份组2。
[SwitchB] interface vlan-interface 102
[SwitchB-Vlan-interface102] ipv6 address fe90::3 link-local
[SwitchB-Vlan-interface102] ipv6 address 2002::3 64
[SwitchB-Vlan-interface102] vrrp ipv6 vrid 1 virtual-ip FE90::1 link-local
[SwitchB-Vlan-interface102] vrrp ipv6 vrid 1 virtual-ip 2002::1
# 配置备份组2优先级为110。
[SwitchB-Vlan-interface102] vrrp ipv6 vrid 1 priority 110
# 配置监视上行接口。
[SwitchB-Vlan-interface102] vrrp ipv6 vrid 1 track interface Vlan-interface4093 reduced 20
# 配置允许发布RA消息。
[SwitchB-Vlan-interface102] undo ipv6 nd ra halt
[SwitchB-Vlan-interface102] quit
# 配置MSTP。
[SwitchB] stp region-configuration
[SwitchB-mst-region] region-name vrrp
[SwitchB-mst-region] instance 1 vlan 101
[SwitchB-mst-region] instance 2 vlan 102
[SwitchB-mst-region] active region-configuration
[SwitchB-mst-region] quit
[SwitchB] stp instance 2 root primary
[SwitchB] stp instance 1 root secondary
[SwitchB] stp enable
(3) 配置Switch C
# 配置VLAN101。
<SwitchC> system-view
[SwitchC] vlan 101
[SwitchC-vlan101] port Gigabitethernet 1/0/1 to Gigabitethernet 1/0/2
[SwitchC-vlan101] quit
# 配置MSTP。
[SwitchC] stp region-configuration
[SwitchC-mst-region] region-name vrrp
[SwitchC-mst-region] instance 1 vlan 101
[SwitchC-mst-region] instance 2 vlan 102
[SwitchC-mst-region] active region-configuration
[SwitchC-mst-region] quit
[SwitchC] stp enable
(4) 配置Switch D
# 配置VLAN102。
<SwitchD> system-view
[SwitchD] vlan 102
[SwitchD-vlan102] port Gigabitethernet 1/0/1 to Gigabitethernet 1/0/2
[SwitchD-vlan102] quit
# 配置MSTP。
[SwitchD] stp region-configuration
[SwitchD-mst-region] region-name vrrp
[SwitchD-mst-region] instance 1 vlan 101
[SwitchD-mst-region] instance 2 vlan 102
[SwitchD-mst-region] active region-configuration
[SwitchD-mst-region] quit
[SwitchD] stp enable
(5) 配置主机
配置区域A内主机的缺省网关为2001::1,区域B内主机的缺省网关为2002::1,具体配置过程略。
(6) 验证配置结果
完成配置后用户可以使用display vrrp ipv6 verbose命令查看备份组的详细信息;同时可以使用display stp brief命令查看各设备上生成树的简要信息。
l Switch A上的配置
#
ipv6
#
vlan 101 to 102
#
vlan 4092
#
stp instance 1 root primary
stp instance 2 root secondary
stp enable
stp region-configuration
region-name vrrp
instance 1 vlan 101
instance 2 vlan 102
active region-configuration
#
interface Vlan-interface101
ipv6 address fe80::2 link-local
ipv6 address 2001::2/64
vrrp ipv6 vrid 1 virtual-ip fe80::1 link-local
vrrp ipv6 vrid 1 virtual-ip 2001::1
vrrp ipv6 vrid 1 priority 110
vrrp ipv6 vrid 1 track interface Vlan-interface4092 reduced 20
#
interface Vlan-interface102
ipv6 address fe90::2 link-local
ipv6 address 2002::2 64
vrrp ipv6 vrid 1 virtual-ip fe90::1 link-local
vrrp ipv6 vrid 1 virtual-ip 2002::1
#
interface Vlan-interface4092
ipv6 address 2003::2/64
#
interface GigabitEthernet1/0/1
port access vlan 101
#
interface GigabitEthernet1/0/2
port access vlan 4092
stp disable
#
interface GigabitEthernet1/0/3
port access vlan 102
#
interface GigabitEthernet1/0/4
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 101 to 102
port trunk pvid vlan 101
#
l SwitchB上的配置
#
ipv6
#
vlan 101 to 102
#
vlan 4093
#
stp instance 1 root secondary
stp instance 2 root primary
stp enable
stp region-configuration
region-name vrrp
instance 1 vlan 101
instance 2 vlan 102
active region-configuration
#
interface Vlan-interface101
ipv6 address fe80::3 link-local
ipv6 address 2001::3 64
vrrp ipv6 vrid 1 virtual-ip fe80::1 link-local
vrrp ipv6 vrid 1 virtual-ip 2001::1
#
interface Vlan-interface102
ipv6 address fe90::3 link-local
ipv6 address 2002::3 64
vrrp ipv6 vrid 2 virtual-ip fe90::1 link-local
vrrp ipv6 vrid 1 virtual-ip 2002::1
vrrp ipv6 vrid 2 priority 110
vrrp ipv6 vrid 1 track interface Vlan-interface4093 reduced 20
#
interface Vlan-interface4093
ipv6 address 2004::2/64
#
interface GigabitEthernet1/0/1
port access vlan 101
#
interface GigabitEthernet1/0/2
port access vlan 4093
stp disable
#
interface GigabitEthernet1/0/3
port access vlan 102
#
interface GigabitEthernet1/0/4
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 101 to 102
port trunk pvid vlan 101
#
l Switch C上的配置
#
vlan 101
#
stp enable
stp region-configuration
region-name vrrp
instance 1 vlan 101
instance 2 vlan 102
active region-configuration
#
interface GigabitEthernet1/0/1
port access vlan 101
#
interface GigabitEthernet1/0/2
port access vlan 101
#
l Switch D上的配置
#
vlan 102
#
stp enable
stp region-configuration
region-name vrrp
instance 1 vlan 101
instance 2 vlan 102
active region-configuration
#
interface GigabitEthernet1/0/1
port access vlan 102
#
interface GigabitEthernet1/0/2
port access vlan 102
#
l 对于同一个VRRP备份组的配置,必须保证备份组虚拟路由器的IP地址个数、每个备份组虚拟路由器的IP地址、定时器间隔时间和认证方式完全一样。
l 不允许对IP地址拥有者进行监视指定接口的配置。
l 建议用户在配置监视接口功能时,在上行Trunk端口禁止VRRP备份组监视接口所对应的VLAN通过。被监视接口的状态由down变为up后,对应设备的优先级数会自动恢复。
l 如果网络流量过大或者不同的交换机上的定时器差异等因素,会导致Backup设备的定时器异常超时而发生状态转换。对于这种情况,可以通过将VRRP通告报文的发送时间间隔延长和设置抢占延迟时间的办法来解决。
在VRRPv3标准协议模式中,只有Master设备可以转发报文,Backup设备处于监听状态,无法转发报文。虽然创建多个备份组可以实现多个路由器之间的负载分担,但是局域网内的主机需要设置不同的网关,增加了配置的复杂性。
VRRPv3负载均衡模式在VRRPv3提供的虚拟网关冗余备份功能基础上,增加了负载均衡功能。其实现原理为:将一个虚拟IP地址与多个虚拟MAC地址对应,VRRP备份组中的每个路由器都对应一个虚拟MAC地址;使用不同的虚拟MAC地址应答主机的ND请求,从而使得不同主机的流量发送到不同的路由器,备份组中的每个路由器都能转发流量。
在VRRPv3负载均衡模式中,只需创建一个备份组,就可以实现备份组中多个路由器之间的负载分担,避免了VRRP备份组中Backup设备始终处于空闲状态、网络资源利用率不高的问题。
l VRRPv3负载均衡模式以VRRPv3标准协议模式为基础,VRRPv3标准协议模式中的工作机制(如Master设备的选举、抢占、监视功能等),VRRP负载均衡模式均支持。
l VRRPv3负载均衡模式下,Backup设备也可以转发数据,因此在配置监视Master上行接口状态功能时,需要使用vrrp ipv6 vrid virtual-router-id weight track track-entry-number [ reduced weight-reduced ]命令,降低上行接口故障设备上虚拟转发器的权重。配置该命令后,当Track项状态为Negative或Invalid时,路由器上所有虚拟转发器的权重都将降低指定的数额(weight-reduced);被监视的Track项状态由Negative或Invalid变为Positive后,路由器中所有虚拟转发器的权重会自动恢复。
图2-4 VRRPv3负载均衡模式配置组网图
l 用户IPv6网络中采用三台网关设备互为备份,提高可靠性;
l 要求通过一个VRRPv3备份组实现负载分担,充分利用网关资源;
l 要求正常情况下,Switch A用作Master设备;
l 要求在Master和Backup设备上行接口出现故障时,VRRP能够监测到该故障,禁止数据经此设备进行转发,避免通信中断。
l 在Switch A、Switch B和Switch C上分别创建VRRPv3备份组1,其虚拟IPv6地址为FE80::10和1::10;
l 1::/64网段内主机的缺省网关均设为1::10;
l 配置备份组1工作在负载均衡模式,通过一个备份组实现负载分担;
l 配置VRRPv3备份组1中Switch A的优先级高于Switch B,Switch B的优先级高于Switch C;
l 配置Switch A工作在抢占方式,以保证Switch A故障恢复后,能再次抢占成为Master,即只要Switch A正常工作,Switch A就会成为Master。为了避免频繁地进行状态切换,配置抢占延迟时间为5秒。
l 在Switch A、Switch B和Switch C上配置虚拟转发器通过Track项监视上行接口(VLAN接口3)的状态。当上行接口出现故障时,降低该接口所在设备虚拟转发器的权重,以便其他设备接管该设备的转发任务。
表2-4 配置适用的产品与软件版本关系
产品 |
软件版本 |
S5800&S5820X系列以太网交换机 |
Release 1110,Release 1211 |
CE3000-32F以太网交换机 |
Release 1211 |
S5500-EI系列以太网交换机 |
Release 2208 |
S5500-EI-D系列以太网交换机 |
Release 2208 |
(1) 配置Switch A
# 配置VLAN3。
<SwitchA> system-view
[SwitchA] vlan 3
[SwitchA-vlan3] port gigabitethernet 1/0/3
[SwitchA-vlan3] quit
[SwitchA] interface vlan-interface 3
[SwitchA-Vlan-interface3] ipv6 address 2003::2 64
[SwitchA-Vlan-interface3] quit
# 配置VLAN2。
[SwitchA] vlan 2
[SwitchA-vlan2] port gigabitethernet 1/0/5
[SwitchA-vlan2] quit
# 配置VRRP工作在负载均衡模式。
[SwitchA] vrrp mode load-balance
# 创建备份组1,并配置备份组1的虚拟IP地址为FE80::10和1::10。
[SwitchA] interface vlan-interface 2
[SwitchA-Vlan-interface2] ipv6 address fe80::1 link-local
[SwitchA-Vlan-interface2] ipv6 address 1::1 64
[SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
[SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip 1::10
# 配置Switch A在备份组1中的优先级为120,高于Switch B的优先级110和Switch C的优先级100,以保证Switch A成为Master。
[SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 priority 120
# 配置Switch A工作在抢占方式,以保证Switch A故障恢复后,能再次抢占成为Master。为了避免频繁地进行状态切换,配置抢占延迟时间为5秒。
[SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 preempt-mode timer delay 5
# 配置允许发布RA消息,以便1::/64网段内主机通过RA消息学习到缺省网关地址。
[SwitchA-Vlan-interface2] undo ipv6 nd ra halt
[SwitchA-Vlan-interface2] quit
# 创建和VLAN接口3物理状态关联的Track项1。如果Track项的状态为Negative,则说明Switch A的上行接口出现故障。
[SwitchA] track 1 interface vlan-interface 3
# 配置虚拟转发器监视Track项1。Track项的状态为Negative时,降低Switch A上虚拟转发器的权重,使其低于失效下限10,即权重降低的数额大于245,以便其他设备接替Switch A的转发任务。本例中,配置虚拟转发器权重降低数额为250。
[SwitchA] interface vlan-interface 2
[SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 weight track 1 reduced 250
(2) 配置Switch B
# 配置VLAN2。
<SwitchB> system-view
[SwitchB] vlan 2
[SwitchB-vlan2] port gigabitethernet 1/0/5
[SwitchB-vlan2] quit
# 配置VRRP工作在负载均衡模式。
[SwitchB] vrrp mode load-balance
# 创建备份组1,并配置备份组1的虚拟IP地址为FE80::10和1::10。
[SwitchB] interface vlan-interface 2
[SwitchB-Vlan-interface2] ipv6 address fe80::2 link-local
[SwitchB-Vlan-interface2] ipv6 address 1::2 64
[SwitchB-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
[SwitchB-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip 1::10
# 配置Swtich B在备份组1中的优先级为110,高于Switch C的优先级100,以保证Switch A出现故障时,Switch B成为Master。
[SwitchB-Vlan-interface2] vrrp ipv6 vrid 1 priority 110
# 配置Switch B工作在抢占方式,抢占延迟时间为5秒。
[SwitchB-Vlan-interface2] vrrp ipv6 vrid 1 preempt-mode timer delay 5
# 配置允许发布RA消息,以便1::/64网段内主机通过RA消息学习到缺省网关地址。
[SwitchB-Vlan-interface2] undo ipv6 nd ra halt
[SwitchB-Vlan-interface2] quit
# 创建和VLAN接口3物理状态关联的Track项1。如果Track项的状态为Negative,则说明Switch B的上行接口出现故障。
[SwitchB] track 1 interface vlan-interface 3
# 配置虚拟转发器监视Track项1。Track项的状态为Negative时,降低Switch B上虚拟转发器的权重,使其低于失效下限10,即权重降低的数额大于245,以便其他设备接替Switch B的转发任务。本例中,配置虚拟转发器权重降低数额为250。
[SwitchB] interface vlan-interface 2
[SwitchB-Vlan-interface2] vrrp ipv6 vrid 1 weight track 1 reduced 250
(3) 配置Switch C
# 配置VLAN2。
<SwitchC> system-view
[SwitchC] vlan 2
[SwitchC-vlan2] port gigabitethernet 1/0/5
[SwitchC-vlan2] quit
# 配置VRRP工作在负载均衡模式。
[SwitchC] vrrp mode load-balance
# 创建备份组1,并配置备份组1的虚拟IP地址为FE80::10和1::10。
[SwitchC] interface vlan-interface 2
[SwitchC-Vlan-interface2] ipv6 address fe80::3 link-local
[SwitchC-Vlan-interface2] ipv6 address 1::3 64
[SwitchC-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
[SwitchC-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip 1::10
# 配置Switch C工作在抢占方式,抢占延迟时间为5秒。
[SwitchC-Vlan-interface2] vrrp ipv6 vrid 1 preempt-mode timer delay 5
# 配置允许发布RA消息,以便1::/64网段内主机通过RA消息学习到缺省网关地址。
[SwitchC-Vlan-interface2] undo ipv6 nd ra halt
[SwitchC-Vlan-interface2] quit
# 创建和VLAN接口3物理状态关联的Track项1。如果Track项的状态为Negative,则说明Switch C的上行接口出现故障。
[SwitchC] track 1 interface vlan-interface 3
# 配置虚拟转发器监视Track项1。Track项的状态为Negative时,降低Switch C上虚拟转发器的权重,使其低于失效下限10,即权重降低的数额大于245,以便其他设备接替Switch C的转发任务。本例中,配置虚拟转发器权重降低数额为250。
[SwitchC] interface vlan-interface 2
[SwitchC-Vlan-interface2] vrrp ipv6 vrid 1 weight track 1 reduced 250
(4) 验证配置结果
配置完成后,在Host A上可以ping通外网。通过display vrrp ipv6 verbose命令查看配置后的结果。
# 显示Switch A上备份组1的详细信息。
[SwitchA-Vlan-interface2] display vrrp ipv6 verbose
IPv6 Standby Information:
Run Mode : Load Balance
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 120 Running Pri : 120
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : FE80::10
1::10
Member IP List : FE80::1 (Local, Master)
FE80::2 (Backup)
FE80::3 (Backup)
Forwarder Information: 3 Forwarders 1 Active
Config Weight : 255
Running Weight : 255
Forwarder 01
State : Active
Virtual MAC : 000f-e2ff-4011 (Owner)
Owner ID : 0000-5e01-1101
Priority : 255
Active : local
Forwarder 02
State : Listening
Virtual MAC : 000f-e2ff-4012 (Learnt)
Owner ID : 0000-5e01-1103
Priority : 127
Active : FE80::2
Forwarder 03
State : Listening
Virtual MAC : 000f-e2ff-4013 (Learnt)
Owner ID : 0000-5e01-1105
Priority : 127
Active : FE80::3
Forwarder Weight Track Information:
Track Object : 1 State : Positive Weight Reduced : 250
# 显示Switch B上备份组1的详细信息。
[SwitchB-Vlan-interface2] display vrrp ipv6 verbose
IPv6 Standby Information:
Run Mode : Load Balance
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Backup
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : FE80::10
1::10
Member IP List : FE80::2 (Local, Backup)
FE80::1 (Master)
FE80::3 (Backup)
Forwarder Information: 3 Forwarders 1 Active
Config Weight : 255
Running Weight : 255
Forwarder 01
State : Listening
Virtual MAC : 000f-e2ff-4011 (Learnt)
Owner ID : 0000-5e01-1101
Priority : 127
Active : FE80::1
Forwarder 02
State : Active
Virtual MAC : 000f-e2ff-4012 (Owner)
Owner ID : 0000-5e01-1103
Priority : 255
Active : local
Forwarder 03
State : Listening
Virtual MAC : 000f-e2ff-4013 (Learnt)
Owner ID : 0000-5e01-1105
Priority : 127
Active : FE80::3
Forwarder Weight Track Information:
Track Object : 1 State : Positive Weight Reduced : 250
# 显示Switch C上备份组1的详细信息。
[SwitchC-Vlan-interface2] display vrrp ipv6 verbose
IPv6 Standby Information:
Run Mode : Load Balance
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : FE80::10
1::10
Member IP List : FE80::3 (Local, Backup)
FE80::1 (Master)
FE80::2 (Backup)
Forwarder Information: 3 Forwarders 1 Active
Config Weight : 255
Running Weight : 255
Forwarder 01
State : Listening
Virtual MAC : 000f-e2ff-4011 (Learnt)
Owner ID : 0000-5e01-1101
Priority : 127
Active : FE80::1
Forwarder 02
State : Listening
Virtual MAC : 000f-e2ff-4012 (Learnt)
Owner ID : 0000-5e01-1103
Priority : 127
Active : FE80::2
Forwarder 03
State : Active
Virtual MAC : 000f-e2ff-4013 (Owner)
Owner ID : 0000-5e01-1105
Priority : 255
Active : local
Forwarder Weight Track Information:
Track Object : 1 State : Positive Weight Reduced : 250
以上显示信息表示在备份组1中Switch A为Master设备,Switch B和Switch C 为Backup设备。Switch A、Switch B和Switch C上各自存在一个AVF,并存在作为备份的两个LVF。
# 当Switch A的上行接口(VLAN接口3)出现故障后,通过display vrrp ipv6 verbose命令查看Switch A上备份组的详细信息。
[SwitchA-Vlan-interface2] display vrrp ipv6 verbose
IPv6 Standby Information:
Run Mode : Load Balance
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 120 Running Pri : 120
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : FE80::10
1::10
Member IP List : FE80::1 (Local, Master)
FE80::2 (Backup)
FE80::3 (Backup)
Forwarder Information: 3 Forwarders 0 Active
Config Weight : 255
Running Weight : 5
Forwarder 01
State : Initialize
Virtual MAC : 000f-e2ff-4011 (Owner)
Owner ID : 0000-5e01-1101
Priority : 0
Active : FE80::3
Forwarder 02
State : Initialize
Virtual MAC : 000f-e2ff-4012 (Learnt)
Owner ID : 0000-5e01-1103
Priority : 0
Active : FE80::2
Forwarder 03
State : Initialize
Virtual MAC : 000f-e2ff-4013 (Learnt)
Owner ID : 0000-5e01-1105
Priority : 0
Active : FE80::3
Forwarder Weight Track Information:
Track Object : 1 State : Negative Weight Reduced : 250
# 通过display vrrp ipv6 verbose命令查看Switch C上备份组的详细信息。
[SwitchC-Vlan-interface2] display vrrp ipv6 verbose
IPv6 Standby Information:
Run Mode : Load Balance
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : FE80::10
1::10
Member IP List : FE80::3 (Local, Backup)
FE80::1 (Master)
FE80::2 (Backup)
Forwarder Information: 3 Forwarders 2 Active
Config Weight : 255
Running Weight : 255
Forwarder 01
State : Active
Virtual MAC : 000f-e2ff-4011 (Take Over)
Owner ID : 0000-5e01-1101
Priority : 85
Active : local
Redirect Time : 93 secs
Time-out Time : 1293 secs
Forwarder 02
State : Listening
Virtual MAC : 000f-e2ff-4012 (Learnt)
Owner ID : 0000-5e01-1103
Priority : 85
Active : FE80::2
Forwarder 03
State : Active
Virtual MAC : 000f-e2ff-4013 (Owner)
Owner ID : 0000-5e01-1105
Priority : 255
Active : local
Forwarder Weight Track Information:
Track Object : 1 State : Positive Weight Reduced : 250
以上显示信息表示Switch A的上行接口出现故障后,Switch A上虚拟转发器的权重降低为5,低于失效下限。Switch A上所有虚拟转发器的状态均变为Initialized,不能再用于转发。Switch C成为虚拟MAC地址000f-e2ff-0011对应虚拟转发器的AVF,接管Switch A的转发任务。
# Timeout Timer超时后(约1800秒后),查看Switch C上备份组的详细信息。
[SwitchC-Vlan-interface2] display vrrp ipv6 verbose
IPv6 Standby Information:
Run Mode : Load Balance
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : FE80::10
1::10
Member IP List : FE80::3 (Local, Backup)
FE80::1 (Master)
FE80::2 (Backup)
Forwarder Information: 2 Forwarders 1 Active
Config Weight : 255
Running Weight : 255
Forwarder 02
State : Listening
Virtual MAC : 000f-e2ff-4012 (Learnt)
Owner ID : 0000-5e01-1103
Priority : 127
Active : FE80::2
Forwarder 03
State : Active
Virtual MAC : 000f-e2ff-4013 (Owner)
Owner ID : 0000-5e01-1105
Priority : 255
Active : local
Forwarder Weight Track Information:
Track Object : 1 State : Positive Weight Reduced : 250
以上显示信息表示,Timeout Timer超时后,删除虚拟MAC地址000f-e2ff-4011对应的虚拟转发器,不再转发目的MAC地址为该MAC的报文。
# Switch A出现故障后,通过display vrrp ipv6 verbose命令查看Switch B上备份组的详细信息。
[SwitchB-Vlan-interface2] display vrrp ipv6 verbose
IPv4 Standby Information:
Run Mode : Load Balance
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : FE80::10
1::10
Member IP List : FE80::2 (Local, Master)
FE80::3 (Backup)
Forwarder Information: 2 Forwarders 1 Active
Config Weight : 255
Running Weight : 255
Forwarder 02
State : Active
Virtual MAC : 000f-e2ff-4012 (Owner)
Owner ID : 0000-5e01-1103
Priority : 255
Active : local
Forwarder 03
State : Listening
Virtual MAC : 000f-e2ff-4013 (Learnt)
Owner ID : 0000-5e01-1105
Priority : 127
Active : FE80::3
Forwarder Weight Track Information:
Track Object : 1 State : Positive Weight Reduced : 250
以上显示信息表示Switch A出现故障后,Switch B的优先级高于Switch C,将抢占成为Master设备。
l Switch A上的配置
#
ipv6
#
vrrp mode load-balance
#
vlan 2 to 3
#
interface Vlan-interface2
ipv6 address 1::1 64
ipv6 address FE80::1 link-local
undo ipv6 nd ra halt
vrrp ipv6 vrid 1 virtual-ip FE80::10 link-local
vrrp ipv6 vrid 1 virtual-ip 1::10
vrrp ipv6 vrid 1 priority 120
vrrp ipv6 vrid 1 preempt-mode timer delay 5
vrrp ipv6 vrid 1 weight track 1 reduced 250
#
interface Vlan-interface3
ipv6 address 2003::2/64
#
interface GigabitEthernet1/0/3
port access vlan 3
#
interface GigabitEthernet1/0/5
port access vlan 2
#
track 1 interface vlan-interface 3
#
l SwitchB上的配置
ipv6
#
vrrp mode load-balance
#
vlan 2
#
interface Vlan-interface2
ipv6 address 1::2 64
ipv6 address FE80::2 link-local
undo ipv6 nd ra halt
vrrp ipv6 vrid 1 virtual-ip FE80::10 link-local
vrrp ipv6 vrid 1 virtual-ip 1::10
vrrp ipv6 vrid 1 priority 110
vrrp ipv6 vrid 1 preempt-mode timer delay 5
vrrp ipv6 vrid 1 weight track 1 reduced 250
#
interface GigabitEthernet1/0/5
port access vlan 2
#
track 1 interface vlan-interface 3
#
l SwitchC上的配置
#
ipv6
#
vrrp mode load-balance
#
vlan 2
#
interface Vlan-interface2
ipv6 address 1::3 64
ipv6 address FE80::3 link-local
undo ipv6 nd ra halt
vrrp ipv6 vrid 1 virtual-ip FE80::10 link-local
vrrp ipv6 vrid 1 virtual-ip 1::10
vrrp ipv6 vrid 1 preempt-mode timer delay 5
vrrp ipv6 vrid 1 weight track 1 reduced 250
#
interface GigabitEthernet1/0/5
port access vlan 2
#
track 1 interface vlan-interface 3
#
l VRRP工作在负载均衡模式时,虚拟IPv6地址不能与VRRP备份组中路由器的接口IPv6地址相同,即负载均衡模式的VRRP备份组中不能存在IP地址拥有者。
l 缺省情况下,虚拟转发器的权重为255;虚拟转发器的失效下限为10。VF Owner的权重高于或等于失效下限时,它的优先级始终为255,不会根据虚拟转发器的权重改变。因此只有配置的权重降低数额能够保证监视的上行链路出现故障时VF Owner的权重低于失效下限,其他的虚拟转发器才能接替VF Owner成为AVF。
l 对于同一个VRRP备份组的配置,必须保证备份组虚拟路由器的IP地址个数、每个备份组虚拟路由器的IP地址、定时器间隔时间和认证方式完全一样。
l 如果网络流量过大或者不同的交换机上的定时器差异等因素,会导致Backup设备的定时器异常超时而发生状态转换。对于这种情况,可以通过将VRRP通告报文的发送时间间隔延长和设置抢占延迟时间的办法来解决。
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!