对于S3610&S5510系列交换机,整机最多能够创建16个IPv6备份组;一个备份组最多可以配置6个虚拟IPv6地址。
备份组中所有虚拟IPv6地址都被删除后,该备份组也将同时被删除掉,并且该备份组的所有配置都不再有效。
删除IP地址拥有者上的VRRP备份组,将导致地址冲突。建议通过修改IP地址拥有者的接口IPv6地址的方式解决地址冲突。
1.3.4 配置备份组优先级、抢占方式及监视指定接口
1. 配置准备
在配置备份组优先级、抢占方式及监视指定接口之前,需要先在接口上创建备份组并配置虚拟IPv6地址。 2. 配置过程
通过优先级、抢占方式和监视指定接口的配置,可以决定备份组中哪个路由器作为Master路由器。下面这些配置是可选的,可以根据实际需要进行配置。
表1-11 配置备份组优先级、抢占方式及监视指定接口
操作 进入系统视图 进入VLAN接口或三层以太网接口视图 配置路由器在备份组中的优先级 配置备份组中的路由器工作在抢占方式,并配置抢占延迟时间 system-view 命令 - 说明 interface interface-type interface-number - 可选 缺省情况下,路由器在备份组中的优先级为100 可选 缺省情况下,备份组中的路由器工作在抢占方式,抢占延迟时间为0秒 可选 缺省情况下,没有指定被监视的接口 vrrp ipv6 vrid virtual-router-id prioritypriority-value vrrp ipv6 vrid virtual-router-idpreempt-mode [ timer delaydelay-value ] vrrp ipv6 vrid virtual-router-id track interface interface-type interface-number [ reduced priority-reduced ] 配置监视指定接口
IP地址拥有者的运行优先级始终为255,无需用户配置;IP地址拥有者始终工作在抢占方式。
不允许对IP地址拥有者进行监视指定接口的配置。 被监视的接口可以是三层以太网接口和VLAN接口。
被监视接口的状态由down变为up后,对应设备的优先级数会自动恢复。
1.3.5 配置VRRP报文的相关属性
1. 配置准备
在配置VRRP报文的相关属性之前,需要先在接口上创建备份组并配置虚拟IPv6地址。 2. 配置过程
表1-12 配置VRRP报文的相关属性
操作 进入系统视图 进入VLAN接口或三层以太网接口视图 配置备份组发送和接收VRRP报文的认证方式和认证字 system-view interface interface-type interface-number vrrp ipv6 vrid virtual-router-id authentication-mode simplekey 命令 - - 可选 缺省情况下,不进行认证 可选 配置备份组中Master路由器发送VRRP通告报文的时间间隔 vrrp ipv6 vrid virtual-router-id timeradvertiseadver-interval 缺省情况下,备份组中Master路由器发送VRRP通告报文的时间间隔为100厘秒 说明
一个接口上的不同备份组可以设置不同的认证方式和认证字;加入同一备份组的成员需要设置相同的认证方式和认证字。
如果网络流量过大或者不同的路由器上的定时器差异等因素,会导致Backup路由器的定时器异常超时而发生状态转换。对于这种情况,可以通过将VRRP通告报文的发送时间间隔延长和设置抢占延迟时间的办法来解决。
1.3.6 基于IPv6的VRRP显示和维护
在完成上述配置后,在任意视图下执行display命令可以显示基于IPv6的VRRP配置后的运行情况,通过查看显示信息验证配置的效果。
在用户视图下执行reset命令可以清除基于IPv6的VRRP统计信息。
表1-13 VRRP显示和维护
操作 显示VRRP的状态信息 显示VRRP的统计信息 清除VRRP的统计信息 命令 displayvrrp ipv6[ verbose ][ interfaceinterface-type interface-number [vrid virtual-router-id ] ] display vrrpipv6 statistics[ interface interface-type interface-number [ vridvirtual-router-id ] ] reset vrrp ipv6 statistics [ interface interface-type interface-number [ vridvirtual-router-id ]]
1.4 基于IPv4的VRRP典型配置举例
1.4.1 VRRP单备份组配置举例
1. 组网需求
Host A需要访问Internet上的Host B,Host A的缺省网关为202.38.160.111/24; Switch A和Switch B属于虚拟IP地址为202.38.160.111/24的备份组1; 当Switch A正常工作时,Host A发送给Host B的报文通过Switch A转发;当Switch
A出现故障时,Host A发送给Host B的报文通过Switch B转发。 2. 组网图
图1-7 VRRP单备份组配置组网图
Virtual IP address: 202.38.160.111/24Vlan-int2202.38.160.1/24Switch A202.38.160.3/24203.2.3.1/24InternetHost BVlan-int2202.38.160.2/24Host ASwitch B
3. 配置步骤 (1) 配置Switch A # 配置VLAN2。
[SwitchA-vlan2] port ethernet 1/0/5 [SwitchA-vlan2] quit
[SwitchA] interface vlan-interface 2
[SwitchA-Vlan-interface2] ip address 202.38.160.1 255.255.255.0
# 创建备份组1,并配置备份组1的虚拟IP地址为202.38.160.111。
[SwitchA-Vlan-interface2] vrrp vrid 1 virtual-ip 202.38.160.111
# 设置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
(2) 配置Switch B # 配置VLAN2。
[SwitchB-Vlan2] port ethernet 1/0/5 [SwitchB-vlan2] quit
[SwitchB] interface vlan-interface 2
[SwitchB-Vlan-interface2] ip address 202.38.160.2 255.255.255.0
# 创建备份组1,并配置备份组1的虚拟IP地址为202.38.160.111。
[SwitchB-Vlan-interface2] vrrp vrid 1 virtual-ip 202.38.160.111
# 设置Switch B工作在抢占方式,抢占延迟时间为5秒。
[SwitchB-Vlan-interface2] vrrp vrid 1 preempt-mode timer delay 5
(3) 验证配置结果
配置完成后,在Host A上可以ping通Host B。通过display vrrp verbose命令查看配置后的结果。
# 显示Switch A上备份组1的详细信息。
[SwitchA-Vlan-interface2] display vrrp verbose IPv4 Standby Information: 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 Run Pri : 110 Preempt Mode : YES Delay Time : 5 Auth Type : NONE
Virtual IP : 202.38.160.111 Virtual MAC : 0000-5e00-0101 Master IP : 202.38.160.1
# 显示Switch B上备份组1的详细信息。
[SwitchB-Vlan-interface2] display vrrp verbose IPv4 Standby Information: 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 Run Pri : 100 Preempt Mode : YES Delay Time : 5 Auth Type : NONE
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 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 Run Pri : 100 Preempt Mode : YES Delay Time : 5 Auth Type : NONE
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转发。
1.4.2 VRRP监视接口配置举例
1. 组网需求
Host A需要访问Internet上的Host B,Host A的缺省网关为202.38.160.111/24; Switch A和Switch B属于虚拟IP地址为202.38.160.111/24的备份组1; 当Switch A正常工作时,Host A发送给Host B的报文通过Switch A转发;当Switch
A连接Internet的VLAN接口3不可用时,Host A发送给Host B的报文通过Switch B转发。 2. 组网图
图1-8 VRRP监视接口配置组网图
Virtual IP address: 202.38.160.111/24Vlan-int2202.38.160.1/24Vlan-int3Switch A202.38.160.3/24203.2.3.1/24InternetHost BVlan-int2202.38.160.2/24Host ASwitch B
3. 配置步骤 (1) 配置Switch A # 配置VLAN2。
[SwitchA-vlan2] port ethernet 1/0/5 [SwitchA-vlan2] quit
[SwitchA] interface vlan-interface 2
[SwitchA-Vlan-interface2] ip address 202.38.160.1 255.255.255.0
# 创建备份组1,并配置备份组1的虚拟IP地址为202.38.160.111。
[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
# 设置Master发送VRRP报文的间隔时间为5秒。
[SwitchA-Vlan-interface2] vrrp vrid 1 timer advertise 5