2009/04/27

华为系列交换机VRRP双机冗余配置

基于 IPv4 的 VRRP 典型配置举例:

一: VRRP 单备份组配置举例

组网需求
1,Host需要访问 Internet,Host的缺省网关为202.38.160.111/24;
2,Switch A 和 Switch B 属于虚拟 IP 地址为 202.38.160.111/24 的备份组 1;
3,当 Switch A 正常工作时,Host A 发送给 Host B 的报文通过 Switch A 转发;
当 Switch A 出现故障时,Host A 发送给 Host B 的报文通过 Switch B 转发。

配置步骤:
(1) 配置 Switch A
# 配置 VLAN2。
system-view
[SwitchA] vlan 2
[SwitchA-vlan2] port GigabitEthernet 2/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。默认优先级为100。
[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。
system-view
[SwitchB] vlan 2
[SwitchB-Vlan2] port GigabitEthernet 2/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


VRRP 监视接口配置举例:
当 Switch A 连接 Internet 的 VLAN 接口 3 不可用时,Host A 发送给 Host B 的报文通过 Switch B 转发。

# 设置备份组的认证方式为 SIMPLE 认证,认证字为 hello。
[SwitchA-Vlan-interface2] vrrp vrid 1 authentication-mode simple hello
# 设置 Master 发送 VRRP 报文的间隔时间为 5 秒。
[SwitchA-Vlan-interface2] vrrp vrid 1 timer advertise 5
# 设置监视接口。
[SwitchA-Vlan-interface2] vrrp vrid 1 track interface vlan-interface 3 reduced 30


VRRP 多备份组配置举例:

组网需求
1,202.38.160.0/24 网段内部分主机的缺省网关为 202.38.160.111/24,部分主机的缺省网关为 202.38.160.112/24;
2,利用 VRRP 备份组实现缺省网关间的负载分担和相互备份。


配置 Switch A
# 配置 VLAN2。
system-view
[SwitchA] vlan 2
[SwitchA-vlan2] port GigabitEthernet 2/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
# 创建备份组 2,并配置备份组 2 的虚拟 IP 地址为 202.38.160.112。
[SwitchA-Vlan-interface2] vrrp vrid 2 virtual-ip 202.38.160.112

配置 Switch B
# 配置 VLAN2。
system-view
[SwitchB] vlan 2
[SwitchB-vlan2] port GigabitEthernet 2/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
# 创建备份组 2,并配置备份组 2 的虚拟 IP 地址为 202.38.160.112。
[SwitchB-Vlan-interface2] vrrp vrid 2 virtual-ip 202.38.160.112
# 设置 Switch B 在备份组 2 中的优先级为 110。
[SwitchB-Vlan-interface2] vrrp vrid 2 priority 110

验证配置结果
可以通过 display vrrp 命令查看配置后的结果。
# 显示 Switch A 上备份组的详细信息。
[SwitchA-Vlan-interface2] display vrrp verbose


VRRP 常见错误配置举例:

一:控制台上频频出现配置错误的提示

原因分析:
1,可能是备份组内的另一台交换机配置不一致造成的。
2,可能是有的机器试图发送非法的 VRRP 报文。

解决方法:
1,对于第一种情况,可以通过修改配置来解决。
2,对于第二种情况,则是有些机器有不良企图,应当通过非技术手段来解决。

二:同一个备份组内出现多个 Master 交换机

原因分析:
1,若短时间内存在多个Master 交换机,属于正常情况,无需进行人工干预。
2,若多个Master 交换机长时间共存,这很有可能是由于Master 交换机之间收不到VRRP报文,或者收到的报文不合法造成的。

解决方法:先在多个Master 交换机之间执行ping 操作。如果ping 不通,则检查网络连接是否正确;如果能ping 通,则检查VRRP 的配置是否一致。对于同一个VRRP 备份组的配置,必须要保证虚拟IP 地址个数、每个虚拟IP 地址、通告报文的发送时间间隔和认证方式完全一样。

三:VRRP 的状态频繁转换
原因分析:这种情况一般是由于 VRRP 通告报文发送时间间隔太短造成的。
解决方法:增加通告报文的发送时间间隔或者设置抢占延迟都可以解决这种故障。

没有评论:

发表评论