Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1217647
  • 博文数量: 135
  • 博客积分: 10576
  • 博客等级: 上将
  • 技术积分: 1670
  • 用 户 组: 普通用户
  • 注册时间: 2008-06-11 20:49
个人简介

不疯魔,不成活! --疯魔老杨(Crazy.LaoYang) http://www.inotes.cn/

文章分类

全部博文(135)

文章存档

2014年(4)

2012年(13)

2011年(5)

2010年(30)

2009年(56)

2008年(27)

分类: LINUX

2012-09-21 14:02:45

snmp V3的方式设置简单,而且安全性更高。

配置方法:
1.停止snmpd服务
  #service snmpd stop

2.增加snmpv3用户,并设置认证以及加密方式
  # net-snmp-create-v3-user
    Enter a SNMPv3 user name to create:
    enocsnmpv3
    Enter authentication pass-phrase:
    enocsnmpv3pw
    Enter encryption pass-phrase:
    [press return to reuse the authentication pass-phrase]
    enocsnmpv3pk
    adding the following line to /var/lib/net-snmp/snmpd.conf:
       createUser enocsnmpv3 MD5 "enocsnmpv3pw" DES enocsnmpv3pk
    adding the following line to /etc/snmp/snmpd.conf:
       rwuser enocsnmpv3


3.启动snmpd服务
 # service snmpd restart

现通过snmpwalk测试一下:
# snmpwalk -v3 -uenocsnmpv3 -lauth -aMD5 -A"enocsnmpv3pw" -X"enocsnmpv3pk" localhost  | more
SNMPv2-MIB::sysDescr.0 = STRING: Linux CentOS60A 2.6.32-71.el6.i686 #1 SMP Fri Nov 12 04:17:17 GMT 2010 i686
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::org
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (9443) 0:01:34.43


或:
# snmpwalk -v3 -uenocsnmpv3 -lauth -aMD5 -A"enocsnmpv3pw"  localhost .1 | more
或:
# snmpwalk -v3 -lauth -uenocsnmpv3 -aMD5 -xDES -A"enocsnmpv3pw" -X"enocsnmpv3pk" localhost .1 | more

补充:
SNMP Version 3 specific
  -a PROTOCOL           set authentication protocol (MD5|SHA)
  -A PASSPHRASE         set authentication protocol pass phrase
  -e ENGINE-ID          set security engine ID (e.g. 800000020109840301)
  -E ENGINE-ID          set context engine ID (e.g. 800000020109840301)
  -l LEVEL              set security level (noAuthNoPriv|authNoPriv|authPriv)
  -n CONTEXT            set context name (e.g. bridge1)
  -u USER-NAME          set security name (e.g. bert)
  -x PROTOCOL           set privacy protocol (DES|AES)
  -X PASSPHRASE         set privacy protocol pass phrase
  -Z BOOTS,TIME         set destination engine boots/time
阅读(12807) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

bingogo19862013-09-26 16:48:15

博主,您好。有个问题想请教一下,我使用的是snmptrap自陷的方式获取snmp信息,如果配置了v3,那么v1 v2这两种方式发送来的报文是否可以一起接收?