Configuring the NAT Log Function
Context
Procedure
- Run system-view
The system view is displayed.
- Run firewall log session enable
The session log function is enabled.
By default, the firewall log function is disabled.
- Run firewall log session nat enable
The NAT session log function is enabled.
By default, the NAT session log function is enabled.
- (Optional) Run nat log-format elog
The NAT log format is set to eLog. The logs are generated in the format specified by the eLog server.
By default, NAT logs are in a common format.
- Configure the device to export logs to a log host in the information center or session log host.
Export logs to a log host in the information center.
Run info-center enable
The information center is enabled.
Run info-center loghost ip-address [ channel { channel-number | channel-name } | facility local-number | language language-name | transport { udp | tcp ssl-policy policy-name [ verify-dns-name dns-name | verify-revocation-status ] } | { vpn-instance vpn-instance-name | public-net } | local-time | port port-id ] *
The channel through which logs are exported to the log host is configured.
By default, the device does not export information to a log host.
A maximum of eight log hosts are supported to implement backup among log hosts.
For details on how to configure the device to send logs to a log host, see Example for Outputting Log Information to a Log Host in "Information Center Configuration" of the Huawei AR Series V300R019 Configuration Guide - Device Management.
Export logs to a session log host.
Run firewall log binary-log host host-ip-address host-port source source-ip-address source-port [ vpn-instance vpn-instance-name ]
A binary log server is configured, including the server's IP address and port number, and the IP address and port number used by the device to communicate with the log server.
- (Optional) Run firewall log session log-interval time
The interval at which NAT logs are exported is configured.
By default, the device export logs at an interval of 30 seconds.