Snmp server setup and configuration on Rhel5 (step by step)
by sahab on Mar.13, 2010, under RHEL5
First Download and Install following packages
#rpm -vih net-snmp-5.3.1-24.el5_2.2.x86_64.rpm
#rpm -ivh net-snmp-utils-5.3.1-24.el5_2.2.x86_64.rpm
# cd /etc/snmp/
# cp -rp snmpd.conf snmpd.conf.bak
open the the snmpd.conf and add below entry at the end of the line
to set the Read Only community string to testuser
rocommunity testuser 127.0.0.1
Now, configure the SNMP services on each reboot
with the following chkconfig command:
# chkconfig snmpd on
Restart SNMP to load the new configuration file:
# service snmpd restart
Test the localhost with the following two commands.
#snmpwalk -v 1 -c testuser localhost system
#snmpwalk -v 1 -c testuser localhost interface
after that i have checked the server , the port of
snmp and snmptrap 161,162 are running using nmap and netstat.
#nmap localhost
#netstat -an|grep 161|grep LISTEN
But the port is not listed there. After that I have added
following entry in /etc/snmp/snmpd.conf
agentaddress tcp:161
and restart the snmpd for listen the net-snmp port
netstat -an|grep 161|grep LISTEN
tcp       0     0 0.0.0.0:161   0.0.0.0:*        LISTEN
nmap localhost
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2010-03-13 14:59 IST
Interesting ports on localhost.localdomain (127.0.0.1):
Not shown: 1671 closed ports
PORTÂ Â Â STATE SERVICE
22/tcp open ssh
25/tcp open smtp
80/tcp open http
111/tcp open rpcbind
161/tcp open snmp
199/tcp open smux
443/tcp open https
631/tcp open ipp
808/tcp open ccproxy-http
May 10th, 2010 on 4:12 pm
Thanks for sharing this helpful info!
March 26th, 2012 on 2:12 pm
How do we configure the same if we need to allow only access to SNMP request from specific range of IP