如何在交换机和路由器下开启SNMP服务

CISCO设备
router>                           
router> enable                                        进入路由器是用户模式
router# conf terminal                               进入路由器的全局配置模式
#snmp-server community cisco ro         (只读) ;配置只读通信字符串
#snmp-server community secret rw        (读写) ;配置读写通信字符串
#snmp-server enable traps                配置网关SNMP TRAP
#snmp-server host 10.254.190.1 rw        配置网关工作站地址
在路由器上配置日志信息(Syslog Message Logging)
router(config) # logging on
router(config) # logging server-ip-address
router(config) # logging trap severity-level
华为交换机SNMP配置
<switch>
<switch>system-view                   进入交换机的配置模式、
[switch]snmp-agent community read huawei 配置community 只读属性为huawei
[switch]snmp-agent community write huawei配置community 可写属性为huawei
[switch]snmp-agent sys-info version all      配置版本为所有

港湾交换机配置TELNET SNMP
启动SNMP服务的配置步骤如下:
配置步骤
步骤1 service snmp enable 使能SNMP agent服务
步骤2 service snmp trap enable 使能SNMP trap服务
步骤3 config snmp community readonly <string> 设置SNMP只读权限认证密码
步骤4 config snmp community readwrite <string> 设置SNMP读写权限认证密码
步骤5 config snmpauthentrap [enable|disable] 使用enable设置当SNMP认证失败时发送trap
步骤6 show service 显示SNMP是否启动
步骤7 show snmp community-string 显示当前的权限认证密码
配置SNMP trap
交换机上的SNMP agent会产生很多种类的trap信息,如启动(start)、接口(interface)、RMON(远程监控)等。可以在交换机上配置SNMP trap来指定一台或多台trap接收站(trap receiver),并指定哪些种类的trap信息会发送到这些接收站。
配置步骤
步骤1 service snmp enable 使能SNMP agent服务
步骤2 service snmp trap enable 使能SNMP trap服务
步骤3 config snmp trap type [all|interface|bgp|ospf|vrrp|stp|rmon|start|auth|pppoe|isis] [on|off] 配置发送trap的类型
步骤4 config snmp trapreceiver add <A.B.C.D> version [v1|v2c] {community <string>}*1 添加一个trap接收站
步骤5 config snmp trapreceiver add <A.B.C.D> version [v1|v2c] {community <string>}*1 添加另一个trap接收站
步骤6 show snmp trap type 显示系统允许发送的trap种类
步骤7 Show snmp trapreceiver 显示已经添加的所有trap接收站
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章