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.
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. |
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.