华为USG6000v防火墙双机热备综合实验

实验背景:
笔者最近在工作中接触到华为的防火墙,第一感触就是华为防火墙与其它厂商的防火墙在双机热备切换方面有点不同,华为引入了私有协议。
Vgmp(VRRP Group Management Protocol),VRRP组管理协议。由于双机热备导致设备出问题时可能会来回路径不一致,因为主备切换了配置VGMP保证一个组内的VRRP全为Active,如果有一个不是,则全部切换至Standby
HRP ( Huawei Redundancy Protocol)华为冗余协议,用于主设备出现问题时,备能快速切换至主,同时保证了主备之间的配置命令和会话表状态信息同步。
实验拓扑:
华为USG6000v防火墙双机热备综合实验_第1张图片
实验目标
1、在主墙上增加策略,配置和会话可同步到备墙,且只可以在主墙上增加策略,备墙无法增加策略
2、实现双机热备的功能,关闭主防火墙,备墙切换为主状态,业务恢复
3、关闭IPS上联的e0/1口,此时主防火墙的G1/0/0状态仍为UP,使用IP-LINK的ICMP与HRP的联动,实现主备墙的切换
实验环境
1、基于EVE-NG模拟器
2、防火墙使用华为USG6000V镜像
3、交换机使用二层交换机镜像
4、IPS为透明模式,使用交换机的镜像模拟,工作在二层
开始配置
一、交换机
SW1:
Vlan 2
vlan 4
interface Ethernet0/0
switchport access vlan 2
switchport mode access
duplex auto

interface Ethernet0/1
switchport access vlan 4
switchport mode access
duplex auto

interface Ethernet0/3
switchport trunk encapsulation dot1q
switchport mode trunk
duplex auto

interface Vlan2
ip address 12.1.1.4 255.255.255.0
vrrp 2 ip 12.1.1.6
vrrp 2 priority 120

interface Vlan4
ip address 14.1.1.1 255.255.255.0
vrrp 4 ip 14.1.1.3
vrrp 4 priority 120

ip route 0.0.0.0 0.0.0.0 12.1.1.3
SW2:
Vlan 2
vlan 4
interface Ethernet0/0
switchport access vlan 2
switchport mode access
duplex auto
!
interface Ethernet0/1
switchport access vlan 4
switchport mode access
duplex auto

interface Ethernet0/3
switchport trunk encapsulation dot1q
switchport mode trunk
duplex auto
!
interface Vlan2
ip address 12.1.1.5 255.255.255.0
vrrp 2 ip 12.1.1.6
!
interface Vlan4
ip address 14.1.1.2 255.255.255.0
vrrp 4 ip 14.1.1.3

ip route 0.0.0.0 0.0.0.0 12.1.1.3
IPS(交换机模拟):
interface Ethernet0/0
switchport access vlan 2
switchport mode access
duplex auto
!
interface Ethernet0/1
switchport access vlan 2
switchport mode access
duplex auto
!
二、华为USG6000V
HUSG6000v-01:
sysname FW_A

interface GigabitEthernet0/0/0
undo shutdown
ip binding -instance default
ip address 192.168.136.101 255.255.255.0 /主墙的管理地址
service-manage http permit
service-manage https permit
service-manage ping permit
service-manage ssh permit

interface GigabitEthernet1/0/0
undo shutdown
ip address 12.1.1.1 255.255.255.0
vrrp vrid 1 virtual-ip 12.1.1.3 active /主墙上联接口VRRP为主模式, 加入到Active管理监控组

interface GigabitEthernet1/0/1
undo shutdown
ip address 13.1.1.1 255.255.255.0
vrrp vrid 1 virtual-ip 12.1.1.3 active /主墙下联接口VRRP为主模式, 加入到Active管理监控组

interface Eth-Trunk10
description HA_Link
ip address 1.1.1.1 255.255.255.0 /心跳地址
load-balance packet-all
service-manage ping permit

interface GigabitEthernet1/0/3
undo shutdown
eth-trunk 10 /心跳接口捆绑
interface GigabitEthernet1/0/4
undo shutdown
eth-trunk 10 /心跳接口捆绑

ip-link check enable /开启ip-link探测机制
ip-link name sla /定义ip-link名称为sla
destination 12.1.1.4 interface GigabitEthernet1/0/0 mode icmp /设置ip-link探测地址和出接口,采用ICMP包探测方式

hrp enable /开启hrp
hrp interface Eth-Trunk10 remote 1.1.1.2 /设置hrp检测备墙的对端心跳地址
hrp track interface GigabitEthernet1/0/0 /设置hrp跟踪上联接口链路状态
hrp track ip-link sla /设置hrp跟踪ip-link状态

firewall zone trust
set priority 85
add interface GigabitEthernet0/0/0
add interface GigabitEthernet1/0/0
add interface Eth-Trunk10

firewall zone untrust
set priority 5
add interface GigabitEthernet1/0/1

ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet1/0/0 12.1.1.6
HUSG6000v-02:
sysname FW_B

interface GigabitEthernet0/0/0
undo shutdown
ip binding -instance default
ip address 192.168.136.102 255.255.255.0 /备墙的管理地址
service-manage http permit
service-manage https permit
service-manage ping permit
service-manage ssh permit
service-manage snmp permit
service-manage telnet permit
service-manage netconf permit

interface GigabitEthernet1/0/0
undo shutdown
ip address 12.1.1.2 255.255.255.0
vrrp vrid 1 virtual-ip 12.1.1.3 standby /备墙上联接口VRRP为备模式, 加入到standby管理监控组

interface GigabitEthernet1/0/1
undo shutdown
ip address 13.1.1.2 255.255.255.0
vrrp vrid 1 virtual-ip 12.1.1.3 standby /备墙下联接口VRRP为备模式, 加入到standby管理监控组

interface Eth-Trunk10
description HA_Link
ip address 1.1.1.2 255.255.255.0 /心跳地址
load-balance packet-all
service-manage ping permit

interface GigabitEthernet1/0/3
undo shutdown
eth-trunk 10 /心跳接口捆绑
interface GigabitEthernet1/0/4
undo shutdown
eth-trunk 10 /心跳接口捆绑

hrp enable /开启hrp
hrp interface Eth-Trunk10 remote 1.1.1.1 /设置hrp检测备墙的对端心跳地址
hrp track interface GigabitEthernet1/0/0 /设置hrp跟踪上联接口链路状态

firewall zone trust
set priority 85
add interface GigabitEthernet0/0/0
add interface GigabitEthernet1/0/0
add interface Eth-Trunk10

firewall zone untrust
set priority 5
add interface GigabitEthernet1/0/1

ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet1/0/0 12.1.1.6
三、其它
客户机Client:
IP地址:13.1.1.100/24
网关:13.1.1.3
服务器Server:
IP地址:14.1.1.100/24
网关:14.1.1.3
实验现象
实验现象一、在主墙上增加策略,配置和会话可同步到备墙,且只可以在主墙上增加策略,备墙无法增加策略
1、主备墙上默认自带的策略配置
华为USG6000v防火墙双机热备综合实验_第2张图片
2、尝试在备墙上192.168.136.102添加一条any到any的策略,备墙提示报错,说明只能在主墙增加策略。
华为USG6000v防火墙双机热备综合实验_第3张图片
3、在主墙192.168.136.101上添加策略,备墙自动同步配置,也可手动同步。
华为USG6000v防火墙双机热备综合实验_第4张图片
华为USG6000v防火墙双机热备综合实验_第5张图片
华为USG6000v防火墙双机热备综合实验_第6张图片
4、在Client(13.1.1.100)客户机上ping 14.1.1.100服务器,同时查看主墙和备墙的会话表,主备墙会话可自动同步。
在这里插入图片描述
华为USG6000v防火墙双机热备综合实验_第7张图片
华为USG6000v防火墙双机热备综合实验_第8张图片
实验现象二、实现双机热备的功能,关闭主防火墙,备墙切换为主状态,业务恢复
1、关闭主墙前,先在备墙心跳接口抓个包,同时查看主墙的hrp状态和接口的vrrp状态
华为USG6000v防火墙双机热备综合实验_第9张图片
华为USG6000v防火墙双机热备综合实验_第10张图片
由于主墙的上下联接口VRRP模式被设置为Active,所以主墙的HRP的状态为Active。且hrp默认为抢占模式,配置缺省。
华为USG6000v防火墙双机热备综合实验_第11张图片
华为USG6000v防火墙双机热备综合实验_第12张图片
主墙的上下联接口VRRP状态都为Master,为转发状态,这样解决了传统VRRP在防火墙应用中来回路径不一致的问题。
2、关闭主墙前,查看备墙的hrp状态和接口的vrrp状态
华为USG6000v防火墙双机热备综合实验_第13张图片
由于备墙的上下联接口VRRP模式被设置为Standby,所以备墙的HRP的状态为standby。
华为USG6000v防火墙双机热备综合实验_第14张图片
华为USG6000v防火墙双机热备综合实验_第15张图片

备墙的上下联接口VRRP状态都为Backup,为备份侦听状态,这样解决了传统VRRP在防火墙应用中来回路径不一致的问题。
3、关闭主墙,备墙hrp状态变为主状态,且上下联接口vrrp的Master IP变为自己接口的地址,上下联接口地址进入转发状态。
华为USG6000v防火墙双机热备综合实验_第16张图片
华为USG6000v防火墙双机热备综合实验_第17张图片
备墙HRP状态由Standby变为Active,且peer为未知状态。
华为USG6000v防火墙双机热备综合实验_第18张图片
华为USG6000v防火墙双机热备综合实验_第19张图片
当备墙HRP状态切换为主,备墙上下联接口全部转变为Master状态,进入转发状态。
实验现象三、关闭IPS上联的e0/1口,此时主防火墙的G1/0/0状态仍为UP,使用IP-LINK的ICMP与HRP的联动,实现主备墙的切换
1、主墙上添加相关命令
ip-link check enable /开启ip-link探测机制
ip-link name sla /定义ip-link名称为sla
destination 12.1.1.4 interface GigabitEthernet1/0/0 mode icmp /设置ip-link探测地址和出接口,采用ICMP包探测方式
hrp track ip-link sla /hrp调用ip-link sla
2、关闭IPS的上联接口,查看主墙的HRP的相关状态
华为USG6000v防火墙双机热备综合实验_第20张图片
华为USG6000v防火墙双机热备综合实验_第21张图片
华为USG6000v防火墙双机热备综合实验_第22张图片
主墙先是检测到12.1.1.4不可达,接着把Ip-link状态置为down,由于hrp的状态track了ip-link的状态
所以主墙的HRP变为Standy状态,上下联接口状态也随之变为Backup状态,无法转发数据
3、查看备墙的hrp状态
华为USG6000v防火墙双机热备综合实验_第23张图片
华为USG6000v防火墙双机热备综合实验_第24张图片
华为USG6000v防火墙双机热备综合实验_第25张图片
备墙的HRP状态由Backup变为Active,且备墙上的所有上下联接口VRRP状态全部由Backup变为Active状态
总结
华为防火墙引入VGMP(VRRP Group Management Protocol)来实现对VRRP备份组的统一管理,保证多个VRRP备份组状态的一致性。我们将防火墙上的所有VRRP备份组都加入到一个VGMP组中,由VGMP组来集中监控并管理所有的VRRP备份组状态。如果VGMP组检测到其中一个VRRP备份组的状态变化,则VGMP组会控制组中的所有VRRP备份组统一进行状态切换,保证各VRRP备份组状态的一致性。双机热备协议HRP(Huawei Redundancy Protocol)协议是承载在VGMP(Vrrp Group Management Protocol)报文上进行传输的,在Master和Backup防火墙设备之间备份关键配置命令和会话表状态信息,是双机热备协议。VGMP、HRP是华为私有协议,当主墙HRP状态由Active变为Backup的时候,主墙上所有接口的VRRP状态全部由Master变为Backup状态,此时,备墙的HRP状态由Backup变为Active,且备墙上的所有上下联接口VRRP状态全部由Backup变为Active状态,充分保证了来回路径的一致性。

你可能感兴趣的:(华为USG6000v防火墙双机热备综合实验)