Example for Outputting Logs to the Log File
Huawei AR150 & AR200 & AR1220 & AR2200 & AR3200 Series Enterprise Routers Configuration Guide: Example for outputting logs to the log file
Networking Requirements
As shown in Figure 1, RouterA connects to the FTP server through the network. The network administrator wants to use the FTP server to view logs generated by RouterA and learn operations on RouterA.
NOTE
FTP cannot secure secure file transfer. SFTP is recommended on networks that require high security.
Figure 1 Networking diagram for outputting logs to the log file
Huawei router Configuration Roadmap
The configuration roadmap is as follows:
1. Enable the information center.
2. Configure a channel and a rule for outputting logs to a log file so that logs are saved in the log file.
3. Configure RouterA to transfer the log file to the FTP server so that the network
administrator can use the FTP server to view logs generated by RouterA.
Procedure
Step 1 Enable the information center.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] info-center enable
Step 2 Configure a channel and a rule for outputting logs to a log file.
# Configure a channel for outputting logs to a log file.
[RouterA] info-center logfile channel channel6
NOTE
By default, channel 9 is used to send logs to a log file. If the default setting is used, skip this step.
# Configure a rule for outputting logs to a log file.
[RouterA] info-center source ip channel channel6 log level warning
Step 3 Configure RouterA to transfer the log file to the FTP server.
# Log in to the FTP server.
<RouterA> ftp 10.1.1.1
Trying 10.1.1.1 ...
Press CTRL+K to abort
Connected to 10.1.1.1.
220 WFTPD 2.0 service (by Texas Imperial Software) ready for new user
User(10.1.1.1:(none)):huawei
331 Give me your password, please
Enter password:
230 Logged in successfully
# Configure RouterA to transfer the log file to the FTP server.
[RouterA-ftp] put sd1:/logfile/log.log
200 PORT command okay
150 "D:\UPDATE\log.log" file ready to receive in ASCII mode
226 Transfer finished successfully.
FTP: 2761463 byte(s) sent in 26.062 second(s) 105.95Kbyte(s)/sec.
[RouterA-ftp] quit
Step 4 Verify the configuration.
# View information recorded by the channel.
<RouterA> display info-center
Information Center: enabled
Log host:
Console:
channel number: 0, channel name: console
Monitor:
channel number: 1, channel name: monitor
SNMP Agent:
channel number: 5, channel name: snmpagent
Log buffer:
enabled
max buffer size: 1024, current buffer size: 512
current messages: 204, channel number: 4, channel name: logbuffer
dropped messages: 0, overwritten messages: 0
Trap buffer:
enabled
max buffer size: 1024, current buffer size: 256
current messages: 256, channel number: 3, channel name: trapbuffer
dropped messages: 0, overwritten messages: 29
Logfile:
channel number: 6, channel name: channel6, language: English
Information timestamp setting:
log - date, trap - date, debug - date
Sent messages = 1514, Received messages = 1514
# View the received log file on the FTP server.
----End
Configuration Files
l Configuration file of RouterA
#
sysname RouterA
#
info-center source IP channel 6 log level warning
info-center logfile channel 6
#
interface GigabitEthernet1/0/0
ip address 10.2.1.1 255.255.0.0
#
ip route-static 10.1.0.0 255.255.0.0 10.2.1.2
#
Return
More related:
Example for Configuring the Netstream Function to Account User Traffic
Example for Configuring the SNMP Function to Implement Communication Between the Device and the NMS
Example for Connecting Intranet Users to the Internet in NAT Address Pool Mode
Example for Connecting Intranet Users to the Internet in Easy IP Mode
Example for Configuring the Device as a PPPoE Client to Connect Users to the Internet













