命令行配置
简要步骤如下:
- 配置所有接口IP
- 在防火墙上规划接口区域,所有接口允许被
ping
- 防火墙配置安全策略,
local
到any
- 配置虚拟地址并分配VRRP组以及备用设备组(这一步配置完之后,在
R1
和R2
测试ping
网关)- 主备防火墙配置
HRP
,以同步防火墙的策略和会话R1
、R2
配置缺省路由,主防火墙
放行Trust
到Untrust
的策略首先需要开启防火墙,但是这里需要改一下
备用防火墙FW2
的防火墙服务端口GE 0/0/0
的IP地址,不然会和主防火墙FW1
的GEn0/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
服务,配置local
到any
的安全策略
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
R1
、R2
配置接口地址,并测试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
验证结果:
主备防火墙配置相应的
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
放行策略,备用设备会自动同步策略在
R1
和R2
上配置缺省路由并在主防火墙上配置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
到这里配置过程就结束了,接下来进行测试,关闭主防火墙的接口,模拟主防火墙出现故障,看看能够还能
ping
通202.1.1.2
FW1:
sys
int g1/0/0
shutdown
dis this
shutdown
掉了主防火墙的GE 1/0/0
口,还是能够访问202.1.1.2
,试验成功,其他的就懒的测试了防火墙Web端配置