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.
| Parameter | Description | Value |
|---|---|---|
| interface-type interface-number | Specifies the source interface sending trap messages. | - |
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.