Tools

Account Tools

Search Tools


Enabling SNMP on Centos / Redhat

To configure snmp on Redhat/centos, you first need to install the snmpd package using the command :

copy
yum install net-snmp

Then edit the configuration file :

copy
nano /etc/snmp/snmpd.conf

add the line :

copy
rocommunity public

Next, restart the SNMP service by typing :

copy
service snmpd restart

If you have a firewall, don't forget to add a rule that allows port 161.

copy
firewall-cmd --add-port=161/udp --permanent
firewall-cmd --reload

If the service does not respond to the SNMP request and you get an error of this type, in your log file : /var/log/messages

Dec 8 07:13:47 era snmpd[19465]: Connection from UDP: [10.10.0.149]:56275->[10.15.0.1]:161 REFUSED

Simply edit the host.allow file

copy
nano /etc/hosts.allow

and add a line like this : « snmpd: <votre ip> », for example :

copy
snmpd: 10.10.0.149

Next, you need to restart the SNMP service:

copy
service snmpd restart
en/snmp/snmp_centos_redhat.txt · Last modified: 2025/11/21 09:51 by q.george