How to enable SNMP on Linux CentOS6.5 or REDHAT
1. Install
– Login as root
[root@CentOS-Linux]# yum install net-snmp
[root@CentOS-Linux]# yum install net-snmp-utils
2. Configure ‘community string’
– Modify snmpd.conf file.
* save a backup as snmpd.conf.old.
[root@CentOS-Linux]# nano /etc/snmp/snmpd.conf
rocommunity public-ro 192.168.10.1 <– NMS#1 system’s IP.
rocommunity public-ro 192.168.10.2 <– NMS#2 system’s IP.
– Restart snmpd
[root@CentOS-Linux]# service snmpd restart
3. Firewall open
– Update iptables / firewall.
[root@CentOS-Linux]# nano /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -p tcp -m tcp –dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp –dport 443 -j ACCEPT
-A INPUT -p udp -m udp –dport 161 -j ACCEPT <– Add this
-A INPUT -i lo -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT
-A INPUT -j REJECT –reject-with icmp-host-prohibited
-A FORWARD -j REJECT –reject-with icmp-host-prohibited
COMMIT
– Update iptables / firewall.
[root@CentOS-Linux]# service iptables restart
4. Verifying and Troubleshooting
– Verifying
[root@NMS-Linux]# snmpwalk -v 2c -c wt-net 192.168.1.15 <– Taget SNMP node.
Being update……