After basic SNMPv1 functions are configured, an NMS can perform basic operations on a managed device, and the managed device can send alarms to the NMS.
Sends requests to the managed device to perform the GetRequest, GetNextRequest, GetResponse, or SetRequest operation, obtaining data and setting values.
When SNMPv1 is used, Counter64 nodes cannot be visited.
SNMPv1 has a security risk. Using SNMPv3 is recommended.
Receives alarms from the managed device and locates and rectify device faults based on the alarm information.
system-view
info-center enable
By default, the information center is enabled.
snmp-agent
By default, the SNMP agent function is disabled. Running any command with the parameter snmp-agent can enable the SNMP agent function, so this step is optional.
snmp-agent udp-port port-num
By default, port 161 is monitored by the SNMP agent.
The snmp-agent udp-port command can be used to change the number of the port monitored by the SNMP agent, to improve the security of the device.
snmp-agent sys-info version v1
By default, SNMPv3 is used.
After SNMPv1 is enabled on the managed device, the device supports both SNMPv1 and SNMPv3. This means that the device can be monitored and managed by the NMS running SNMPv1 or SNMPv3.
snmp-agent community { read | write } [ cipher ] community-name [ acl acl-number | mib-view view-name | alias alias-name ] *
The community name will be saved in encrypted format in the configuration file. The community alias will be saved in simple text format in the configuration file.
The requirements for community name complexity are as follows:
The default minimum length of a community name is eight characters. The set password min-length command determines the minimum length of a community name.
A community name includes at least two kinds of characters, which can be uppercase letters, lowercase letters, digits, and special characters except question marks (?) and space.
After the community name is set, if no MIB view is configured, the NMS that uses the community name has permission to access objects in the ViewDefault view.
snmp-agent target-host trap address udp-domain ip-address [ udp-port port-number | source interface-type interface-number | [ public-net | vpn-instance vpn-instance-name ] ] * params securityname [ cipher ] security-string [ v1 | notify-filter-profile profile-name | private-netmanager | ext-vb ] *
snmp-agent target-host trap ipv6 address udp-domain ipv6-address [ udp-port port-number ] params securityname [ cipher ] security-string [ v1 | notify-filter-profile profile-name | private-netmanager | ext-vb ] *
The descriptions of the command parameters are as follows:
The default destination UDP port number is 162. In some special cases, the parameter udp-port can be used to specify a non-well-known UDP port number. This ensures normal communication between the NMS and managed device.
If the alarms sent from the managed device to the NMS need to be transmitted over a public network, the parameter public-net needs to be configured. If the alarms sent from the managed device to the NMS need to be transmitted over a private network, the parameter vpn-instance vpn-instance-name needs to be used to specify a VPN that will take over the sending task.
The parameter securityname identifies the alarm sender, which will help you learn the alarm source.
If the NMS and managed device are both Huawei products, the parameter private-netmanager can be configured to add more information to alarms, such as the alarm type, alarm sequence number, and alarm sending time. The information will help you locate and rectify faults more quickly.
snmp-agent sys-info { contact contact | location location }
This step is required when the NMS administrator must know equipment administrators' contact information and locations when the NMS manages many devices. This allows the NMS administrator to contact the equipment administrators quickly for fault location and rectification.
To configure both the equipment administrator's contact information and location, you must run the command twice to configure them separately.
snmp-agent packet max-size byte-count
By default, the maximum size of an SNMP packet that the device can receive or send is 12000 bytes.
After the maximum size is set, the device will discard any SNMP packet that is larger than the set size. The allowable maximum size of an SNMP packet for a device depends on the size of a packet that the NMS can process; otherwise, the NMS cannot process the SNMP packets sent from the device.
snmp-agent protocol source-interface interface-type interface-number
Currently, the source interface can be set only to a loopback interface.
snmp-agent protocol server [ ipv4 | ipv6 ] disable
By default, the SNMP IPv4 or IPv6 listening port is disabled.
If ipv4 or ipv6 is not selected, both SNMP IPv4 and IPv6 listening ports are disabled.
After you disable the SNMP IPv4 or IPv6 listening port using the snmp-agent protocol server disable command, SNMP no longer processes SNMP packets. Exercise caution when you disable the SNMP IPv4 or IPv6 listening port.
To allow a specified NMS that uses the community name to manage specified objects on the device, follow the procedure described in Controlling the NM Station's Access to the Device.
To allow a specified module on the managed device to report alarms to the NMS, follow the procedure described in Configuring the Trap Function.
If the NMS and managed device are both Huawei products, follow the procedure described in Enabling the SNMP Extended Error Code Function to allow the device to send more types of error codes. This allows more specific error identification and facilitates your fault location and rectification.
To improve Simple Network Management Protocol (SNMP) packet transmission reliability, follow the procedure described in Improving SNMP Packet Transmission Reliability.