< Home

snmp-agent udp-port

Function

The snmp-agent udp-port command sets the listening port of the SNMP agent.

The undo snmp-agent udp-port command restores the default listening port of the SNMP agent.

By default, the listening port of the SNMP agent is 161.

Format

snmp-agent udp-port port-num

undo snmp-agent udp-port

Parameters

Parameter Description Value
port-num Specifies the listening port of the SNMP agent. The value is 161 or an integer that ranges from 1025 to 65535.

Views

System view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

The SNMP agent is a proxy process running on a network device. By default, the SNMP agent listens on port 161 to respond to instructions sent from the NMS. In this manner, the NMS can manage the network device. Fixing the listing port may threaten network security. For example, if all attack packets are sent to this listening port, the network is congested.

To improve device security, run the snmp-agent udp-port command to change the listening port of the SNMP agent.

Configuration Impact

After you run this command, the SNMP agent listens on the new port number. The original SNMP connection with the NMS is torn down, and the NMS must use the new port number to connect to the device.

Precautions

The listening port configured on the NMS must be the same as that specified by the snmp-agent udp-port command. Otherwise, the NMS cannot connect to the device.

Example

# Set the listening port of the SNMP agent to 1057.

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