SNMPv1 Syntax: Detailed Guide
Simple Network Management Protocol (SNMP) Version 1 was the first implementation of SNMP and is still used today in some legacy or simple network environments. It uses community-based authentication (plaintext community strings) and operates without encryption or advanced security features.

In SNMPv1, all communication between the manager (client) and the agent (server) occurs via simple commands that retrieve or set values from a network device’s Management Information Base (MIB).
This guide will detail the syntax used in SNMPv1 and provide multiple examples.
SNMPv1 Basic Syntax
Here’s the basic syntax for using SNMP version 1 commands like snmpwalk, snmpget, and snmpset in a Unix-based system.
[command] -v 1 -c [community_string] [hostname_or_IP] [OID]- [command]: The SNMP command you want to use (snmpwalk, snmpget, snmpset, etc.).
- -v 1: Specifies the SNMP version (SNMP version 1 in this case).
- -c [community_string]: The community string used for authentication (e.g., “public” or “private”). The default string is usually “public”.
- [hostname_or_IP]: The hostname or IP address of the SNMP-enabled device you want to query.
- [OID]: The Object Identifier (OID) is the MIB variable you want to retrieve or set.
Common SNMPv1 Commands
There are a few basic operations available in SNMP version 1, including:
- snmpget: Retrieve a specific MIB object from a device.
- snmpwalk: Walk through an entire branch of the MIB hierarchy.
- snmpset: Change the value of a specific MIB object on the device.
- snmptrap: Send an SNMP trap (alert) to a manager.
1. SNMPv1 snmpget Example
snmpget is used to query a single MIB object on a device. The manager sends a request for the value of a specific OID, and the device (agent) responds with the current value.
Example:
Let’s retrieve the system description of a device with IP 192.168.1.1 using the SNMP version 1community string public.
snmpget -v 1 -c public 192.168.1.1 SNMPv2-MIB::sysDescr.0- -v 1: Specifies SNMP version 1.
- -c public: Uses the community string public.
- 192.168.1.1: The IP address of the target SNMP device.
- SNMPv2-MIB::sysDescr.0: The OID for the system description, which is a standard MIB object.
Response:
This response indicates that the queried system is running Linux with a specific kernel version.
2. SNMPv1 snmpwalk Example
snmpwalk is used to retrieve a series of values from an SNMP device by walking through a branch of the MIB tree.
Example:
Let’s perform a walk through the entire system branch of the MIB on a device with IP 192.168.1.1.
snmpwalk -v 1 -c public 192.168.1.1 SNMPv2-MIB::system- SNMPv2-MIB::system: Specifies the system branch of the MIB. This OID retrieves a range of information about the system, including system description, uptime, contact, and location.
Response:
This output shows multiple pieces of information about the system, such as its uptime, contact details, and location.
3. SNMPv1 snmpset Example
snmpset is used to modify the value of a specific MIB object on a device. This can be useful for changing configurations remotely.
Example:
Let’s change the system contact on a device with IP 192.168.1.1 to “Network Admin”.
- -c private: Uses the private community string, which allows write access.
- SNMPv2-MIB::sysContact.0: The OID for the system contact.
- s: Indicates the data type is a string.
- “Network Admin”: The new value for the system contact.
Response:
This confirms that the system contact was successfully updated.
4. SNMPv1 snmpgetnext Example
snmpgetnext retrieves the next OID in the MIB tree after the specified OID. It is useful when you want to iteratively retrieve values without knowing the full structure of the MIB.
Example:
Let’s retrieve the next OID after SNMPv2-MIB::sysDescr.0 on a device with IP 192.168.1.1.
snmpgetnext -v 1 -c public 192.168.1.1 SNMPv2-MIB::sysDescr.0Response:
SNMPv2-MIB::sysObjectID.0 = OID: 1.3.6.1.4.1.8072.3.2.10In this case, the next OID after sysDescr is sysObjectID, which returns the Object ID of the device.
5. SNMPv1 snmptrap Example
snmptrap is used to send a trap (alert) from an SNMP agent to an SNMP manager. Traps are typically used to notify the manager of specific events, such as device failures or threshold violations.
Example:
Let’s send a trap indicating that the device has restarted.
snmptrap -v 1 -c public 192.168.1.100 '' SNMPv2-MIB::coldStart.0- 192.168.1.100: The IP address of the SNMP manager receiving the trap.
- SNMPv2-MIB::coldStart.0: A standard OID indicating a cold start (system restart).
Response: The SNMP manager would receive a trap indicating the device has restarted.
6. SNMPv1 Bulk Walk of Interface Information
Network interfaces are commonly monitored via SNMP. To get a list of network interfaces and their statuses, use the following command.
Example:
snmpwalk -v 1 -c public 192.168.1.1 IF-MIB::ifDescrThis command walks through the IF-MIB::ifDescr tree, which contains descriptions of all network interfaces.
Response:
This output shows three network interfaces: eth0, eth1, and the loopback interface lo.
7. SNMPv1 Bulk Retrieval of Interface Traffic Statistics
To monitor the inbound and outbound traffic on network interfaces, use the following command.
Example:
snmpwalk -v 1 -c public 192.168.1.1 IF-MIB::ifInOctetsThis command retrieves the number of inbound octets (bytes) on each network interface.
Response:
IF-MIB::ifInOctets.1 = Counter32: 1234567IF-MIB::ifInOctets.2 = Counter32: 2345678IF-MIB::ifInOctets.3 = Counter32: 3456789This shows the amount of inbound traffic (in octets) on each interface.Conclusion
SNMP version 1 is straightforward to use, but it lacks the advanced security and features available in later SNMP versions. Its simple syntax and basic community-based authentication make it easy to configure for non-critical networks. However, due to the lack of encryption and authentication mechanisms, SNMP version 1 should only be used in trusted or isolated environments where security is not a major concern.
Useful Links
Comprehensive SNMPv1 Syntax: Commands, Examples, and Usage
This article provided insights on the topic. For latest updates and detailed guides, stay connected with Sanchit Gurukul.
Your feedback matters
Was this post helpful?
Discussion
0 approved comments
No approved comments yet. You can start the discussion below.
Leave a Comment
No login is required. Name and email are used for moderation/security. Your email is never displayed publicly. All comments require administrator approval.
Discover more from SanchitGurukul
Subscribe to get the latest posts sent to your email.