Example: Configuring SNMP
By default, SNMP is disabled on devices running Junos OS. This example describes the steps for configuring SNMP on the QFabric system.
This example uses the following hardware and software components:
Junos OS Release 12.2
Network management system (NMS) (running the SNMP manager)
QFabric system (running the SNMP agent) with multiple Node devices
Because SNMP is disabled by default on devices running Junos OS, you must enable SNMP on your device by including configuration statements at the [edit snmp] hierarchy level. At a minimum, you must configure the community public statement. The community defined as public grants read-only access to MIB data to any client.
If no clients statement is configured, all clients are allowed. We recommend that you always include the restrict option to limit SNMP client access to the switch.
The network topology in this example includes an NMS, a QFabric system with four Node devices, and external SNMP servers that are configured for receiving traps.
CLI Quick Configuration
To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the  hierarchy level.
The following example requires that you navigate various levels in the configuration hierarchy. For instructions on how to do that, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide .
To configure SNMP on the QFabric system:
If the name, description, location, contact, or community name contains spaces, enclose the text in quotation marks (" ").
- Configure the SNMP system name:[edit snmp]user@switch# set name “snmp qfabric”
The above configured SNMP system name can be accessed:
By doing a query with the SNMPGet on policy object identifier (OID) sysName.0.
From the generic jnxSyslogTrap. To send the jnxSyslogTrap, configure the trap events at [edit event-options policy] hierarchy.
- Specify a description.[edit snmp]user@switch# set description “qfabric0 system”
This string is placed into the MIB II sysDescription object.
- Specify the physical location of the QFabric system.[edit snmp]user@switch# set location “Lab 4 Row 11”
This string is placed into the MIB II sysLocation object.
- Specify an administrative contact for the SNMP system. [edit snmp]user@switch# set contact “qfabric-admin@qfabric0”
This name is placed into the MIB II sysContact object.
- Specify a unique SNMP community name and the read-only
The read-write option is not supported on the QFabric system.[edit snmp]user@switch# set community public authorization read-only
- Create a client list with a set of IP addresses that can
use the SNMP community.[edit snmp]user@switch# set client-list list0 192.168.0.0/24user@switch# set community public client-list-name list0
- Specify IP addresses of clients that are restricted from
using the community.[edit snmp]user@switch# set community public clients 198.51.100.0/24 restrict
- Configure a trap group, destination port, and a target
to receive the SNMP traps in the trap group.[edit snmp]user@switch# set trap-group “qf-traps” destination-port 155 targets 192.168.0.100
You do not need to include the destination-port statement if you use the default port 162.
The trap group qf-traps is configured to send traps to 192.168.0.100.
From configuration mode, confirm your configuration by entering the show command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.
If you are done configuring the device, enter commit from configuration mode.