1.snmp v3 代理
底层使用snmpv2 代理
代理段,SNMP的.conf添加
rouser read123
createUser read123 SHA sha12345 AES admin12345
rwuser write123
createUser write123 SHA sha12345 AES admin12345
#,7,2,192.168.7.52
com2sec -Cn remote_switchr7 switch_r7 4.21.1.16 cmty_switch7
group switch_rg7 v2c switch_r7
view switch_rg7view included .1
access switch_rg7 remote_switchr7 v2c noauth exact switch_rg7view none none
proxy -Cn remote_switchr7 -v2c -c public 192.168.7.52 1.3.6
com2sec -Cn remote_switchw7 switch_w7 4.21.1.16 cmty_switch7w
group switch_wg7 v2c switch_w7
view switch_wg7view included .1
access switch_wg7 remote_switchw7 v2c noauth exact none switch_wg7view none
proxy -Cn remote_switchw7 -v2c -c private 192.168.7.52 1.3.6
NMS获取
ubuntu@ubuntu:/usr/local/net-snmp/bin$ ./snmpwalk -n remote_switchr7 -v 3 -u read123 -a SHA -A sha12345 -x AES -X admin12345 -lauthpriv 192.168.7.100 1.3.6.1.4.1.54367.1.4.1
SNMPv2-SMI::enterprises.54367.1.4.1.2.0 = STRING: "centecOS-g5610-fast-v5.3.11.64.r.bin"
SNMPv2-SMI::enterprises.54367.1.4.1.2.1 = STRING: "centecOS-g5610-fast-v5.3.11.58.r.bin"
SNMPv2-SMI::enterprises.54367.1.4.1.3.0 = STRING: "2021-10-11 10:23:55"
SNMPv2-SMI::enterprises.54367.1.4.1.3.1 = STRING: "2021-07-22 13:00:56"
SNMPv2-SMI::enterprises.54367.1.4.1.4.0 = STRING: "v5.3.11.64"
SNMPv2-SMI::enterprises.54367.1.4.1.4.1 = STRING: "v5.3.11.58"
SNMPv2-SMI::enterprises.54367.1.4.1.5.0 = STRING: "40.7M"
SNMPv2-SMI::enterprises.54367.1.4.1.5.1 = STRING: "40.7M"
SNMPv2-SMI::enterprises.54367.1.4.1.6.0 = STRING: "flash:/boot"
SNMPv2-SMI::enterprises.54367.1.4.1.6.1 = STRING: "flash:/boot"
SNMPv2-SMI::enterprises.54367.1.4.1.7.0 = INTEGER: 1
SNMPv2-SMI::enterprises.54367.1.4.1.7.1 = INTEGER: 2
ubuntu@ubuntu:/usr/local/net-snmp/bin$
2.snmp v3 直接代理,未测试
Setting up the proxy configuration
Now, to set up the proxy:
proxy -Cn ctx_remotehost1 -v 2c -c public remotehost1 .1.3
proxy -Cn ctx_remotehost2 -v 3 -u MD5DESUser -a MD5 -A "PasswordA" -x DES -X "PasswordX" -l authPriv remotehost2 .1.3
Start snmpd (or restart it, if it was already running), and then test your new setup.