您的位置:首页 > 其它

思科设备snmp配置。

2012-10-28 18:40 435 查看
1、设置IOS设备在IOS的Enable状态下,敲入

config terminal进入全局配置状态

Cdp run启用CDP

snmp-server community gsunion ro \\配置本路由器的只读字串为gsunion

snmp-server community gsunion rw \\配置本路由器的读写字串为gsunion

snmp-server enable traps \\允许路由器将所有类型SNMP Trap发送出去

snmp-server host IP-address-server traps trapcomm

\\指定路由器SNMP Trap的接收者为10.238.18.17,发送Trap时采用trapcomm作为字串

snmp-server trap-source loopback0 \\将loopback接口的IP地址作为SNMP Trap的发送源地址

syslog配置

logging on起动log机制

logging IP-address-server将log记录发送到10.238.18.17 (CW2K安装机器的IP地址)上的syslog server

logging facility local7将记录事件类型定义为local7

logging trap warning将记录事件严重级别定义为从warningl开始,一直到最紧急级别的事件全部记录到前边指定的syslog server.

logging source-interface loopback0指定记录事件的发送源地址为loopback0的IP地址

service timestamps log datetime发送记录事件的时候包含时间标记

enable password ******

line tty 0 4

password ******

login local设置Enable口令和Telnet口令

show running

copy running start或write terminal显示并检查配置

保存配置

配置Cisco设备的SNMP代理

配置Cisco设备上的SNMP代理的步骤如下:

启用SNMP:

configure terminal

snmp-server community rw/ro (example: snmp-server community public ro)

end

copy running-configstartup-config

启用陷阱:

configure terminal

snmp-server enable traps snmp authentication

end

copy running-configstartup-config

配置snmp

#conf t

#snmp-server community cisco ro(只读);配置只读通信字符串

#snmp-server community secret rw(读写);配置读写通信字符串

#snmp-server enable traps;配置网关SNMP TRAP

#snmp-server host 10.254.190.1 rw;配置网关工作站地址

2、设置CatOS设备

在CatOS的Enable状态下,敲入

set interface sc0 VLAN ID IP address配置交换机本地管理接口所在VLAN ID,IP地址,子网掩码

Set cdp enable all启用CDP

set snmp community read-only gsunion配置本交换机的只读字串为public

set snmp community read-write-all gsunion配置本交换机的读写字串为private

set snmp trap server-ip gsunion

指定交换机SNMP Trap的接收者为网管服务器,发送Trap时采用gsunion作为字串

set snmp trap enable all将全部类型的SNMP Trap发送出去

set snmp rmon enable激活交换机的SNMP RMON功能

set logging server IP-address-server将log记录发送到网管服务器的IP (CW2K安装机器的IP地址)上的syslog server

set logging level 6将记录事件严重级别定义为从informational开始,一直到最紧急级别的事件全部记录到前边指定的syslog server

set logging server facility local7将记录事件类型定义为local7

set logging timestamp发送记录事件的时候包含时间标记

set logging enable起动log机制

set password ******

set enablepass ******

设置Enable口令和Telnet口令

show running

write terminal显示并检查配置

保存配置

3、配置PIX设备

Logging on在PIX上面启用日志记录

Snmp-server community gsunion为PIX设备配置共同体串gsunion

Snmp-server enable traps配置PIX设备将SNMP消息发送到网管服务器

Snmp-server host server-ip在PIX设备上面配置SNMP网管服务器

Logging history warning

为PIX设备SNMP系统日志消息设置warning级别。

配置SNMP管理

Router(config)# access-list num permit host host-ip

定义访问控制表,限制路由器支持网管工作站

Router(config)# snmp-server community community RO [access-list-num]

配置只读权限的community,与上面定义的访问控制表联系,限制网管工作站的IP地址

Router(config)# snmp-server community community RW [access-list-num]

配置具有读写权限的community,与上面定义的访问控制表联系,限制网管工作站的IP地址

Router(config)# snmp-server enable traps

允许发出Trap
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: