title: How to set up snmpd to listen on an alternative port (other than 161)?
body: <p>I am working on a CentOS 6.4 64-bit, as root. I am trying to set up the system snmpd agent, so that it listens on a port other than 161, e.g. 8001. I successfully got that on Debian 7.x by just changing the port number in <code>/etc/snmp/snmpd.conf</code>:</p>
  
  <pre><code>agentAddress  udp:127.0.0.1:8001
  </code></pre>
  
  <p>and restarting the service with <code>/etc/init.d/snmpd restart</code>. It was straightforward. However, I tried several things but I didn't manage to do that on CentOS, i.e. snmpd will fail to start.</p>
  
  <p>These are the last two lines written in /var/log/messages when I try to run it with that line in snmpd.conf:</p>
  
  <pre><code>Oct 13 15:47:40 localhost snmpd[4775]: Error opening specified endpoint "udp:127.0.0.1:8001"
  Oct 13 15:47:40 localhost snmpd[4775]: Server Exiting with code 1
  </code></pre>
  
  <p>On the other hand, if I run the program directly, it will start and will happily open port 8001:</p>
  
  <pre><code>/usr/sbin/snmpd udp:127.0.0.1:8001
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>/usr/sbin/snmpd udp:8001
  </code></pre>
  
  <p>Both ways work.</p>
  
  <p>I have googled and read about <code>/etc/sysconfig/snmpd</code>, but adding some options in this file did not work either. For info, I disabled iptables (<code>ipdatables -F</code>).</p>
  
  <p>Could anybody help me on this?</p>
  
  <p>Thanks in advance,
  Antonio</p>