Common SNMP Operations : Configuring the Device to Send Traps

3695 0 0 0

After the trap function is enabled and the trap host is configured, the device automatically sends traps to the trap host.

  1. Enable the trap function.

    Enable the trap function for the SNMP module.

    <HUAWEI> system-view
    [HUAWEI] snmp-agent trap enable feature-name snmp
    Common SNMP Operations : Configuring the Device to Send Traps-1962287-1 NOTE:

    If the trap function is not enabled for modules, each module uses the default trap configuration. To view the default trap configuration of each module, run the display snmp-agent trap all command. The trap function of the SNMP module is used as an example here.

  2. Configure the interface to send traps.

    Configure LoopBack0 with IP address as the interface to send traps.

    <HUAWEI> system-view
    [HUAWEI] interface loopback 0
    [HUAWEI-LoopBack0] ip address 32
    [HUAWEI-LoopBack0] quit
    [HUAWEI] snmp-agent trap source loopback 0
    Common SNMP Operations : Configuring the Device to Send Traps-1962287-2 NOTE:

    After the interface is configured, the IP address of the interface is used to send traps. To ensure device security, it is recommended that you configure a loopback interface to send traps. The trap sending interface configured on the switch must be the same as that configured on the NMS; otherwise, the NMS cannot receive traps. In addition, a reachable route must exist between the IP addresses of trap sending interface and trap host.

  3. Configure the trap host.

    Set the trap host address to, UDP port number to 50000, security name to user001, trap version to v3, and security level to privacy.

    <HUAWEI> system-view
    [HUAWEI] snmp-agent target-host trap address udp-domain udp-port 50000 params securityname user001 v3 privacy
    Common SNMP Operations : Configuring the Device to Send Traps-1962287-3 NOTE:

    The trap version must be the same as the SNMP version configured on the device; otherwise, traps cannot be sent to the NMS. When the version is set to v3, the security name must be the same as the created user name; otherwise, traps cannot be sent to the NMS. v1 and v2c do not have limitation on the configuration of security names.

    The default UDP port number is 162. After the UDP port number is changed, you must reconfigure the UDP port of the NMS that receives traps. If the UDP ports of the device and NMS are different, traps cannot be sent to the NMS.

    The security level of the trap host cannot be lower than the security level of the user.





  • x
  • convention:


You need to log in to reply to the post Login | Register

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " Privacy."
If the attachment button is not available, update the Adobe Flash Player to the latest version!

Login and enjoy all the member benefits

Fast reply Scroll to top