Discussion:
snmpd 5.7.3 under FreeBSD 10.2 does not reply to SNMP requests
(too old to reply)
Martin T
2015-10-19 17:42:48 UTC
Permalink
Hi,

I compiled Net-SNMP snmpd version 5.7.3 under FreeBSD 10.2. When I
start the snmpd with "snmpd -f -C -c /etc/snmpd.config" command, then
it listens on UDP port 161:

***@FreeBSD10:~ # sockstat -4l
USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
root snmpd 29916 8 udp4 *:161 *:*
root sendmail 553 3 tcp4 127.0.0.1:25 *:*
root sshd 550 4 tcp4 *:22 *:*
root syslogd 359 7 udp4 *:514 *:*
***@FreeBSD10:~ # ps -fp 29916
PID TT STAT TIME COMMAND
29916 0 S+ 0:00.61 snmpd -f -C -c /etc/snmpd.config
***@FreeBSD10:~ #

However, if I snmpwalk this host, then it does not reply to SNMP
messages. Content of /etc/snmpd.config can be seen below:

***@FreeBSD10:~ # grep -v '^#' /etc/snmpd.config | grep -vE '^$'
location := "Room 200"
contact := "***@example.com"
system := 1 # FreeBSD
traphost := localhost
trapport := 162
read := "public"
write := "geheim"
trap := "mytrap"
NoAuthProtocol := 1.3.6.1.6.3.10.1.1.1
HMACMD5AuthProtocol := 1.3.6.1.6.3.10.1.1.2
HMACSHAAuthProtocol := 1.3.6.1.6.3.10.1.1.3
NoPrivProtocol := 1.3.6.1.6.3.10.1.2.1
DESPrivProtocol := 1.3.6.1.6.3.10.1.2.2
AesCfb128Protocol := 1.3.6.1.6.3.10.1.2.4
securityModelAny := 0
securityModelSNMPv1 := 1
securityModelSNMPv2c := 2
securityModelUSM := 3
MPmodelSNMPv1 := 0
MPmodelSNMPv2c := 1
MPmodelSNMPv3 := 3
noAuthNoPriv := 1
authNoPriv := 2
authPriv := 3
%snmpd
begemotSnmpdDebugDumpPdus = 2
begemotSnmpdDebugSyslogPri = 7
begemotSnmpdCommunityString.0.1 = $(read)
begemotSnmpdCommunityDisable = 1
begemotSnmpdPortStatus.0.0.0.0.161 = 1
begemotSnmpdLocalPortStatus."/var/run/snmpd.sock" = 1
begemotSnmpdLocalPortType."/var/run/snmpd.sock" = 4
begemotTrapSinkStatus.[$(traphost)].$(trapport) = 4
begemotTrapSinkVersion.[$(traphost)].$(trapport) = 2
begemotTrapSinkComm.[$(traphost)].$(trapport) = $(trap)
sysContact = $(contact)
sysLocation = $(location)
sysObjectId = 1.3.6.1.4.1.12325.1.1.2.1.$(system)
snmpEnableAuthenTraps = 2
begemotSnmpdModulePath."mibII" = "/usr/lib/snmp_mibII.so"
***@FreeBSD10:~ #


If I use this very same configuration file with bsnmpd("bsnmpd -d -c
/etc/snmpd.config"), then host does reply to SNMP queries.


What might cause such behavior? Please let me know if additional
information is needed.


thanks,
Martin

------------------------------------------------------------------------------
Martin T
2015-10-20 08:33:57 UTC
Permalink
Hi,

for some reason I thought that bsnmpd configuration file is compatible
with Net-SNMP snmpd. While the Net-SNMP snmpd did not complain about
configuration file syntax(even if I started it with "snmpd -DALL -f -C
-c /etc/snmpd.config"), then it did not reply to SNMP requests.


regards,
Martin
Post by Martin T
Hi,
I compiled Net-SNMP snmpd version 5.7.3 under FreeBSD 10.2. When I
start the snmpd with "snmpd -f -C -c /etc/snmpd.config" command, then
USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
root snmpd 29916 8 udp4 *:161 *:*
root sendmail 553 3 tcp4 127.0.0.1:25 *:*
root sshd 550 4 tcp4 *:22 *:*
root syslogd 359 7 udp4 *:514 *:*
PID TT STAT TIME COMMAND
29916 0 S+ 0:00.61 snmpd -f -C -c /etc/snmpd.config
However, if I snmpwalk this host, then it does not reply to SNMP
location := "Room 200"
system := 1 # FreeBSD
traphost := localhost
trapport := 162
read := "public"
write := "geheim"
trap := "mytrap"
NoAuthProtocol := 1.3.6.1.6.3.10.1.1.1
HMACMD5AuthProtocol := 1.3.6.1.6.3.10.1.1.2
HMACSHAAuthProtocol := 1.3.6.1.6.3.10.1.1.3
NoPrivProtocol := 1.3.6.1.6.3.10.1.2.1
DESPrivProtocol := 1.3.6.1.6.3.10.1.2.2
AesCfb128Protocol := 1.3.6.1.6.3.10.1.2.4
securityModelAny := 0
securityModelSNMPv1 := 1
securityModelSNMPv2c := 2
securityModelUSM := 3
MPmodelSNMPv1 := 0
MPmodelSNMPv2c := 1
MPmodelSNMPv3 := 3
noAuthNoPriv := 1
authNoPriv := 2
authPriv := 3
%snmpd
begemotSnmpdDebugDumpPdus = 2
begemotSnmpdDebugSyslogPri = 7
begemotSnmpdCommunityString.0.1 = $(read)
begemotSnmpdCommunityDisable = 1
begemotSnmpdPortStatus.0.0.0.0.161 = 1
begemotSnmpdLocalPortStatus."/var/run/snmpd.sock" = 1
begemotSnmpdLocalPortType."/var/run/snmpd.sock" = 4
begemotTrapSinkStatus.[$(traphost)].$(trapport) = 4
begemotTrapSinkVersion.[$(traphost)].$(trapport) = 2
begemotTrapSinkComm.[$(traphost)].$(trapport) = $(trap)
sysContact = $(contact)
sysLocation = $(location)
sysObjectId = 1.3.6.1.4.1.12325.1.1.2.1.$(system)
snmpEnableAuthenTraps = 2
begemotSnmpdModulePath."mibII" = "/usr/lib/snmp_mibII.so"
If I use this very same configuration file with bsnmpd("bsnmpd -d -c
/etc/snmpd.config"), then host does reply to SNMP queries.
What might cause such behavior? Please let me know if additional
information is needed.
thanks,
Martin
------------------------------------------------------------------------------
Loading...