前言:在网络关键节点上,如果只部署一台设备,无论其可靠性多高,系统都必然要承受因单点故障而导致的网络中断的风险
防火墙一般用作内网到外网的出口,是业务关键路径上的设备,为了防止因一台设备故障而导致的业务中断,要求防火墙必须提供更新更高的可靠性,此时需要使用防火墙双机热备组网
双机热备组网的建立和运行需要解决以下几个关键问题:
以上问题都是由双机热备特性涉及的三大协议VRRP VGMP HRP共同配合解决的
华为防火墙双机热备的方式主要有三种
[R1]dis cu
#
sysname R1
interface GigabitEthernet0/0/0
ip address 10.1.1.1 255.255.255.0
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
ip route-static 192.168.10.0 24 10.1.1.100
Username:admin //输入初始账号
Password: //输入初始密码Admin@123
The password needs to be changed. Change now? [Y/N]: y
Please enter old password: //输入Admin@123
Please enter new password: //输入自定义新密码
Please confirm new password: //再次输入新密码``
#
sysname FW1
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.1.1.101 255.255.255.0
#
interface GigabitEthernet1/0/2
undo shutdown
ip address 192.168.10.101 255.255.255.0
#
sysname FW2
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.1.1.102 255.255.255.0
#
interface GigabitEthernet1/0/2
undo shutdown
ip address 192.168.10.102 255.255.255.0
[FW1]firewall zone trust
[FW1-zone-trust]add int g1/0/2
[FW1-zone-trust]q
[FW1]firewall zone dmz
[FW1-zone-dmz]add int g1/0/1
[FW1-zone-dmz]q
[FW1]firewall zone untrust
[FW1-zone-untrust]add int g1/0/0
[FW2]firewall zone trust
[FW2-zone-trust]add int g1/0/2
[FW2-zone-trust]q
[FW2]firewall zone dmz
[FW2-zone-dmz]add int g1/0/1
[FW2-zone-dmz]q
[FW2]firewall zone untrust
[FW2-zone-untrust]add int g1/0/0
[FW1]ip route-static 0.0.0.0 0.0.0.0 10.1.1.1
[FW2]ip route-static 0.0.0.0 0.0.0.0 10.1.1.1
//配置心跳线的安全规则
[FW1]security-policy
[FW1-policy-security]rule name permit_heat
[FW1-policy-security-rule-permit_heat]source-zone local
[FW1-policy-security-rule-permit_heat]destination-zone dmz
[FW1-policy-security-rule-permit_heat]action permit
[FW1-policy-security-rule-permit_heat]q
[FW2]security-policy
[FW2-policy-security]rule name permit_heat
[FW2-policy-security-rule-permit_heat]source-zone local
[FW2-policy-security-rule-permit_heat]destination-zone dmz
[FW2-policy-security-rule-permit_heat]action permit
[FW2-policy-security-rule-permit_heat]q
//配置其他的安全规则
[FW1-policy-security]rule name permit_trust_untrust
[FW1-policy-security-rule-permit_trust_untrust]source-zone trust
[FW1-policy-security-rule-permit_trust_untrust]destination-zone untrust
[FW1-policy-security-rule-permit_trust_untrust]action permit
[FW1-policy-security-rule-permit_trust_untrust]q
[FW2-policy-security]rule name permit_trust_untrust
[FW2-policy-security-rule-permit_trust_untrust]source-zone trust
[FW2-policy-security-rule-permit_trust_untrust]destination-zone untrust
[FW2-policy-security-rule-permit_trust_untrust]action permit
[FW2-policy-security-rule-permit_trust_untrust]q
[FW1]int g1/0/2
[FW1-GigabitEthernet1/0/2]vrrp vrid 1 virtual-ip 192.168.10.100 active
[FW1-GigabitEthernet1/0/2]un sh
[FW1-GigabitEthernet1/0/2]q
[FW1]int g1/0/0
[FW1-GigabitEthernet1/0/0]vrrp vrid 2 virtual-ip 10.1.1.100 active
[FW1-GigabitEthernet1/0/0]un sh
[FW2]int g1/0/2
[FW2-GigabitEthernet1/0/2]vrrp vrid 1 virtual-ip 192.168.10.100 active
[FW2-GigabitEthernet1/0/2]un sh
[FW2-GigabitEthernet1/0/2]q
[FW2]int g1/0/0
[FW2-GigabitEthernet1/0/0]vrrp vrid 2 virtual-ip 10.1.1.100 active
[FW2-GigabitEthernet1/0/0]un sh
[FW1] hrp interface g1/0/1 remote 172.16.1.2
[FW1] hrp enable
[FW2] hrp interface g1/0/1 remote 172.16.1.1
[FW2] hrp enable
HRP_M[FW1]dis hrp state //FW2操作相同
2020-02-14 10:35:30.900
Role: active, peer: standby
Running priority: 45000, peer: 45000
Backup channel usage: 0.00%
Stable time: 0 days, 0 hours, 1 minutes
Last state change information: 2020-02-14 10:33:49 HRP core state changed, old_
state = abnormal(standby), new_state = normal, local_priority = 45000, peer_prio
rity = 45000.
HRP_M[FW1]dis hrp interface //FW2操作相同
2020-02-14 10:36:21.260
GigabitEthernet1/0/1 : running
[SW1]int e0/0/1
[SW1-Ethernet0/0/1]shutdown
HRP_S[FW1]dis hrp state
2020-02-14 10:40:29.350
Role: standby, peer: active (should be "active-standby") //可以发现已经变成从了,FW2变成了主
Running priority: 44998, peer: 45000
Backup channel usage: 0.00%
Stable time: 0 days, 0 hours, 1 minutes
Last state change information: 2020-02-14 10:39:09 HRP core state changed, old_
state = normal, new_state = abnormal(standby), local_priority = 44998, peer_prio
rity = 45000.
[SW1-Ethernet0/0/1]un sh
//可能会有点延迟,需要等到通告信息发出后,查看状态
HRP_M[FW1]dis hrp state
2020-02-14 10:42:52.450
Role: active, peer: standby
Running priority: 45000, peer: 45000
Backup channel usage: 0.00%
Stable time: 0 days, 0 hours, 0 minutes
Last state change information: 2020-02-14 10:42:47 HRP core state changed, old_
state = abnormal(standby), new_state = normal, local_priority = 45000, peer_prio
rity = 45000.
//主又变回FW1了,因为当时在FW1的vrrp配置的时候选择了active,所以会变回来