The administrator checks IPv4 session logs on the eLog to understand the creation of sessions by IPv4 packets on the FW.
As shown in Figure 1, a FW is deployed at the border of a network as a gateway. A PAT-mode NAT policy is configured on the FW to perform the address and port translation for packets that access external networks from the internal network.
You need 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.
To meet the requirements, you need to consider the following key configuration points:
In this case, data planning for the FW and eLog is shown in Table 1.
Data Planning on the FW |
Data Planning on the eLog |
Description |
||
|---|---|---|---|---|
Interface and IP Address |
Security Policy |
IP Address |
Collection Mode |
|
Interface connecting to the eLog: GigabitEthernet 0/0/1 Associated security zone: DMZ IP address: 172.16.81.1/16 |
Security policy for service traffic:
NAT policy for service traffic:
|
172.16.110.168 |
Collection mode: Session Port: 9002 |
The session collection mode is used for the eLog, and port 9002 is used to receive log information. |
Before configuring the FW and eLog, pay attention to the following important check items and complete the configuration based on the actual situation:
The time zone and time of the FW shall be the same as those of the eLog.
If the time zone or time of the FW is different from that of the eLog collector, log query results will be affected. You are advised to use NTP to make the FW and eLog as the clients to synchronize time from the clock source. If NTP is not deployed on the network, you can manually adjust the time on the FW to ensure time consistency between the FW and eLog.
Specify the method of managing the log source (that is, the FW) on the eLog.
Currently, the eLog supports two FW management methods: manual adding and automatic discovery. You are advised to manually add the FW because this method is simple and you do not need to perform extra configuration on the FW. When there are a large number of FW, you can use the other method, automatic discovery. If this method is used, you need to set SNMP parameters on the FW.


When SNMP parameters are set using the web UI, the authentication algorithm is SHA2-256 and the encryption algorithm is AES128 by default, and cannot be changed. If you need to change these algorithms, run related commands.
Configure security policies.

Configure a NAT policy.
Name |
addr1 |
|---|---|
IP Address Range |
192.168.5.100-192.168.5.120 |
Name |
policy1 |
|---|---|
NAT Type |
NAT |
Source Zone |
trust |
Destination Type |
Destination Zone (untrust) |
Source Address |
192.168.0.0/24 |
Translated After |
|
Translated Mode |
IP Address in the IP Address Pool |
Address Pool |
addr1 |

In addition, log collection in netflow mode is supported. To view netflow session logs, set the port number to 9996. This document uses log collection in session mode as an example.
Enable the session log function.
# Enable the record function for session logs in the security policy for service traffic.
Choose , click the created security policy policy1, and enable the function of recording session logs in .
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. You 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.
This example provides only the configuration scripts of the part where the FW interworks with the eLog.
# sysname FW # firewall log host 1 172.16.110.168 9002 firewall log source 172.16.81.1 6666 # interface GigabitEthernet 0/0/1 ip address 172.16.81.1 255.255.0.0 # firewall zone dmz set priority 50 add interface GigabitEthernet 0/0/1 # snmp-agent snmp-agent sys-info version v3 snmp-agent group v3 group privacy snmp-agent usm-user v3 admin group group snmp-agent usm-user v3 admin authentication-mode sha2-256 cipher %^%#ZgL-L2HsZ<5P]s+:6d)LcBG5)~mdl=te snmp-agent usm-user v3 admin privacy-mode aes128 cipher %^%#i!rs46cpF"_)d#.cJ,'1>wE_>wE # nat address-group addr1 mode pat section 0 192.168.5.100 192.168.5.120 # security-policy rule name policy1 session logging source-zone trust destination-zone untrust source-address 192.168.0.0 mask 255.255.255.0 action permit # nat-policy rule name policy1 source-zone trust destination-zone untrust source-address 192.168.0.0 24 action source-nat address-group addr1 # return