What Is snmpwalk? Command Usage, Examples, and Troubleshooting

Network Monitoring · What is SNMPWALK?

SNMP and SNMPWALK are related, but they are not the same thing. What is snmpwalk? snmpwalk is a Net-SNMP command-line tool that sequentially queries all values beneath a specific OID on an SNMP agent. It is a cornerstone for device discovery, monitoring deployment, and troubleshooting processes.

ODYA Group • Technical Guide
Quick Answer

snmpwalk is a Net-SNMP command-line utility that sequentially queries all values starting from a specified OID on an SNMP agent. Unlike snmpget, which reads a single value, snmpwalk lists multi-row data such as a device's interfaces, hardware inventory, disk, and memory status in a single command. It is the go-to tool for network device discovery, monitoring setup, and SNMP troubleshooting.

📌 RELATED ARTICLE

What is SNMP? The Importance of SNMP in Network Monitoring

Read Article →
How It Works

How Does snmpwalk Work?

snmpwalk takes a starting OID and repeatedly asks the agent, "What is the next value after this?" As the agent returns the next object in the OID tree, the command continues until it reaches the end of the specified subtree. From a user perspective, this looks like walking through a tree structure.

  • SNMP v1: Uses a GETNEXT request at each step; each request returns a single value.
  • SNMP v2c and v3: Net-SNMP uses GETBULK by default. Because multiple values are retrieved in a single request, large tables are traversed much faster.

If no OID is provided, snmpwalk starts from the agent's default starting point (usually .1.3.6.1.2.1, which is MIB-2). On a large device, this can generate thousands of lines, so a target OID is usually specified in the field.

Installation

Installation

snmpwalk is not a standalone program; it is part of the Net-SNMP package.

# Debian / Ubuntu
sudo apt install snmp

# RHEL / Rocky / AlmaLinux
sudo dnf install net-snmp-utils

# macOS (Homebrew)
brew install net-snmp

On Windows, you can install the Net-SNMP Windows package or use the Linux version via WSL. After installation, verify the version with the following command:

snmpwalk -V

Tip: On Debian-based systems, default installations may not include MIB files, resulting in numeric OIDs instead of names in the output. To enable name resolution, install the corresponding MIB package or specify the MIB directory using -m ALL -M +/path/to/mibs parameters.

Usage

Basic Syntax and Parameters

snmpwalk [options] target_device [OID]
Parameter Description
-v 1 | 2c | 3 SNMP version
-c community Community string (v1 and v2c)
-l level v3 security level: noAuthNoPriv, authNoPriv, authPriv
-u user v3 username
-a / -A v3 authentication protocol (e.g., SHA) and password
-x / -X v3 encryption protocol (e.g., AES) and password
-On Show OIDs numerically instead of names
-Oq / -Ov Quiet output / values only
-t / -r Timeout (seconds) / retry count
-Cc Disable checking whether OIDs are increasing
-Cr N Max-repetitions value for GETBULK
-m ALL Load all MIB modules
Examples

Practical Examples (v2c and v3)

  • General Info
    Reading general device info (system group):
    snmpwalk -v2c -c public 192.168.1.1 system
    Returns basic fields such as device name, description, uptime, and contact information.
  • Numeric OID
    Querying with a numeric OID:
    snmpwalk -v2c -c public -On 192.168.1.1 .1.3.6.1.2.1.1
  • Interface List
    Listing interface names:
    snmpwalk -v2c -c public 192.168.1.1 ifDescr
  • Traffic Counters
    Interface traffic counters (64-bit):
    snmpwalk -v2c -c public 192.168.1.1 ifHCInOctets
  • SNMP v3
    Secure query with SNMP v3:
    snmpwalk -v3 -l authPriv -u monitoring_user -a SHA -A "auth_pass" -x AES -X "priv_pass" 192.168.1.1 system
OID List

Most Commonly Used OIDs

Information MIB Object OID
Device description sysDescr .1.3.6.1.2.1.1.1
Uptime sysUpTime .1.3.6.1.2.1.1.3
Device name sysName .1.3.6.1.2.1.1.5
Interface table ifTable .1.3.6.1.2.1.2.2
Extended interface (64-bit) ifXTable .1.3.6.1.2.1.31.1.1
Disk / memory hrStorageTable .1.3.6.1.2.1.25.2.3
Physical hardware inventory entPhysicalTable .1.3.6.1.2.1.47.1.1.1
Output Analysis

How to Read the Output?

IF-MIB::ifDescr.1 = STRING: GigabitEthernet0/1
IF-MIB::ifDescr.2 = STRING: GigabitEthernet0/2
IF-MIB::ifOperStatus.1 = INTEGER: up(1)
  • IF-MIB::ifDescr: The MIB and object name to which the item belongs.
  • .1, .2: Index. Represents each row in tables; think of it as the interface number.
  • STRING / INTEGER: Data type of the value. Other common types: Counter32, Counter64, Gauge32, Timeticks.
Troubleshooting

Common Errors and Solutions

Timeout
Timeout: No Response from host: Check community/v3 credentials, UDP 161 port accessibility, and ensure the SNMP service is running on the device.
No Such Object
No Such Object available: The device may not support this OID or the MIB view might be restricted.
OID Not Increasing
Error: OID not increasing: The agent is returning erroneous data; you can temporarily use the -Cc parameter.
Auth Failure
Authentication failure (v3): Verify that the username, protocols (SHA/AES), and passwords match the device configuration.
FAQ

Frequently Asked Questions

Q: What is snmpwalk used for?

snmpwalk sequentially queries all values starting from a specified OID on an SNMP agent. It is used to quickly list device interfaces, hardware info, resource usage, and uptime with a single command.

Q: What is the difference between snmpwalk and snmpget?

snmpget returns the value of a single OID. snmpwalk traverses the entire subtree under the given OID and lists multiple values together.

Q: Which port does snmpwalk use?

snmpwalk sends queries to the target device's UDP port 161. Access to this port must be open through the firewall.

Q: Why does snmpwalk throw a 'Timeout: No Response from host' error?

The most common reasons are an incorrect community string or SNMP v3 user info, blocked UDP 161 access, a disabled SNMP service on the device, or the querying IP not being on the device's permit list.

Automate Your Network Monitoring and SNMP Processes

Move beyond manual command-line queries and contact our experts to centrally and continuously monitor your entire network infrastructure.

Contact Us →

Table of Contents

ODYA Technology

For More Information
Contact us

    Your information will be securely sent to and stored in Google Sheets for the purpose of processing your form submission.
    Contact Us