--------switch example--------
- enable snmp function and firewall port for snmp
\#snmpget
snmpget -v 1 192.168.1.21 -c public sysName.0
snmpget -v 1 -c public 192.168.1.21 SNMPv2-MIB::sysLocation.0
snmpget -v 1 -c public 192.168.1.21 .1.3.6.1.2.1.55.1
snmpget -v 1 -c public 192.168.1.21 IF-MIB::ifType.0
snmpget -v 1 192.168.1.1 -c public sysLocation.0
\#CPU
snmpget -v 1 -c public 192.168.1.1 1.3.6.1.4.1.2021.10.3.1
\#snmpset
snmpwalk -v 1 192.168.1.1 -c public sysLocation
snmpset -v 1 -c private 192.168.1.1 sysName.0 s "hello world"
snmpset -v 1 -c private 192.168.1.1 sysLocation.0 s "hello world"
snmpset -v 1 -c private 192.168.1.1 sysContact.0 s "hello world"
snmpset -v 2c -c private 192.168.1.1 sysName.0 s "abcdefghijklmnopqrstuvwxyz"
snmpset -v 2c -c private 192.168.1.1 sysLocation.0 s "abcdefghijklmnopqrstuvwxyz"
snmpset -v 2c -c private 192.168.1.1 sysContact.0 s "abcdefghijklmnopqrstuvwxyz"
snmpset -v 1 -c private 192.168.1.1 sysName.0 s "hello"
\#snmpbulkget
snmpbulkget -v 2c 192.168.1.1 -c public .1.3.6.1.2.1.55.1
\*snmpv2
snmpwalk -v 2c 192.168.1.253 -c 12345678
snmpwalk -v 2c 192.168.1.253 -c 12345678 .1
snmpwalk -v 2c 192.168.1.253 -c 12345678 system
snmpwalk -v 2c 3002::8a43:e1ff:feac:ace4 -c 12345678
snmpwalk -v 2c 3002::8a43:e1ff:feac:ace4 -c 12345678 .1
\*\*snmpwalk -v3 -l <noAuthNoPriv\|authNoPriv\|authPriv> -u <username> \[-a <MD5\|SHA>\] \[-A <authphrase>\] \[-x DES\] \[-X <privaphrase>\] <ipaddress>\[:<dest\_port>\] \[oid\]
snmpwalk -v3 -l noAuthNoPriv -u test 192.168.1.253 .1
snmpwalk -v3 -l AuthNoPriv -u test1234 -a MD5 -A test1234 192.168.1.253:161 .1
snmpwalk -v3 -l AuthPriv -u test12345 -a MD5 -A test12345 -x DES -X test12345 192.168.1.253 .1
snmpwalk -v3 -l AuthNoPriv -u test123456 -a SHA -A test123456 192.168.1.253:161 .1
snmpwalk -v3 -l AuthPriv -u test1234567 -a SHA -A test1234567 -x DES -X test1234567 192.168.1.253 .1
for testing