The info-center loghost command configures the device to output information to a log host.
The undo info-center loghost command disables the device from outputting information to a log host.
By default, no information is output to the log host.
info-center loghost ip-address [ channel { channel-number | channel-name } | facility local-number | language language-name | { vpn-instance vpn-instance-name | public-net } | local-time | log-counter { disable | enable } | port port | security-log | operation-log | { source-ip source-ip-address } | transport { udp | tcp ssl-policy policy-name } ] *
info-center loghost ipv6 ipv6-address [ channel { channel-number | channel-name } | facility local-number | language language-name | local-time | log-counter { disable | enable } | port port | security-log | operation-log | transport { udp | tcp ssl-policy policy-name } ] *
undo info-center loghost ip-address [ vpn-instance vpn-instance-name ]
undo info-center loghost ipv6 ipv6-address
info-center loghost domain domain-name [ vpn-instance vpn-instance-name ] [ channel { channel-number | channel-name } | facility local-number | language language-name | log-counter { disable | enable } | local-time | port port | security-log | operation-log | transport { udp | tcp ssl-policy policy-name } ] *
undo info-center loghost domain domain-name [ vpn-instance vpn-instance-name ]
Parameter | Description | Value |
---|---|---|
ip-address |
Specifies the IPv4 address of the log host. |
The value is in dotted decimal notation. |
channel { channel-number | channel-name } |
Specifies the channel used to send information to a log host.
|
The value of channel-number is an integer that ranges from 0 to 9. The value of channel-name is a string of 1 to 30 case-insensitive characters. The value consists of letters or numbers and must start with a letter. |
facility local-number |
Specifies a syslog server facility that is used to identify the log information source. You can use this parameter to plan a local value for the log information of a specified device, so that the syslog server can handle received log information based on the parameter. |
The value ranges from local0 to local7. The default value is local7. |
language language-name |
Displays the language in which logs are recorded. |
Currently, the value can only be English. |
vpn-instance vpn-instance-name |
VPN instance. |
The value must be an existing VPN instance name. |
public-net |
Indicates that the log host is connected in the public network. |
- |
local-time |
Indicates the local time when logs are sent to the log host. |
- |
log-counter { disable | enable } |
Disables or enables the log counter function. |
- |
port port |
Specifies the port number of a log host. |
The value is an integer that ranges from 1 to 65535 |
security-log |
Configures a device to send security logs to a specified log host. |
- |
operation-log |
Configures a device to send operation logs to a specified log host. |
- |
source-ip source-ip-address |
Specifies the source IP address used to send information to the log host. |
The value is in dotted decimal notation. |
transport |
Indicates the information transport mode. |
- |
udp |
Indicates the UDP transport mode. NOTE:
The default transport mode is UDP if no transport mode is specified. |
- |
tcp |
Indicates the TCP transport mode. NOTE:
The default transport mode is UDP if no transport mode is specified. |
- |
ssl-policy policy-name |
Specifies a Secure Sockets Layer (SSL) policy in the TCP transport mode. This parameter is recommended to improve log transmission security. |
The value is a string of 1 to 23 case-insensitive characters without spaces. |
ipv6 ipv6-address |
Specifies the IPv6 address of the log host. |
The value is a 32-digit hexadecimal number. |
domain domain-name |
Specifies a DNS domain name of a log host. |
The value is a string of 1 to 255 case-sensitive characters, spaces not supported. |
Usage Scenario
To query information generated on the Switch deployed remotely, configure the Switch to export information to a log host so that you can view device information on the log host. Run the info-center loghost command to configure the Switch to export information to a log host.
To configure the Switch to output information to different log hosts using different channels, specify the channels used to send information to the log hosts. For example, you can configure the Switch to output information to log hosts at 192.168.0.1 and 192.168.0.2 using channels 7 and 8 respectively.
Precautions
The Switch can output information to eight log hosts including IPv4 and IPv6 hosts to implement backup among log hosts.
To transfer logs to the log hosts using TCP and encrypt logs using SSL, create an SSL policy first.
If vpn-instance is configured, the system accesses the log host in the VPN instance.
If public-net is configured, the system accesses the log host on the public network.
# Configure a device to use channel 6 to output information to the log host at 10.1.1.1.
<HUAWEI> system-view [HUAWEI] info-center loghost 10.1.1.1 channel channel6
# Configure the source IP address used to send information to the log host is Loopback1.
<HUAWEI> system-view [HUAWEI] info-center loghost source LoopBack1
# Configure the Switch to send information to the log host at FC00:0:0:3001::1/64.
<HUAWEI> system-view [HUAWEI] info-center loghost ipv6 fc00:0:0:3001::1
# Configure the Switch to send information to the host with the IPv4 address 192.168.2.2 and VPN instance name vpn1.
<HUAWEI> system-view [HUAWEI] info-center loghost 192.168.2.2 vpn-instance vpn1
<HUAWEI> system-view [HUAWEI] info-center loghost domain www.test.com
<HUAWEI> system-view [HUAWEI] ssl policy huawei123 [HUAWEI-ssl-policy-ftps_der] trusted-ca load pem-ca 1_cacert_pem_rsa.pem [HUAWEI-ssl-policy-ftps_der] trusted-ca load pem-ca 1_rootcert_pem_rsa.pem [HUAWEI-ssl-policy-ftps_der] quit