Vyatta Network OS Documentation

Learn how to install, configure and operate the Vyatta NOS, which helps drive our virtual networking & physical platforms portfolio.

Configuring SNMP on a routing instance

The following sections provide examples of configuration mode commands.

Associating an SNMP client on a routing instance

The following configuration associates the commA community string with the RED routing instance and the commB community string with the BLUE routing instance. Only one context name can be mapped to a community, but multiple communities can be mapped to the same context name. A community string that is mapped to a context must have a defined view.

Table 1. Associating an SNMP client on a routing instance
Step Command

Set the SNMP version 1 and version 2 community as commA and context as RED.

vyatta@R1# set service snmp community commA context red

Set the SNMP version 1 and version 2 community as commB and context as BLUE.

vyatta@R1# set service snmp community commB context blue
vyatta@R1# set service snmp view all oid 1

Associate all views with the commA SNMP community.

vyatta@R1# set service snmp community commA view all

Associate all views with the commB SNMP community.

vyatta@R1# set service snmp community commB view all

View the configuration.

vyatta@R1# show service snmp community 
 community commA {
        context red
        view all
 }
 community commB {
        context blue
        view all
 }
vyatta@vyatta#

Associating a trap target with a routing instance

The following configuration associates an SNMPv2 trap target with the 1.1.1.1 IP address on the RED routing instance.
Table 2. Associating SNMPv2 trap targets on a routing instance
Step Command

Set the SNMPv2 trap target with the 1.1.1.1 IP address on the RED routing instance.

vyatta@R1# set service snmp v2 trap-target 1.1.1.1 routing-instance red

Define the test community configuration node.

vyatta@R1# set service snmp v2 trap-target 1.1.1.1 community test

Commit the configuration.

vyatta@R1# commit

View the configuration.

vyatta@R1# show service snmp v2 trap-target
 trap-target 1.1.1.1 {
        community test
        routing-instance red
 }
vyatta@vyatta#

The following configuration associates an SNMPv3 trap target with IP address 2.2.2.2 on the RED routing instance.

Table 3. Associating an SNMPv3 trap target on a routing instance
Step Command

Set the SNMPv3 trap target with the 2.2.2.2 IP address on the RED routing instance.

vyatta@R1# set service snmp v3 trap-target 2.2.2.2 routing-instance red

Define the usr2 SNMPv3 user.

vyatta@R1# set service snmp v3 trap-target 2.2.2.2 user usr2

Define a cleartext password to authenticate a user.

set service snmp v3 trap-target 2.2.2.2 auth plaintext-key "usr2usr2"

Commit the configuration.

vyatta@R1# commit

View the configuration.

vyatta@R1# show service snmp v3 trap-target
 trap-target 2.2.2.2 {
        auth {
                plaintext-key "********"
        }
        user usr2
        routing-instance red
 }
vyatta@vyatta#

Configuring an SNMP agent to listen on a routing instance

The following configuration shows how to configure an SNMP agent to listen for incoming requests from the RED routing instance.

Table 4. Configuring an SNMP agent on a routing instance
Step Command

Set an SNMP agent to listen for incoming requests from the RED routing instance.

vyatta@R1# set service snmp routing-instance red

View the configuration.

vyatta@R1# show service snmp routing-instance 
 routing-instance red
vyatta@vyatta#