snmp proxy
Mark Christiansen <[email protected]>
| Newsgroups | gmane.network.net-snmp.devel |
|---|---|
| Message-ID | <CABbGQ1fhk+9e01nkNLyES0se7fEM8bKqauNA2AmWwBgzoeKYag@mail.gmail.com> |
I am having problems with getting proxying to work on net-snmp version 5.8 that I built for Windows 10. I followed the proxy guidelines at http://net-snmp.sourceforge.net/wiki/index.php/Snmpd_proxy and set up the attached snmpd.conf file where I am using test.net-snmp.org as the "switch" in the example. Note that I am proxying the entire tree of test.net-snmp.org to 1.4 as well as using context to proxy the entire tree, using the instructions in the proxy documentation page. Proxying the entire tree works as expected: C:\Users\markw>snmpgetnext -v 2c -c public localhost 1.4 iso.4.6.1.2.1.1.1.0 = STRING: "test.net-snmp.org" I attached proxy-entire-tree.txt for the snmpd debug output. Proxying using contexts does not work as expected: C:\Users\markw>snmpgetnext -v 2c -c cmty_myswitch localhost 1.3 Timeout: No Response from localhost. I attached proxy-using-context-mapping.txt for the snmpd debug output. Any ideas of what I'm doing wrong? Thanks. Mark. _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
proxy-using-context-mapping.txt
(text/plain, 2.3 KB)
C:\Users\markw>snmpd -d -Dnetsnmp_udp_parse_security,netsnmp_udp6_parse_security,netsnmp_unix_parse_security,tls,tsm. registered debug token netsnmp_udp_parse_security, 1 registered debug token netsnmp_udp6_parse_security, 1 registered debug token netsnmp_unix_parse_security, 1 registered debug token tls, 1 registered debug token tsm., 1 netsnmp_udp_parse_security: <"public", 0.0.0.0/0.0.0.0> => "comm3" netsnmp_udp_parse_security: <"private", 0.0.0.0/0.0.0.0> => "comm4" netsnmp_udp_parse_security: <"cmty_myswitch", 0.0.0.0/0.0.0.0> => "notConfigUser" NET-SNMP version 5.8 Received 41 byte packet from UDP: [127.0.0.1]:64530->[127.0.0.1]:161 0000: 30 27 02 01 01 04 0D 63 6D 74 79 5F 6D 79 73 77 0'.....cmty_mysw 0016: 69 74 63 68 A1 13 02 02 6E A5 02 01 00 02 01 00 itch¡...n¥...... 0032: 30 07 30 05 06 01 2B 05 00 0.0...+.. Received 41 byte packet from UDP: [127.0.0.1]:64530->[127.0.0.1]:161 0000: 30 27 02 01 01 04 0D 63 6D 74 79 5F 6D 79 73 77 0'.....cmty_mysw 0016: 69 74 63 68 A1 13 02 02 6E A5 02 01 00 02 01 00 itch¡...n¥...... 0032: 30 07 30 05 06 01 2B 05 00 0.0...+.. Received 41 byte packet from UDP: [127.0.0.1]:64530->[127.0.0.1]:161 0000: 30 27 02 01 01 04 0D 63 6D 74 79 5F 6D 79 73 77 0'.....cmty_mysw 0016: 69 74 63 68 A1 13 02 02 6E A5 02 01 00 02 01 00 itch¡...n¥...... 0032: 30 07 30 05 06 01 2B 05 00 0.0...+.. Received 41 byte packet from UDP: [127.0.0.1]:64530->[127.0.0.1]:161 0000: 30 27 02 01 01 04 0D 63 6D 74 79 5F 6D 79 73 77 0'.....cmty_mysw 0016: 69 74 63 68 A1 13 02 02 6E A5 02 01 00 02 01 00 itch¡...n¥...... 0032: 30 07 30 05 06 01 2B 05 00 0.0...+.. Received 41 byte packet from UDP: [127.0.0.1]:64530->[127.0.0.1]:161 0000: 30 27 02 01 01 04 0D 63 6D 74 79 5F 6D 79 73 77 0'.....cmty_mysw 0016: 69 74 63 68 A1 13 02 02 6E A5 02 01 00 02 01 00 itch¡...n¥...... 0032: 30 07 30 05 06 01 2B 05 00 0.0...+.. Received 41 byte packet from UDP: [127.0.0.1]:64530->[127.0.0.1]:161 0000: 30 27 02 01 01 04 0D 63 6D 74 79 5F 6D 79 73 77 0'.....cmty_mysw 0016: 69 74 63 68 A1 13 02 02 6E A5 02 01 00 02 01 00 itch¡...n¥...... 0032: 30 07 30 05 06 01 2B 05 00 0.0...+..
snmpd.conf
(application/octet-stream, 1.7 KB)
###########################################################################
# SECTION: Access Control Setup
#
# This section defines who is allowed to talk to your running
# snmp agent.
# rwuser: a SNMPv3 read-write user
# arguments: user [noauth|auth|priv] [restriction_oid]
rwuser private
# rouser: a SNMPv3 read-only user
# arguments: user [noauth|auth|priv] [restriction_oid]
rouser public
# rocommunity: a SNMPv1/SNMPv2c read-only access community name
# arguments: community [default|hostname|network/bits] [oid]
rocommunity public
# rwcommunity: a SNMPv1/SNMPv2c read-write access community name
# arguments: community [default|hostname|network/bits] [oid]
rwcommunity private
###########################################################################
# Proxy entire tree by remapping to OID
###########################################################################
# proxy [-Cn CONTEXTNAME] [SNMPCMD_ARGS] HOST OID [REMOTEOID]
proxy -v 2c -c demopublic test.net-snmp.org .1.4 .1.3
###########################################################################
# Proxy using context mapping
###########################################################################
# com2sec [-Cn CONTEXT] SECNAME SOURCE COMMUNITY
com2sec -Cn ctx_myswitch notConfigUser default cmty_myswitch
# view VNAME TYPE OID [MASK]
view allview included .1.3
# access GROUP CONTEXT {any|v1|v2c|usm|tsm|ksm} LEVEL PREFX READ WRITE NOTIFY
access notConfigGroup ctx_myswitch any noauth exact allview none none
# proxy [-Cn CONTEXTNAME] [SNMPCMD_ARGS] HOST OID [REMOTEOID]
proxy -Cn ctx_myswitch -v 2c -c demopublic test.net-snmp.org .1.3
###########################################################################
# Notes
proxy-entire-tree.txt
(text/plain, 1.9 KB)
C:\Users\markw>snmpd -d -Dnetsnmp_udp_parse_security,netsnmp_udp6_parse_security,netsnmp_unix_parse_security,tls,tsm. registered debug token netsnmp_udp_parse_security, 1 registered debug token netsnmp_udp6_parse_security, 1 registered debug token netsnmp_unix_parse_security, 1 registered debug token tls, 1 registered debug token tsm., 1 netsnmp_udp_parse_security: <"public", 0.0.0.0/0.0.0.0> => "comm3" netsnmp_udp_parse_security: <"private", 0.0.0.0/0.0.0.0> => "comm4" netsnmp_udp_parse_security: <"cmty_myswitch", 0.0.0.0/0.0.0.0> => "notConfigUser" NET-SNMP version 5.8 Received 34 byte packet from UDP: [127.0.0.1]:58693->[127.0.0.1]:161 0000: 30 20 02 01 01 04 06 70 75 62 6C 69 63 A1 13 02 0 .....public¡.. 0016: 02 69 A3 02 01 00 02 01 00 30 07 30 05 06 01 2C .i£......0.0..., 0032: 05 00 .. Sending 38 bytes to UDP: [192.94.214.205]:161->[0.0.0.0]:0 0000: 30 24 02 01 01 04 0A 64 65 6D 6F 70 75 62 6C 69 0$.....demopubli 0016: 63 A1 13 02 02 6B FE 02 01 00 02 01 00 30 07 30 c¡...k_......0.0 0032: 05 06 01 2B 05 00 ...+.. Received 62 byte packet from UDP: [192.94.214.205]:161->[0.0.0.0]:58694 0000: 30 3C 02 01 01 04 0A 64 65 6D 6F 70 75 62 6C 69 0<.....demopubli 0016: 63 A2 2B 02 02 6B FE 02 01 00 02 01 00 30 1F 30 c¢+..k_......0.0 0032: 1D 06 08 2B 06 01 02 01 01 01 00 04 11 74 65 73 ...+.........tes 0048: 74 2E 6E 65 74 2D 73 6E 6D 70 2E 6F 72 67 t.net-snmp.org Sending 58 bytes to UDP: [127.0.0.1]:58693->[127.0.0.1]:161 0000: 30 38 02 01 01 04 06 70 75 62 6C 69 63 A2 2B 02 08.....public¢+. 0016: 02 69 A3 02 01 00 02 01 00 30 1F 30 1D 06 08 2C .i£......0.0..., 0032: 06 01 02 01 01 01 00 04 11 74 65 73 74 2E 6E 65 .........test.ne 0048: 74 2D 73 6E 6D 70 2E 6F 72 67 t-snmp.org