< Home

snmp-agent trap source

Function

The snmp-agent trap source command specifies the source interface from which trap messages are sent.

The undo snmp-agent trap source command cancels the current setting.

Format

snmp-agent trap source interface-type interface-number

undo snmp-agent trap source

Parameters

Parameter Description Value
interface-type interface-number Specifies the source interface sending trap messages. -

Views

System view

Default Level

3: Management level

Usage Guidelines

By default, the source interface for sending trap messages is not specified. The system randomly selects a routable interface to send trap messages.

Usage Scenario

Trap messages sent by a device carry source addresses, irrespective of which interface sends the trap messages. To allow trap messages to carry source interface information, run the snmp-agent trap source command.

Prerequisites

Before an interface is configured as the interface for receiving the trap address, ensure that the interface configured with a valid IP address has already existed. The IP address will serve as the source address of trap messages. If no interface is installed, the configuration of the snmp-agent trap source command fails; If the interface is not configured with a valid IP address, the snmp-agent trap source command will not take effect. The snmp-agent trap source command will take effect automatically when the interface is configured with a valid IP address.

Precautions

To ensure the security of the local host address, use a loopback interface as the source interface for sending trap messages.

Example

# Specify the IP address of the VLANIF100 as the source address of trap messages.
<sysname> system-view
[sysname] snmp-agent trap source vlanif100
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >