SNMP Principles and Practice

What is SNMP

       SNMP (Simple Network Management Protocol): "Simple Network Management Protocol", a protocol for network management . SNMP is used for the management of network devices. The working mode of SNMP: the administrator needs to obtain data from the device, so SNMP provides a "read" operation; the administrator needs to perform setting operations on the device, so SNMP provides a "write" operation; The administrator notifies the occurrence of the event, so SNMP provides the "Trap" operation.

SNMP background

The basic idea of ​​SNMP is to define a unified interface and protocol for        different types of equipment, equipment produced by different manufacturers, and different types of equipment, so that administrators can use a unified appearance to manage these network equipment that needs to be managed . Through the network, administrators can manage devices located in different physical spaces, thereby greatly improving the efficiency of network management and simplifying the work of network administrators.

SNMP management model

 

 Basic operation of SNMP

 

 

 

 

 

 

SNMP basic configuration

// 使用SNMP Agent 功能
 snmp-agent

// 配置SNMP协议版本信息
 snmp-agent sys-info version [v1|v2c|v3]
  // 用户可以根据自己的需求配置对应的SNMP版本,但设备侧使用的协议版本必须与网管侧一致

// 创建或者更新MIB视图的信息
 snmp-agent mib-view view-name {exclude|include} subtree-name [mask mask]

// 创建一个新的SNMP组,将该组用户映射到SNMP视图
 snmp-agent group v3 group-name {authentication|noauth|privacy}[read-view view-name|
 write-view view-name|notify-view view-name]
  // 该命令用于SNMPv3版本中创建SNMP组,指定认证加密方式,只读视图,读写视图,通知试图
  // 是安全性需求较高的网管网络中的必需口令

// 为一个SNMP组添加一个新用户
 snmp-agent usm-user v3 user-name group group-name

// 配置SNMPv3用户认证密码
 snmp-agent usm-user v3 uesr-name authentication-mode {md5|sha|sha2-256}

// 配置SNMPv3用户加密密码
 snmp-agent usm-user v3 uesr-name privacy-mode {aes128|des56}

// 配置设备发送Trap报文的参数信息
 snmp-agent target-host trap-paramsname paramsname v3 securityname securityname 
 {authentication|noauth|privacy}
 
// 配置Trap报文的目的主机
 snmp-agent target-host trap-hostname hostname address ipv4-address trap-paramsname
 trap-paramsname

// 打开设备的所有告警开关
 snmp-agent trap enable
  // 该命令知识打开设备发送Trap告警的功能,要与snmp-agent target target-host协同使用
  // 由这两个指定Trap告警发送给哪台设备

// 配置发送告警的源接口
 snmp-agent trap source interface-tpye interface-number

Guess you like

Origin blog.csdn.net/m0_61897853/article/details/124094858