This section describes how configure two firewalls in hot standby deployment in load balancing mode to send IPv4 session logs.
On the network shown in Figure 1, the service interfaces of two FWs work at Layer 3 and are directly connected to routers. The FWs and directly connected routers run OSPF.
The FWs are required to work in load balancing mode. In normal cases, FW_A forwards traffic from Dept. A, and FW_B forwards traffic from Dept. B. If either FW fails, the other FW forwards all traffic to ensure service continuity.
The administrator wants to check PAT-mode IPv4 session logs on the eLog to understand the creation of sessions by packets in a timely manner and, when necessary, perform NAT source tracing.
In this load balancing networking, FWs connect to routers in both upstream and downstream directions. On live networks, you must determine whether OSPF is required based on the upstream and downstream devices and interfaces. The Source NAT configuration remains unchanged.
This example does not apply when uplink interfaces connect to different ISP networks.
Item |
FW_A |
FW_B |
|
|---|---|---|---|
Interface |
GigabitEthernet 0/0/1 IP address: 10.2.0.1/24 Security zone: Untrust GigabitEthernet 0/0/3 IP address: 10.3.0.1/24 Security zone: Trust GigabitEthernet 0/0/7 IP address: 10.10.0.1/24 Security zone: DMZ |
GigabitEthernet 0/0/1 IP address: 10.2.1.1/24 Security zone: Untrust GigabitEthernet 0/0/3 IP address: 10.3.1.1/24 Security zone: Trust GigabitEthernet 0/0/7 IP address: 10.10.0.2/24 Security zone: DMZ |
|
OSPF |
Process ID: 10 Area ID: 0 Network segment for the area: 10.2.0.0/24, 10.3.0.0/24 and 1.1.1.10/32 |
Process ID: 10 Area ID: 0 Network segment for the area: 10.2.0.0/24, 10.3.0.0/24 and 1.1.1.10/32 |
|
# Configure OSPF on FW_A.
[FW_A] ospf 10 [FW_A-ospf-100] import-route unr [FW_A-ospf-100] area 0 [FW_A-ospf-100-area-0.0.0.0] network 10.2.0.0 0.0.0.255 [FW_A-ospf-100-area-0.0.0.0] network 10.3.0.0 0.0.0.255
# Configure OSPF on FW_B.
[FW_B] ospf 10 [FW_B-ospf-100] import-route unr [FW_B-ospf-100] area 0 [FW_B-ospf-100-area-0.0.0.0] network 10.2.1.0 0.0.0.255 [FW_B-ospf-100-area-0.0.0.0] network 10.3.1.0 0.0.0.255
In the hot standby load balancing scenario, If NAPT is configured, the FWs may have conflicting public ports. To prevent such conflicts, configure respective NAT resources (including public IP addresses and ports) for the FWs. You can run the hrp nat resource primary-group command on the active FW. The standby FW will automatically generate the hrp nat resource secondary-group command (if you run the hrp nat resource secondary-group command on the active FW, the standby FW will automatically generate the hrp nat resource primary-group command).
[FW_A] hrp nat resource primary-group
The security policy configured on FW_A is automatically backed up to FW_B.
HRP_M[FW_A] security-policy HRP_M[FW_A-policy-security] rule name policy_sec_1 HRP_M[FW_A-policy-security-rule-policy_sec_1] source-zone local trust untrust HRP_M[FW_A-policy-security-rule-policy_sec_1] destination-zone local trust untrust HRP_M[FW_A-policy-security-rule-policy_sec_1] action permit HRP_M[FW_A-policy-security-rule-policy_sec_1] quit HRP_M[FW_A-policy-security] quit
The NAT address pool configured on FW_A is automatically backed up to FW_B.
HRP_M[FW_A] nat address-group addressgroup1 HRP_M[FW_A-nat-address-group-addressgroup1] section 0 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 HRP_M[FW_A-nat-address-group-addressgroup1] mode pat HRP_M[FW_A-nat-address-group-addressgroup1] route enable HRP_M[FW_A-nat-address-group-addressgroup1] quit
The NAT policy configured on FW_A is automatically backed up to FW_B.
HRP_M[FW_A] nat-policy HRP_M[FW_A-policy-nat] rule name policy_nat_1 HRP_M[FW_A-policy-nat-policy_nat_1] source-zone trust HRP_M[FW_A-policy-nat-policy_nat_1] destination-zone untrust HRP_M[FW_A-policy-nat-policy_nat_1] action source-nat address-group addressgroup1 HRP_M[FW_A-policy-nat-policy_nat_1] quit HRP_M[FW_A-policy-nat] quit
HRP_M[FW_A] firewall log host 1 172.16.1.10 9002
HRP_M[FW_A] firewall log source 172.16.1.1 6666
HRP_S[FW_B] firewall log source 172.16.1.2 6666
# Enable the record function for session logs in the security policy for service traffic.
HRP_M[FW_A] security-policy HRP_M[FW_A-policy-security] rule name policy_sec_1 HRP_M[FW_A-policy-security-rule-policy1] session logging HRP_M[FW_A-policy-security-rule-policy1] quit
Assume that the eLog has been successfully installed; the collector works normally; and the disk space has been planned. Operations for managing log sources and viewing log reports on the eLog are as follows.
For details about how to install and use the eLog, see the product documentation of the corresponding version in .
After the configurations are complete, when users on internal networks access external networks, corresponding sessions are generated on the FW. After the sessions age, the FW sends the session logs to the eLog. Then you can check the IPv4 session logs on the eLog.
Click the IPv4 PAT tab, set a reasonable query time range, and click Search.
The query results are as shown in the following figure. The log information given here is only an example. Log information in different network environments should conform to the actual conditions.

By checking the log information above, the administrator can know about the creation of sessions by packets in time. The administrator can also learn the information (such as the IP address) before the NAT translation is performed on packets and perform, when necessary, the NAT source tracing.
In addition, the administrator can click
,
, and
and export the query results to corresponding file formats.
FW_A |
FW_B |
|---|---|
# firewall log host 1 172.16.1.10 9002 firewall log source 172.16.1.1 6666 firewall log session new-session enable # hrp mirror session enable hrp enable hrp interface GigabitEthernet 0/0/7 remote 10.10.0.2 # hrp nat resource primary-group # hrp track interface GigabitEthernet 0/0/1 hrp track interface GigabitEthernet 0/0/3 # interface GigabitEthernet 0/0/7 ip address 10.10.0.1 255.255.255.0 # firewall zone trust set priority 85 add interface GigabitEthernet 0/0/3 # firewall zone untrust set priority 5 add interface GigabitEthernet 0/0/1 # firewall zone dmz set priority 50 add interface GigabitEthernet 0/0/7 # ospf 10 import-route unr area 0.0.0.0 network 10.2.0.0 0.0.0.255 network 10.3.0.0 0.0.0.255 # nat address-group addressgroup1 mode pat route enable section 0 1.1.1.10 1.1.1.15 # security-policy rule name policy_sec_1 session logging source-zone local source-zone trust source-zone untrust destination-zone local destination-zone trust destination-zone untrust action permit # nat-policy rule name policy_nat_1 source-zone trust destination-zone untrust action source-nat address-group addressgroup1 |
# firewall log host 1 172.16.1.10 9002 firewall log source 172.16.1.2 6666 firewall log session new-session enable # hrp mirror session enable hrp enable hrp interface GigabitEthernet 0/0/7 remote 10.10.0.1 # hrp nat resource secondary-group # hrp track interface GigabitEthernet 0/0/1 hrp track interface GigabitEthernet 0/0/3 # interface GigabitEthernet 0/0/7 ip address 10.10.0.2 255.255.255.0 # firewall zone trust set priority 85 add interface GigabitEthernet 0/0/3 # firewall zone untrust set priority 5 add interface GigabitEthernet 0/0/1 # firewall zone dmz set priority 50 add interface GigabitEthernet 0/0/7 # ospf 10 import-route unr area 0.0.0.0 network 10.2.1.0 0.0.0.255 network 10.3.1.0 0.0.0.255 # nat address-group addressgroup1 mode pat route enable section 0 1.1.1.10 1.1.1.15 # security-policy rule name policy_sec_1 session logging source-zone local source-zone trust source-zone untrust destination-zone local destination-zone trust destination-zone untrust action permit # nat-policy rule name policy_nat_1 source-zone trust destination-zone untrust action source-nat address-group addressgroup1 |