目录
拓扑图
配置步骤
1、设备互联接口配置
2、VRRP配置
3、开启HRP协议并指定心跳接口和对端IP地址
4、配置备份方式
5、配置NAT
结果验证
拓扑图
蓝色区域为Internet,红色区域为企业内部网络,防火墙之间互联接口为心跳线
配置步骤
1、设备互联接口配置
地址表
设备 | 端口 | 安全区域 | IP地址 | 对端设备 | 对端端口 | IP地址 | 安全区域 |
FW1 | G1/0/0 | trust | 192.168.1.10/24 | sw1 | G0/0/1 | ||
FW1 | G1/0/1 | trust | 192.168.2.10/24 | sw2 | G0/0/2 | ||
FW1 | G1/0/2 | untrust | 200.1.1.1/24 | sw3 | G0/0/1 | ||
FW1 | G1/0/6 | dmz | 10.1.1.1/24 | FW2 | G1/0/6 | 10.1.1.2/24 | dmz |
FW2 | G1/0/0 | trust | 192.168.2.20/24 | sw2 | G0/0/1 | ||
FW2 | G1/0/1 | trust | 192.168.1.20/24 | sw1 | G0/0/2 | ||
FW2 | G1/0/2 | untrust | 200.1.1.2/24 | sw3 | G0/0/2 | ||
R1 | G0/0/0 | 200.1.1.254/24 | sw3 | G0/0/3 | |||
R1 | Loopback0 | 202.1.1.1/32 |
根据规划表配置设备的IP地址
防火墙第一次登录是需要输入账号密码的,默认的账号密码为admin/Admin@123,第一次登陆会强制要求我们修改密码,我这里把密码修改为admin@123
FW1:
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.0.1/24 down down
GigabitEthernet1/0/0 192.168.1.10/24 up up
GigabitEthernet1/0/1 192.168.2.10/24 up up
GigabitEthernet1/0/2 200.1.1.1/24 up up
GigabitEthernet1/0/3 unassigned down down
GigabitEthernet1/0/4 unassigned down down
GigabitEthernet1/0/5 unassigned down down
GigabitEthernet1/0/6 10.1.1.1/24 up up
NULL0 unassigned up up(s)
Virtual-if0 unassigned up up(s)
FW2:
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.0.1/24 down down
GigabitEthernet1/0/0 192.168.2.20/24 up up
GigabitEthernet1/0/1 192.168.1.20/24 up up
GigabitEthernet1/0/2 200.1.1.2/24 up up
GigabitEthernet1/0/3 unassigned down down
GigabitEthernet1/0/4 unassigned down down
GigabitEthernet1/0/5 unassigned down down
GigabitEthernet1/0/6 10.1.1.2/24 up up
NULL0 unassigned up up(s)
Virtual-if0 unassigned up up(s)
R1:
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 200.1.1.254/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 202.1.1.1/32 up up(s)
NULL0 unassigned up up(s)
可以在防火墙上顺带把安全区域也划分了
FW1:
[FW1]firewall zone trust
[FW1-zone-trust]add int g1/0/0
[FW1-zone-trust]add int g1/0/1
[FW1]firewall zone dmz
[FW1-zone-dmz]add int g1/0/6
[FW1]firewall zone untrust
[FW1-zone-untrust]add int g1/0/2
FW2:
[FW1]firewall zone trust
[FW1-zone-trust]add int g1/0/0
[FW1-zone-trust]add int g1/0/1
[FW1]firewall zone dmz
[FW1-zone-dmz]add int g1/0/6
[FW1]firewall zone untrust
[FW1-zone-untrust]add int g1/0/2
2、VRRP配置
在这个图里可以设置4个VRRP备份组
FW1:
[FW1-zone-untrust]add int g1/0/2
[FW1-GigabitEthernet1/0/0]vrrp vrid 1 virtual-ip 192.168.1.254 active
[FW1-GigabitEthernet1/0/0]int g1/0/1
[FW1-GigabitEthernet1/0/1]vrrp vrid 2 virtual-ip 192.168.2.254 standby
[FW1-GigabitEthernet1/0/1]int g1/0/2
[FW1-GigabitEthernet1/0/2]vrrp vrid 3 virtual-ip 200.1.1.101 active
[FW1-GigabitEthernet1/0/2]vrrp vrid 4 virtual-ip 200.1.1.102 standby
FW2:
[FW2]int g1/0/0
[FW2-GigabitEthernet1/0/0]vrrp vrid 2 virtual-ip 192.168.2.254 active
[FW2-GigabitEthernet1/0/0]int g1/0/1
[FW2-GigabitEthernet1/0/1]vrrp vri 1 virtual-ip 192.168.1.254 standby
[FW2-GigabitEthernet1/0/1]int g1/0/2
[FW2-GigabitEthernet1/0/2]vrrp vrid 3 virtual-ip 200.1.1.101 standby
[FW2-GigabitEthernet1/0/2]vrrp vrid 4 virtual-ip 200.1.1.102 active
这里是把FW1设置为VRID 1的主墙,VRID2的备墙;FW2是VRID2的主墙,VRID1的备墙。然后VRID3和VRID4各配置了一个虚拟IP地址,这两个虚拟IP地址是作为公网IP地址使用的,后面在配置NAT的时候,把这两个地址加入到NAT地址池,这样可以使用两个地址同时去上网
FW1:
[FW1]dis vrrp brief
2023-01-17 03:42:51.160
Total:4 Master:4 Backup:0 Non-active:0
VRID State Interface Type Virtual IP
----------------------------------------------------------------
1 Master GE1/0/0 Vgmp 192.168.1.254
2 Master GE1/0/1 Vgmp 192.168.2.254
3 Master GE1/0/2 Vgmp 200.1.1.101
4 Master GE1/0/2 Vgmp 200.1.1.102
FW2:
[FW2]dis vrrp brief
2023-01-17 03:43:26.160
Total:4 Master:0 Backup:4 Non-active:0
VRID State Interface Type Virtual IP
----------------------------------------------------------------
1 Backup GE1/0/1 Vgmp 192.168.1.254
2 Backup GE1/0/0 Vgmp 192.168.2.254
3 Backup GE1/0/2 Vgmp 200.1.1.101
4 Backup GE1/0/2 Vgmp 200.1.1.102
3、开启HRP协议并指定心跳接口和对端IP地址
[FW1]hrp int g1/0/6 remote 10.1.1.2
[FW1]hrp enable
[FW2]hrp int g1/0/6 remote 10.1.1.1
[FW2]hrp enable
4、配置备份方式
因为是负载分担模式,那么可能会发生流量从FW1出去,回包从FW2回来,防火墙默认又开启了状态检测,没有收到首包就收到了后续包,这个时候防火墙直接把数据流量丢弃,所以我们需要把备份模式配置为快速备份,将主墙上的一些表项信息同步到备墙
HRP_M[FW1]hrp mirror session enable
HRP_S[FW2]hrp mirror session enable
5、配置NAT
把VRID3和VRID4配置的虚拟IP地址配置为NAT地址池
HRP_M[FW1]nat address-group nat
HRP_M[FW1-address-group-nat]section 200.1.1.101 200.1.1.102
接下来配置安全策略和NAT策略,地址转换采用地址池模式
HRP_M[FW1-policy-security-rule-1]dis th
2023-01-17 03:53:54.770
#
rule name 1
source-zone trust
destination-zone untrust
source-address 192.168.1.0 mask 255.255.255.0
source-address 192.168.2.0 mask 255.255.255.0
action permit
#
nat-policy
rule name 1
source-zone trust
source-address 192.168.1.0 mask 255.255.255.0
source-address 192.168.2.0 mask 255.255.255.0
action source-nat address-group nat
#
这些配置只需要在主墙上配置,会通过HRP协议同步到备墙
最后在防火墙配置缺省路由就可以实现上网了(路由默认不会同步,所以需要在两台防火墙上都配置)
HRP_M[FW1]ip route-static 0.0.0.0 0 200.1.1.254
HRP_S[FW2]ip route-static 0.0.0.0 0 200.1.1.254
结果验证
在sw1和sw2下的PC访问R1创建的环回口地址
我们可以在sw3上查看mac地址表信息,查看是否所有端口都学习到了mac地址,如果都学习到了那么说明负载分担是没问题的
-------------------------------------------------------------------------------
MAC Address VLAN/ PEVLAN CEVLAN Port Type LSP/LSR-ID
VSI/SI MAC-Tunnel
-------------------------------------------------------------------------------
00e0-fcb9-1b61 1 - - GE0/0/2 dynamic 0/-
0000-5e00-0104 1 - - GE0/0/2 dynamic 0/-
0000-5e00-0103 1 - - GE0/0/1 dynamic 0/-
00e0-fc45-5493 1 - - GE0/0/3 dynamic 0/-
00e0-fcf1-0f68 1 - - GE0/0/1 dynamic 0/-
-------------------------------------------------------------------------------
Total matching items on slot 0 displayed = 5