Configuring SNMP on Juniper MX

For example, I will configure SNMP on Juniper MX204.

Let’s go to the configuration mode:


Let’s move on to configuring snmp:

edit snmp

Let’s specify the community (instead of IXNFO.COM) and the IP address of the snmp client (in my case, the Zabbix server):

set community IXNFO.COM clients authorization read-only

You can also execute the command from the main configuration mode:

set snmp community IXNFO.COM clients authorization read-only

If there are many SNMP client IP addresses, then create a list and indicate it when adding community:

set client-list list0
set client-list list0
set community IXNFO.COM client-list-name list0 authorization read-only

If necessary, we will indicate the rest of the data to the device:

set name ""
set description "TEST"
set location "TEST"
set contact ""

Let’s check the added SNMP configuration:


Let’s check the configuration and apply:

commit check

After that SNMP v2 should work.

You can delete the entered command or community like this:

delete community IXNFO.COM
delete community IXNFO.COM clients

Or just restore the previous configuration:

rollback ?
rollback 0

Let’s exit the snmp hierarchy and check the snmp configuration again:

show snmp
show | match snmp | display set

Here is an example of log entries when someone connects with the wrong community or from an unresolved IP address:

show log messages | last 10
SNMPD_AUTH_FAILURE: nsa_log_community: unauthorized SNMP community from x.x.x.x to x.x.x.x (public)
SNMPD_AUTH_RESTRICTED_ADDRESS: nsa_initial_callback: request from address x.x.x.x not allowed

To diagnose problems with SNMP, you can write more detailed logs to a separate file, I will give an example configuration:

set snmp traceoptions file SNMP size 1m
set snmp traceoptions flag general
set snmp traceoptions lag varbind-error

See also my articles:
SNMP OID for Juniper
SNMP OID and MIB for interfaces

Leave a comment

Leave a Reply