实操三 负载局衡
[Mater-vrrp]vrr
[Mater-vrrp]vrrp mo
[Mater-vrrp]vrrp mode ?
load-balance Set the VRRP operating mode to load balance
[Mater-vrrp]vrrp mode lo
[Mater-vrrp]vrrp mode load-balance //VRRP 开启负载均衡的模式
[Mater-vrrp]
删除主设备命令
display current-configuration
sys
interface GigabitEthernet 0/0
display this
undo ip address 10.1.1.1 255.255.255.0
undo vrrp vrid 1 virtual-ip 10.1.1.111
undo vrrp vrid 1
undo vrrp vrid 1 preempt-mode delay
undo vrrp vrid 2 virtual-ip 10.1.1.112
display this
删除备份设备的命令
sys
interface GigabitEthernet 0/0
display this
undo ip address 10.1.1.2 255.255.255.0
undo vrrp vrid 1 virtual-ip 10.1.1.111
undo vrrp vrid 1 preempt-mode delay
undo vrrp vrid 2 virtual-ip 10.1.1.112
undo vrrp vrid 2 priority
undo vrrp vrid 2 preempt-mode delay
主设备
vrrp mode load-balance 开启负载局衡模式
track 1 interface GigabitEthernet0/1 //链路追踪的接口
#
interface GigabitEthernet0/2
port link-mode route
combo enable copper
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 delay 5000
vrrp vrid 1 track 1 weight reduced 250
#
备份设备
vrrp mode load-balance 开启负载局衡模式
track 1 interface GigabitEthernet0/1
#
interface GigabitEthernet0/2
port link-mode route
combo enable copper
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 delay 5000
vrrp vrid 1 track 1 weight reduced 250
#
备份设备 2
vrrp mode load-balance 开启负载局衡模式
track 1 interface GigabitEthernet0/1
#
interface GigabitEthernet0/2
port link-mode route
combo enable copper
ip address 10.1.1.4 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.1
vrrp vrid 1 preempt-mode delay 5000
vrrp vrid 1 track 1 weight reduced 250
#
VRRPV3 负载均衡
(1) 配置Router A
# 配置VRRP工作在负载均衡模式。
<RouterA> system-view
[RouterA] vrrp ipv6 mode load-balance
# 创建备份组1,并配置备份组1的虚拟IPv6地址为FE80::10和1::10。
[RouterA] interface gigabitethernet 1/0/1
[RouterA-GigabitEthernet1/0/1] ipv6 address fe80::1 link-local
[RouterA-GigabitEthernet1/0/1] ipv6 address 1::1 64
[RouterA-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
[RouterA-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 virtual-ip 1::10
# 配置Router A在备份组1中的优先级为120,高于Router B的优先级110和Router C的优先级100,以保证Router A成为Master。
[RouterA-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 priority 120
# 配置Router A工作在抢占方式,以保证Router A故障恢复后,能再次抢占成为Master,即只要Router A正常工作,Router A就会成为Master。为了避免频繁地进行状态切换,配置抢占延迟时间为5000厘秒。
[RouterA-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 preempt-mode delay 5000
# 配置允许发布RA消息,以便1::/64网段内主机通过RA消息学习到缺省网关地址。
[RouterA-GigabitEthernet1/0/1] undo ipv6 nd ra halt
[RouterA-GigabitEthernet1/0/1] quit
# 创建和上行接口GigabitEthernet1/0/2物理状态关联的Track项1。如果Track项的状态为Negative,则说明Router A的上行接口出现故障。
[RouterA] track 1 interface gigabitethernet 1/0/2
# 配置虚拟转发器监视Track项1。Track项的状态为Negative时,降低Router A上虚拟转发器的权重,使其低于失效下限10,即权重降低的数额大于245,以便其它设备接替Router A的转发任务。本例中,配置虚拟转发器权重降低数额为250。
[RouterA] interface gigabitethernet 1/0/1
[RouterA-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 track 1 weight reduced 250
(2) 配置Router B
# 配置VRRP工作在负载均衡模式。
<RouterB> system-view
[RouterB] vrrp ipv6 mode load-balance
# 创建备份组1,并配置备份组1的虚拟IP地址为FE80::10和1::10。
[RouterB] interface gigabitethernet 1/0/1
[RouterB-GigabitEthernet1/0/1] ipv6 address fe80::2 link-local
[RouterB-GigabitEthernet1/0/1] ipv6 address 1::2 64
[RouterB-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
[RouterB-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 virtual-ip 1::10
# 配置Router B在备份组1中的优先级为110,高于Router C的优先级100,以保证Router A出现故障时,Router B成为Master。
[RouterB-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 priority 110
# 配置Router B工作在抢占方式,抢占延迟时间为5000厘秒。
[RouterB-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 preempt-mode delay 5000
# 配置允许发布RA消息,以便1::/64网段内主机通过RA消息学习到缺省网关地址。
[RouterB-GigabitEthernet1/0/1] undo ipv6 nd ra halt
[RouterB-GigabitEthernet1/0/1] quit
# 创建和上行接口GigabitEthernet1/0/2物理状态关联的Track项1。如果Track项的状态为Negative,则说明Router B的上行接口出现故障。
[RouterB] track 1 interface gigabitethernet 1/0/2
# 配置虚拟转发器监视Track项1。Track项的状态为Negative时,降低Router B上虚拟转发器的权重,使其低于失效下限10,即权重降低的数额大于245,以便其它设备接替Router B的转发任务。本例中,配置虚拟转发器权重降低数额为250。
[RouterB] interface gigabitethernet 1/0/1
[RouterB-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 track 1 weight reduced 250
(3) 配置Router C
# 配置VRRP工作在负载均衡模式。
<RouterC> system-view
[RouterC] vrrp ipv6 mode load-balance
# 创建备份组1,并配置备份组1的虚拟IP地址为FE80::10和1::10。
[RouterC] interface gigabitethernet 1/0/1
[RouterC-GigabitEthernet1/0/1] ipv6 address fe80::3 link-local
[RouterC-GigabitEthernet1/0/1] ipv6 address 1::3 64
[RouterC-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
[RouterC-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 virtual-ip 1::10
# 配置Router C工作在抢占方式,抢占延迟时间为5000厘秒。
[RouterC-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 preempt-mode delay 5000
# 配置允许发布RA消息,以便1::/64网段内主机通过RA消息学习到缺省网关地址。
[RouterC-GigabitEthernet1/0/1] undo ipv6 nd ra halt
[RouterC-GigabitEthernet1/0/1] quit
# 创建和上行接口GigabitEthernet1/0/2物理状态关联的Track项1。如果Track项的状态为Negative,则说明Router C的上行接口出现故障。
[RouterC] track 1 interface gigabitethernet 1/0/2
# 配置虚拟转发器监视Track项1。Track项的状态为Negative时,降低Router C上虚拟转发器的权重,使其低于失效下限10,即权重降低的数额大于245,以便其它设备接替Router C的转发任务。本例中,配置虚拟转发器权重降低数额为250。
[RouterC] interface gigabitethernet 1/0/1
[RouterC-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 track 1 weight reduced 250
4. 验证配置
配置完成后,在Host A上可以ping通外网。通过display vrrp ipv6 verbose命令查看配置后的结果。
# 显示Router A上备份组1的详细信息。
[RouterA-GigabitEthernet1/0/1] display vrrp ipv6 verbose