zoukankan      html  css  js  c++  java
  • Cisco、HUAWEI、H3c、Firewall等设备配置snmp

    配置HUAWEI交换机S1720、S2700、S5700、S6720等型号设备的snmp v3配置

    注:此配置来源自官方配置文档

    操作步骤

    1. 配置交换机的接口IP地址,使其和网管站之间路由可达

       (图1)

    2. # 按图1所示,配置交换机的接口IP地址。

      <HUAWEI> system-view
      [HUAWEI] sysname Switch
      [Switch] vlan 100
      [Switch-vlan100] quit
      [Switch] interface gigabitethernet 0/0/1
      [Switch-GigabitEthernet0/0/1] port link-type hybrid
      [Switch-GigabitEthernet0/0/1] port hybrid pvid vlan 100
      [Switch-GigabitEthernet0/0/1] port hybrid untagged vlan 100
      [Switch-GigabitEthernet0/0/1] quit
      [Switch] interface vlanif 100
      [Switch-Vlanif100] ip address 10.1.2.1 24
      [Switch-Vlanif100] quit
    3. 配置交换机的SNMP版本为SNMPv3
      [Switch] snmp-agent sys-info version v3
    4. 配置访问权限

      # 配置ACL,使NMS2可以管理交换机,NMS1不允许管理交换机。

      [Switch] acl 2001
      [Switch-acl-basic-2001] rule 5 permit source 10.1.1.2 0.0.0.0
      [Switch-acl-basic-2001] rule 6 deny source 10.1.1.1 0.0.0.0
      [Switch-acl-basic-2001] quit

      # 配置MIB视图。

      [Switch] snmp-agent mib-view included isoview iso

      # 配置用户组。

      [Switch] snmp-agent group v3 admin privacy write-view isoview acl 2001 

      # 配置用户。

      [Switch] snmp-agent usm-user v3 nms2-admin group admin

      # 对用户的数据进行认证,认证密码为Authe@1234。

      [Switch] snmp-agent usm-user v3 nms2-admin authentication-mode sha
      Please configure the authentication password (8-64)                             
      Enter Password:                  //输入认证密码,本例的认证密码为:Authe@1234。
      Confirm Password:                //输入认证密码,本例的认证密码为:Authe@1234。

      # 对用户的数据进行加密,加密密码为Priva@1234。

      [Switch] snmp-agent usm-user v3 nms2-admin privacy-mode aes128
      Please configure the privacy password (8-64)                                    
      Enter Password:                  //输入加密密码,本例的加密密码为:Priva@1234。                                               
      Confirm Password:                //输入加密密码,本例的加密密码为:Priva@1234。
    5. 配置告警主机
      [Switch] snmp-agent target-host trap address udp-domain 10.1.1.2 params securityname nms2-admin v3 privacy
    6. 配置设备管理员联系方式
      [Switch] snmp-agent sys-info contact call Operator at 010-12345678
    7. 配置网管站

      在使用SNMPv3版本的NMS上需要设置用户名,选择安全级别。根据不同的安全级别,需要分别设置认证方式、认证密码、加密方式、加密密码等。网管的配置请根据采用的网管产品参考对应的网管配置手册。配置网管站

    8. 验证配置结果

      配置完成后,可以执行下面的命令,检查配置内容是否生效。

      # 查看SNMP版本。
      
      [Switch] display snmp-agent sys-info version
         SNMP version running in the system:                                          
                 SNMPv3  
      # 查看用户组信息。
      
      [Switch] display snmp-agent group admin
         Group name: admin
             Security model: v3 AuthPriv
             Readview: ViewDefault
             Writeview: isoview
             Notifyview :<no specified>
             Storage-type: nonVolatile
             Acl:2001
      # 查看MIB视图。
      
      [Switch] display snmp-agent mib-view viewname isoview
         View name:isoview                                                         
             MIB Subtree:iso                                              
             Subtree mask:FC(Hex)                                                            
             Storage-type: nonVolatile                                                
             View Type:included                                                       
             View status:active  
      # 查看告警的目标主机。
      
      [Switch] display snmp-agent target-host
      Target-host NO. 1
      -----------------------------------------------------------
        IP-address    : 10.1.1.2
        Source interface : - 
        VPN instance  : -
        Security name : nms2-admin
        Port          : 162
        Type          : trap
        Version       : v3
        Level         : Privacy
        NMS type      : NMS
        With ext-vb   : No
      ----------------------------------------------------------- 
      # 配置设备管理员联系方式。
      
      [Switch] display snmp-agent sys-info contact
         The contact person for this managed node:                                    
                 call Operator at 010-12345678 

       配置文件

      Switch的配置文件

      #
      sysname Switch
      #
      vlan batch 100
      #
      acl number 2001
       rule 5 permit source 10.1.1.2 0
       rule 6 deny source 10.1.1.1 0
      #
      interface Vlanif100
       ip address 10.1.2.1 255.255.255.0
      #
      interface GigabitEthernet0/0/1
       port link-type hybrid
       port hybrid pvid vlan 100
       port hybrid untagged vlan 100
      #
      snmp-agent
      snmp-agent local-engineid800007DB0300259E0370C3
      snmp-agent sys-info contact call Operator at 010-12345678
      snmp-agent sys-info version v3
      snmp-agent group v3 admin privacy write-view isoview acl 2001 
      snmp-agent target-host trap address udp-domain 10.1.1.2 params securityname nms2-admin v3 privacy
      snmp-agent mib-view included isoview iso 
      snmp-agent usm-user v3 nms2-admin
      snmp-agent usm-user v3 nms2-admin group admin 
      snmp-agent usm-user v3 nms2-admin authentication-mode sha cipher %^%#odaJ7R)/O7k$pwQx0qfD0\`u*'GI1(|;ZQXHtzrN%^%#
      snmp-agent usm-user v3 nms2-admin privacy-mode aes128 cipher %^%#f*K3/|E6d"SJes9)5naXPIqCTpR"}BUC=yW;!(f9%^%#
      #
      return
      

        

  • 相关阅读:
    Java设计模式之原型模式
    Java设计模式之单例模式
    Java设计模式之抽象工厂模式
    Java设计模式之工厂方法模式
    redis常用配置参数详解
    Maven版本的ssm框架项目常见依赖pom.xml
    Maven中setting.xml配置Demo
    Linux中安装jdk
    Linux中查看jdk安装目录、Linux卸载jdk、rpm命令、rm命令参数
    Hibernate主键生成策略
  • 原文地址:https://www.cnblogs.com/chuyiwang/p/9373287.html
Copyright © 2011-2022 走看看