(Optional) Configuring NAT Log Output
Context
NAT logs are generated when the router performs address translation. The logs record the original source IP addresses, source ports, destination IP addresses, destination ports, and translated source IP addresses and source ports, as well as user actions and time stamps. You can view NAT logs to learn about information about users have accessed a network using NAT.
The router can send NAT logs to a specified log host, as shown in Figure 5-17.
Procedure
- Run system-view
The system view is displayed.
- Run firewall log session enable
The firewall log function is enabled.
- Run firewall log session nat enable
The NAT session log function is enabled.
- (Optional) Run nat log-format elog
Sets the NAT log format to eLog. The logs are generated in the format specified by the eLog server.
- Run the following command to output
logs to the information center log host or session log host:
Output logs to the information center log host
Run info-center enable
The information center is enabled.
Run info-center loghost ip-address [ channel { channel-number | channel-name } | facility local-number | | { vpn-instance vpn-instance-name | public-net } ] *
The channel through which logs are output to the log host is configured.
The router supports a maximum of eight log hosts to implement backup among log hosts.
NOTE:
For details on how to configure the router to send logs to a log host, see Example for Outputting Log Information to a Log Host in "Information Center Configuration" of the Huawei AR100&AR120&AR150&AR160&AR200&AR1200&AR2200&AR3200&AR3600 Series V300R003 Configuration Guide - Device Management.
Output logs to the 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 session log host is configured.
By default, no session log host is configured.