Centos – SNMPD timeout yet netcat shows port as open

centossnmp

SNMPD config (I have this config working on a different server):

com2sec readonly  default         public
group MyROGroup v1         readonly
group MyROGroup v2c        readonly
group MyROGroup usm        readonly
view all    included  .1                               80
access MyROGroup ""      any       noauth    exact  all    none   none
syslocation <LOCATION>
syscontact <CONTACT>

When I check the port from remote machine:

ยป nc -zvu xx.xx.xx.xx 161                                                                                                                                                                              
Connection to xx.xx.xx.xx 161 port [udp/snmp] succeeded!

This also works locally (I get all the right stats):

snmpwalk -v 2c -c public localhost

Yet when I try same command locally or remotely with external IP:

Timeout: No Response from xx.xx.xx.xx

IPTables are disabled on both machines.

/etc/sysconfig/snmpd looks like this:

OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid" -a

/etc/default/snmpd is empty.

Running netstat -tulpn:

udp        0      0 0.0.0.0:161                 0.0.0.0:*                               29475/snmpd 

Best Answer

Your netcat specifies UDP. As long as you can send it is successful regardless of the receiving ends ability to listen.

Related Topic