---
type: Setup Guide
title: "How to Install & Configure snmpd on CentOS / RHEL"
description: "Install net-snmp on the RHEL family with dnf/yum, configure a secure snmpd.conf, open firewalld for UDP 161, handle SELinux, and test with snmpwalk."
resource: "https://snmp-monitoring.info/setup/centos-rhel/"
tags: [setup]
timestamp: 2026-07-11T00:00:00Z
---

# How to Install & Configure snmpd on CentOS / RHEL

Install net-snmp on the RHEL family with dnf/yum, configure a secure snmpd.conf, open firewalld for UDP 161, handle SELinux, and test with snmpwalk.

## Related concepts

- Up: [SNMP Setup & Configuration: Install, Secure & Test](/setup/index.md)

## Frequently asked questions

### How do I install snmpd on CentOS or RHEL?

Run sudo dnf install net-snmp net-snmp-utils on RHEL 8/9, Rocky, or AlmaLinux (use yum on CentOS 7). net-snmp is the agent, net-snmp-utils the client tools. Then edit /etc/snmp/snmpd.conf, enable the service with systemctl enable --now snmpd, open firewalld, and test.

### yum or dnf — which do I use?

Use dnf on RHEL 8/9 and the modern rebuilds (Rocky, AlmaLinux); use yum on CentOS 7 and older RHEL. On modern releases yum is a compatibility alias for dnf, so it often still works, but dnf is the correct current tool. The package names (net-snmp, net-snmp-utils) are the same either way.

### How do I open port 161 on firewalld?

Run sudo firewall-cmd --add-port=161/udp --permanent then sudo firewall-cmd --reload. The --permanent flag persists the rule across reboots and --reload applies it. For a tighter posture, use a rich rule scoped to your poller's source IP instead of opening 161 to everything.

### Why does my extend script fail on RHEL?

Almost always SELinux. It runs enforcing by default and blocks snmpd from executing a custom extend/pass script or binding a non-standard port, so the agent runs but the feature silently fails. Check sudo ausearch -m avc -ts recent | grep snmpd for an AVC denial, then add the appropriate policy rather than disabling SELinux.

## Source

Concept generated from https://snmp-monitoring.info/setup/centos-rhel/ — the SNMP Monitoring vendor-neutral knowledge base. Content is limited to what that page states (no external claims added here).
