net-snmp send spoof-trap

本文介绍了如何使用SNMP协议配置Trap消息发送及接收。详细解释了snmptrap命令的用法,包括发送不同类型的Trap通知,以及配置snmptrapd服务来监听这些通知。还讨论了5.3版本之后的访问控制变化,并提供了禁用访问控制的方法。

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

NuDesign Visual MIBrowser Pro to view mids.

注意参数需要加.index

1)snmptrap -v2c -c public 127.0.0.1 "" trap_oid varible.index varible_type varible_value
2)snmptrap -v2c -c public 127.0.0.1 "" IF-MIB::linkDown ifAdminStatus.22 i 2
3)snmptrap -v2c -c public 127.0.0.1 "" 1.3.6.1.6.3.1.1.5.3 1.3.6.1.6.3.1.1.5.3.22 i 2

监听trap::snmptrapd -f -Lo

net-snmp mib文件存放地点
/usr/share/snmp/mibs

配置文件存放地点
/etc/snmp/snmpd.conf

/etc/init.d/snmpd restart
---------------------------------------------------
•Conf file locates at: /etc/snmp/snmpd.conf

•Mibs file locates at: /usr/share/snmp/mibs

•Restart it by command

•: /etc/init.d/snmpd restart

•snmpget -v2c -c public 127.0.0.1 sysName.0

•snmpgetnext -v2c -c public 127.0.0.1 sysName.0

•snmpwalk -v2c -c public ip 1.3.6.1.2.1.2.2.1.1

•snmptable -v2c -c public ip 1.3.6.1.2.1.2.2

trap listener in port 162(default)

•snmptrapd -f -Lo

send traps

•snmptrap -v2c -c public 127.0.0.1 '' IF-MIB::linkDown ifAdminStatus.2 i 2

•snmptrap -v2c -c public 127.0.0.1 "" 1.3.6.1.6.3.1.1.5.3 1.3.6.1.6.3.1.1.5.3.22 i 2

Previously, snmptrapd would accept all incoming notifications, and log them auto...
Previously, snmptrapd would accept all incoming notifications, and log them automatically (even if no explicit configuration was provided). Starting with release 5.3, access control checks will be applied to incoming notifications. If snmptrapd is run without a suitable configuration file (or equivalent access control settings), then such traps WILL NOT be processed. See the section ACCESS CONTROL for more details.
The option you are probably interested in can be found at the bootom of the "ACCESS CONTROL" section. It says:
disableAuthorization yes
will disable the above access control checks, and revert to the previous behaviour of accepting all incoming notifications.

If you add
disableAuthorization yes
to /etc/snmp/snmptrapd.conf you should be happy. If this file does not exist, create it, then restart snmptrapd. It does appear that snmptrapd.conf may alternately be found in /usr/share/snmp, but I have not put it there in any of my configurations.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值