华为模拟器eNSP防火墙双机热备实验_eNSP双机热备

命令行配置

简要步骤如下:

  1. 配置所有接口IP
  2. 在防火墙上规划接口区域,所有接口允许被ping
  3. 防火墙配置安全策略,localany
  4. 配置虚拟地址并分配VRRP组以及备用设备组(这一步配置完之后,在R1R2测试ping网关)
  5. 主备防火墙配置HRP,以同步防火墙的策略和会话
  6. R1R2配置缺省路由,主防火墙放行TrustUntrust的策略

首先需要开启防火墙,但是这里需要改一下备用防火墙FW2的防火墙服务端口GE 0/0/0的IP地址,不然会和主防火墙FW1GEn0/0/0端口IP产生冲突

FW1:
sys
un in en
sysname FW1
dis ip int brief
FW2:
sys
un in en
sysname FW2
dis ip int brief
int g0/0/0 
ip address 192.168.0.2 24
dis this 
quit

防火墙接口配置IP地址并划分相应区域

FW1:
sys
int g1/0/0
ip add 192.168.1.254 24
dis this
int g1/0/6
ip add 172.16.1.254 24
dis this
int g1/0/1
ip add 202.1.1.254 24
dis this
quit
firewall zone trust
add int g1/0/0
dis this
firewall zone dmz
add int g1/0/6
dis this
firewall zone untrust
add int g1/0/1
dis this
quit
FW2:
sys
int g1/0/0
ip add 192.168.1.253 24
dis this
int g1/0/6
ip add 172.16.1.253 24
dis this
int g1/0/1
ip add 202.1.1.253 24
dis this
quit
firewall zone trust
add int g1/0/0
dis this
firewall zone dmz
add int g1/0/6
dis this
firewall zone untrust
add int g1/0/1
dis this
quit

防火墙所有接口开启ping服务,配置localany的安全策略

FW1:
sys
int g1/0/0
service-manage ping permit
dis this
int g1/0/6
service-manage ping permit
dis this
int g1/0/1
service-manage ping permit
dis this
quit
security-policy
rule name local_to_any
source-zone local
destination-zone any
action permit
dis this
quit
FW2:
sys
int g1/0/0
service-manage ping permit
dis this
int g1/0/6
service-manage ping permit
dis this
int g1/0/1
service-manage ping permit
dis this
quit
security-policy
rule name local_to_any
source-zone local
destination-zone any
action permit
dis this
quit

防火墙配置虚拟地址和VRRP组以及备用设备组

FW1:
int g1/0/0
vrrp vrid 1 virtual-ip 192.168.1.1 active
dis this
int g1/0/1
vrrp vrid 2 virtual-ip 202.1.1.1 active
dis this
dis vrrp bri
quit
FW2:
int g1/0/0
vrrp vrid 1 virtual-ip 192.168.1.1 standby
dis this
int g1/0/1
vrrp vrid 2 virtual-ip 202.1.1.1 standby
dis this
dis vrrp bri 
quit

R1R2配置接口地址,并测试ping网关(即防火墙vrrp虚拟地址)

R1:
sys
un in en
sysname R1
int e0/0/0
ip add 192.168.1.2 24
dis this
quit
R2:
sys
un in en
sysname R2
int e0/0/0
ip add 202.1.1.1 24
dis this
quit

验证结果:

华为模拟器eNSP防火墙双机热备实验_防火墙配置_02


华为模拟器eNSP防火墙双机热备实验_华为模拟器双机热备_03

主备防火墙配置相应的HRP协议,以同步主备防火墙之间的策略和会话

FW1:
sys
hrp enable
hrp int g1/0/6 remote 172.16.1.253
FW2:
sys
hrp enable
hrp standby-device
hrp int g1/0/6 remote 172.16.1.254

注意 : 处于standby状态的设备不允许配置安全策略(可以其他的),只允许在主设备配置安全策略,且安全策略会自动同步到备用设备上面。主设备配置安全策略,且安全策略会自动同步到备用设备上面,主设备配置由trust_to_untrust放行策略,备用设备会自动同步策略

R1R2上配置缺省路由并在主防火墙上配置trust_to_untrust的策略

R1:
sys
ip route-static 0.0.0.0 0 192.168.1.1
dis this
quit
dis ip routing-table
R2: 
sys
ip route-static 0.0.0.0 0 202.1.1.2
dis this 
quit
dis ip routing-table
FW1:
sys
security-policy
rule name trust_to_untrust
source-zone trust
destination-zone untrust
action permit
dis this
quit
quit
dis security-policy all

到这里配置过程就结束了,接下来进行测试,关闭主防火墙的接口,模拟主防火墙出现故障,看看能够还能ping202.1.1.2

FW1:
sys
int g1/0/0
shutdown
dis this

华为模拟器eNSP防火墙双机热备实验_双机热备_04

shutdown掉了主防火墙的GE 1/0/0口,还是能够访问202.1.1.2,试验成功,其他的就懒的测试了

防火墙Web端配置

华为模拟器eNSP防火墙双机热备实验_安全策略_05


华为模拟器eNSP防火墙双机热备实验_防火墙配置_06