防火墙双机热备,-防火墙双机热备 - 0 24
一、实验日期与地址
1、实验日期:2024年xx月xx日
2、实验地址:xxx
二、实验目的
1、掌握双机热备负载分担典型组网的配置方法;
2、理解双机热备的基本原理;
3、熟悉双机热备基本的组网模型;
4、理解VGMP和HRP协议。
三、实验环境
华为eNSP模拟器,实验拓扑如下:
图 业务口三层,上下行交换机的负载分担组网
四、实验内容
1、实验规划:
设备
接口
IP地址
安全区域
FW_A
GE 1/0/0
10.2.0.3/24
untrust
GE 1/0/1
10.3.0.3/24
trust
GE 0/0/0
10.10.0.1/30
dmz
FW_B
GE 1/0/0
10.2.0.4/24 拼多多帮助力入口
untrust
GE 1/0/1
10.3.0.4/24
trust
GE 0/0/0
10.10.0.2/30
dmz
AR1
GE 0/0/0
1.1.1.10/24
untrust
PC1
Eth 0/0/1
10.3.0.10/24
trust
Client1
Eth 0/0/0
10.3.0.20/24
trust
2、配置思路:
配置防火墙的IP地址、路由协议、安全区域,完成网络基本参数配置。配置防火墙双机热备,实现两台防火墙负载均衡。配置防火墙的安全策略,允许内网用户访问外网。配置路由器、交换机和PC终端等其他设备的网络参数,实现整网互联互通。验证和调试3、配置步骤:
步骤 1 防火墙网络基础配置
根据组网需要,在两台防火墙上配置接口IP地址、路由及安全区域,完成网络基本参数配置。
# 配置FW_A接口IP地址
system-view
[FW_A]interface g1/0/0
[FW_A-GigabitEthernet1/0/0]ip add 10.2.0.3 24
[FW_A-GigabitEthernet1/0/0]quit
[FW_A]interface g1/0/1
[FW_A-GigabitEthernet1/0/1]ip add 10.3.0.3 24
[FW_A-GigabitEthernet1/0/1]quit
[FW_A]interface g0/0/0
[FW_A-GigabitEthernet0/0/0]ip add 10.10.0.1 30
[FW_A-GigabitEthernet0/0/0]quit
# 配置FW_B接口IP地址
system-view
[FW_B]interface g1/0/0
[FW_B-GigabitEthernet1/0/0]ip add 10.2.0.4 24
[FW_B-GigabitEthernet1/0/0]quit
[FW_B]interface g1/0/1
[FW_B-GigabitEthernet1/0/1]ip add 10.3.0.4 24
[FW_B-GigabitEthernet1/0/1]quit
[FW_B]interface g0/0/0
[FW_B-GigabitEthernet0/0/0]ip add 10.10.0.2 30
[FW_B-GigabitEthernet0/0/0]quit
# 将FW_A各接口加入相应区域
[FW_A]firewall zone untrust
[FW_A-zone-untrust]add interface g1/0/0
[FW_A-zone-untrust]quit
[FW_A]firewall zone trust
[FW_A-zone-trust]add interface g1/0/1
[FW_A-zone-trust]quit
[FW_A]firewall zone dmz
[FW_A-zone-dmz]add interface g0/0/0
[FW_A-zone-dmz]quit
# 将FW_B各接口加入相应区域
[FW_B]firewall zone untrust
[FW_B-zone-untrust]add interface g1/0/0
[FW_B-zone-untrust]quit
[FW_B]firewall zone trust
[FW_B-zone-trust]add interface g1/0/1
[FW_B-zone-trust]quit
[FW_B]firewall zone dmz
[FW_B-zone-dmz]add interface g0/0/0
[FW_B-zone-dmz]quit
# 配置缺省路由
[FW_A]ip route-static 0.0.0.0 0.0.0.0 1.1.1.10
[FW_B]ip route-static 0.0.0.0 0.0.0.0 1.1.1.10
步骤 2 配置VRRP备份组
为了实现负载分担组网需要在每个业务接口上配置两个VRRP备份组,一个设置状态为Active,另一个设置状态为Standby。
# 配置FW_A的VRRP备份组
[FW_A] interface GigabitEthernet 1/0/0
[FW_A-GigabitEthernet1/0/0] vrrp vrid 1 virtual-ip 1.1.1.1 24 active
[FW_A-GigabitEthernet1/0/0] vrrp vrid 2 virtual-ip 1.1.1.2 24 standby
[FW_A-GigabitEthernet1/0/0] quit
[FW_A] interface GigabitEthernet 1/0/1
[FW_A-GigabitEthernet1/0/1] vrrp vrid 3 virtual-ip 10.3.0.1 active
[FW_A-GigabitEthernet1/0/1] vrrp vrid 4 virtual-ip 10.3.0.2 standby
[FW_A-GigabitEthernet1/0/1] quit
# 配置FW_B的VRRP备份组
[FW_B] interface GigabitEthernet 1/0/0
[FW_B-GigabitEthernet1/0/0] vrrp vrid 1 virtual-ip 1.1.1.1 24 standby
[FW_B-GigabitEthernet1/0/0] vrrp vrid 2 virtual-ip 1.1.1.2 24 active
[FW_B-GigabitEthernet1/0/0] quit
[FW_B] interface GigabitEthernet 1/0/1
[FW_B-GigabitEthernet1/0/1] vrrp vrid 3 virtual-ip 10.3.0.1 standby
[FW_B-GigabitEthernet1/0/1] vrrp vrid 4 virtual-ip 10.3.0.2 active
[FW_B-GigabitEthernet1/0/1] quit
步骤 3 启用会话快速备份
负载分担组网下,两台FW都转发流量,为了防止来回路径不一致,需要在两台FW上都配置会话快速备份功能。同时,指定心跳口并启用双机热备功能
# FW_A上启用会话快速备份并指定心跳口启用双机热备
[FW_A] hrp mirror session enable
[FW_A] hrp interface GigabitEthernet 0/0/0 remote 10.10.0.2
[FW_A] hrp enable
# FW_B上启用会话快速备份并指定心跳口启用双机热备
[FW_B] hrp mirror session enable
[FW_B] hrp interface GigabitEthernet 0/0/0 remote 10.10.0.1
[FW_B] hrp enable
步骤 4 配置安全策略
在FW_A上配置安全策略,允许内网访问Internet。双机热备状态成功建立后,在FW_A上配置安全策略。双机热备状态成功建立后,FW_A的安全策略配置会自动备份到FW_B上。
HRP_M[FW_A]security-policy
HRP_M[FW_A-policy-security]rule name trust_to_untrust
HRP_M[FW_A-policy-security-rule-trust_to_untrust]source-zone trust
HRP_M[FW_A-policy-security-rule-trust_to_untrust]source-address 10.3.0.0 24
HRP_M[FW_A-policy-security-rule-trust_to_untrust]destination-zone untrust
HRP_M[FW_A-policy-security-rule-trust_to_untrust]action permit
HRP_M[FW_A-policy-security-rule-trust_to_untrust]quit
步骤 5 配置其他网络设备
# 配置交换机
分别将两台交换机的三个接口加入同一个VLAN(华为设备接口默认在VLAN 1),将内网PC1的默认网关设置为VRRP备份组3的虚拟IP地址10.3.0.1,内网Client1的默认网关设置为VRRP备份组4的虚拟IP地址10.3.0.2。
# 配置路由器
配置R1接口地址,且在Router上配置到内网的等价路由,路由下一跳分别指向VRRP备份组1和VRRP备份组2的虚拟IP地址。
system-view
[R1] interface g0/0/0
[R1-GigabitEthernet0/0/0] ip address 1.1.1.10 24
[R1-GigabitEthernet0/0/0] quit
[R1] ip route-static 10.3.0.0 24 1.1.1.1
[R1] ip route-static 10.3.0.0 24 1.1.1.2
# 配置PC终端
将内网PC1的IP地址设置为10.3.0.10,掩码为255.255.255.0,网关为10.3.0.1;内网Client1的IP地址设置为10.3.0.20,掩码为255.255.255.0,网关为10.3.0.2。如下图:
步骤 6 验证和调试
# 查看VRRP备份组信息
在FW_A上查看VRRP备份组概要信息
在FW_A上查看VRRP备份组概要信息
以上输出信息显示,VRRP组建立成功,FW_A作为VRRP备份组1和3的Master设备,VRRP备份组2和4的Backup设备;FW_B作为VRRP备份组1和3的Backup设备,VRRP备份组2和4的Master设备。因此,正常情况下,内网终端PC1访问外网的流量由FW_A转发,PC2访问外网的流量由FW_B转发。
# 查看当前VGMP组的状态
在FW_A上查看VGMP组的当前状态
在FW_B上查看VGMP组的当前状态
# Ping测试
PC1和Client1能够ping通路由器R1。分别在FW_A和FW_B上检查会话。
综上,实验成功!
五、实验总结
实验结果显示,通过配置防火墙的负载分担和双机热备功能,成功实现:
负载分担:FW_A和FW_B共同转发流量,提升了网络性能和稳定性。双机热备:在主防火墙出现故障时,备防火墙能够迅速接管所有业务,确保网络不中断。具体如下:
在正常情况下,内网PC1访问外网的流量由FW_A转发,PC2访问外网的流量由FW_B转发。查看VRRP备份组和VGMP组状态,显示主备关系正常。进行Ping测试,PC1和PC2能够ping通外网路由器R1,显示会话信息在两台防火墙之间正常同步。