Fc4 Linux 上利用net-snmp进行snmpv3测试

本文介绍如何从源码安装Net-SNMP 5.0.11版本,并详细说明了如何配置SNMPv3用户的过程。包括下载源码包、编译安装、创建配置文件、添加用户配置以及测试命令等内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.download net-snmp source package from sourceforge.net.use the version 5.0.11.

2.install according to INSTALL.
    ./configure
    make
    make install
    make clean.

3.copy EXAMPLE.conf file to ~/.snmp/ as snmpd.conf,and change some configurations if needed.

4.add snmpv3 Config
snmpv3 config command:
net-snmp-config --create-snmpv3-user -ro -a authpass -x privpass -X DES -A MD5 v3username
after run ,it will modify to files.
adding the following line to /var/net-snmp/snmpd.conf:
    createUser v3user MD5 "authpass" DES privpass
adding the following line to /usr/local/share/snmp/snmpd.conf:
    rouser v3username

actually,the snmpd program uses the config file under ~/.snmp/.So add the user name
in file ~/.snmp/snmpd.conf.
at last,the Access Control section maybe like this.
---------------------------------------------------------------------------------------------
# rouser: a SNMPv3 read-only user
#   arguments:  user [noauth|auth|priv] [restriction_oid]
rouser v3username

#
# Unknown directives read in from other files by snmpconf
#
com2sec local     localhost       public
com2sec mynetwork 192.168.7.0/24      public
group MyRWGroup v1         local
group MyRWGroup v2c        local
group MyRWGroup usm        local
group MyROGroup v1         mynetwork
group MyROGroup v2c        mynetwork
group MyROGroup usm        mynetwork
view all    included  .1                               80
access MyROGroup ""      any       noauth    exact  all    none   none
access MyRWGroup ""      any       noauth    exact  all    all    none
access MyRWGroup cname   any       auth      exact  all    all    none
---------------------------------------------------------------------------------------------


5.Run test
snmpv3  walk command for net-snmp agnet.

snmpwalk -v 3 -u v3username -l authPriv -a MD5 -A authpass -x DES -X privpass localhost system





[root@localhost .snmp]# snmpd -v

NET-SNMP version:  5.0.11
Web:               http://www.net-snmp.org/
Email:             net-snmp-coders@lists.sourceforge.net
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值