The snmp-agent trap source-port command specifies the number of a 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.
Usage Scenario
To improve network security, run the snmp-agent trap source-port command to configure a specific port to send trap messages. Therefore, the user terminal's firewall allows packets with the specified port number to pass.
Precautions
If a device sends packets to the NMS in Inform mode, and the snmp-agent trap source-port command is run to specify 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, SNMP cannot use the original port to receive response packets from the NMS, and packets are retransmitted.
<HUAWEI> system-view [~HUAWEI] snmp-agent trap source-port 1057 Warning: This operation will change the source port number of all trap packets. Continue? [Y/N]:y Info: Succeeded in changing the source port number of trap packets. [*HUAWEI]