snmp-agent trap source

Function

The snmp-agent trap source command specifies the source address of a specified interface for trap messages.

The undo snmp-agent trap source command deletes the source address of an interface for trap messages.

By default, the source address of trap messages is not specified.

Format

snmp-agent trap source { interface-name | interface-type interface-number }

undo snmp-agent trap source

Parameters

Parameter Description Value
interface-name

Specifies the name of the source interface that sends trap messages.

-

interface-type

Specifies the type of the source interface that sends trap messages.

-

interface-number

Specifies the number of the source interface that sends trap messages.

-

Views

System view

Default Level

3: Management level

Task Name and Operations

Task Name Operations
snmp write

Usage Guidelines

Usage Scenario

To specify the type and number of a source interface with a specific IP address used to send SNMP trap messages, run the snmp-agent trap source command.

Configuration Impact

Trap messages carry IP addresses of the outbound interfaces, and the receivers can identify the source addresses.

Precautions

The source interface that sends trap messages must have an IP address configured.

After the snmp-agent trap source command is run, the private VPN where the source interface resides is automatically bound to the interface.

Rules for a destination host to select a VPN

  • Rule 1: If the snmp-agent target-host trap command is run with a specified source interface-type interface-number, the private VPN bound to the source interface is used to send trap messages. Otherwise, refer to rule 2.
  • Rule 2: If the snmp-agent trap source command is run to specify the source interface for trap messages globally, the private VPN bound to the source interface is used to send trap messages. Otherwise, refer to rule 3.
  • Rule 3: If the snmp-agent target-host trap command is run with a specified public-net, the public network is used to send trap messages. Otherwise, refer to rule 4.
  • Rule 4: If the snmp-agent target-host trap command is run with a specified vpn-instance vpn-instance-name, the host VPN is used to send trap messages. Otherwise, refer to rule 5.
  • Rule 5: If the set net-manager vpn-instance command is run to configure a global VPN, the global VPN is used to send trap messages. Otherwise, refer to rule 6.
  • Rule 6: The public network is used to send trap messages.

Example

# Configure the IP address of the interface as the source address for trap messages.
<HUAWEI> system-view
[~HUAWEI] snmp-agent trap source GigabitEthernet 0/1/0
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >