# SNMP(V1-2-3)

## 1- What is SNMP?&#x20;

SNMP is an application-layer protocol that provides a message format for communication between managers and agents. The SNMP system consists of:

* an **SNMP manager**,
* an **SNMP agent**,
* and **a MIB**.

The SNMP agent contains MIB variables whose values the SNMP manager can request or change. A manager can get a value from an agent or store a value into the agent. The agent gathers data from the MIB, the repository for information about device parameters and network data. The agent can also respond to a manager’s requests to get or set data.

&#x20;An agent can send unsolicited traps to the manager. Traps are messages alerting the SNMP manager to a condition on the network. Traps can mean improper user authentication, restarts, link status (up or down), MAC address tracking, closing of a TCP connection, loss of connection to a neighbor, or other significant events.

#### SNMP Versions

| Model   | Level                                                            | Authentication                                        | Encryption                                                           | Result                                                                                                                                                                                                                                                                                                                        |
| ------- | ---------------------------------------------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SNMPv1  | noAuthNoPriv                                                     | Community string                                      | No                                                                   | Uses a community string match for authentication.                                                                                                                                                                                                                                                                             |
| SNMPv2C | noAuthNoPriv                                                     | Community string                                      | No                                                                   | Uses a community string match for authentication.                                                                                                                                                                                                                                                                             |
| SNMPv3  | noAuthNoPriv                                                     | Username                                              | No                                                                   | Uses a username match for authentication.                                                                                                                                                                                                                                                                                     |
| SNMPv3  | authNoPriv                                                       | Message Digest 5 (MD5) or Secure Hash Algorithm (SHA) | No                                                                   | Provides authentication based on the HMAC-MD5 or HMAC-SHA algorithms.                                                                                                                                                                                                                                                         |
| SNMPv3  | <p> authPriv<br> (requires the cryptographic software image)</p> | MD5 or SHA                                            | Data Encryption Standard (DES) or Advanced Encryption Standard (AES) | Provides authentication based on the HMAC-MD5 or HMAC-SHA algorithms. Allows specifying the User-based Security Model (USM) with these encryption algorithms: DES 56-bit encryption in addition to authentication based on the CBC-DES (DES-56) standard. 3DES 168-bit encryption AES 128-bit, 192-bit, or 256-bit encryption |

configuring SNMPV2 is so simple, just write :

```
SW# conf t
SW(conf t)# snmp-server community HRT ro
```

{% hint style="info" %}
ro means read only and rw means read/write
{% endhint %}

configuring SNMPV3 needs three steps:

**1- Defining View**

```
SW(conf t)# snmp-server view View_Name iso|family|interface included
```

{% hint style="info" %}
iso means everything in MIB. &#x20;
{% endhint %}

**2- Defining Group**

```
SW(conf t)# snmp-server group Group_Name V3 priv read View_Name
```

**3- Defining User**

```
SW(conf t)# snmp-server user UserName Group_Name v3 auth sha|md5 Password des56/AES Your_Preshared_Key
```

## 2- Connect your Device to PRTG

PRTG is really good tool for grabbing information from devices which are working with SNMP.  You can [download ](https://www.paessler.com)this software and connecting around 100 sensors are free. In other word, you can use it for small business.

**1-First, Add a New Device, and IPV4 address.**

![](https://3594902569-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LA8bJEHYZEGCK8WGuvC%2F-LCJxbB6C-nmtZvJ6Yro%2F-LCK-D8uxK8hewivt4RU%2Fimage.png?alt=media\&token=7656062f-2bdb-46f5-9447-7e2ef5611889)

**2- Second, Select SNMP version, type of Authentication(SHA-MD5) and enter your username and password.**

![](https://3594902569-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LA8bJEHYZEGCK8WGuvC%2F-LCJxbB6C-nmtZvJ6Yro%2F-LCJzmIAKRgoJiMGEMUg%2Fimage.png?alt=media\&token=91cf96c9-bed2-4e05-89f8-d8e6e51e558c)

3- Third, enter encryption type and Pre-shared key.

![](https://3594902569-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LA8bJEHYZEGCK8WGuvC%2F-LCJxbB6C-nmtZvJ6Yro%2F-LCK0E5D-rJwWf0CWFoH%2Fimage.png?alt=media\&token=9c8bb583-a99e-4fd8-843f-a0dc533a9ca5)

4- Add your desire sensor, there are alot of sensors for different devices, for example I add **ping** to this device.

![](https://3594902569-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LA8bJEHYZEGCK8WGuvC%2F-LCK0rvGQ0EOd1IhWLPg%2F-LCK9g1PBgSA2XWYVEg-%2Fimage.png?alt=media\&token=bf21c77d-c884-452e-8c30-769dfa4fa33d)
