< Home

snmp-agent trap source-port

Function

The snmp-agent trap source-port command configures the number of the source port that sends trap messages.

The undo snmp-agent trap source-port command restores the default number of the source port that sends trap messages.

By default, the source port that sends trap messages is a random port.

Format

snmp-agent trap source-port port-num

undo snmp-agent trap source-port

Parameters

Parameter Description Value
port-num Specifies the number of the source port that sends trap messages. The value is an integer ranging from 1025 to 65535.

Views

System view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

To improve security of network packets, run the snmp-agent trap source-port command to configure the source port that sends trap messages. Therefore, the user firewall filters packets based on the port number.

Precautions

By default, a random port is used to send trap messages, and no configuration file is generated. After you configure a specific source port, the corresponding configuration file is generated. If you delete the specified source port, no configuration file is generated.

If a device sends packets to the NMS in Inform mode and the snmp-agent trap source-port command is run to change the source port number, SNMP uses the new source port instead of the original port to receive response packets from the NMS. As a result, packets are retransmitted.

Example

# Set the number of the source port that sends SNMP agent trap messages to 1057.

<HUAWEI> system-view
[HUAWEI] snmp-agent trap source-port 1057
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >