Supported Platforms
Related Documentation
- ACX, M, MX, PTX, T Series
- Configuring SNMP Trap Options and Groups on a Device Running Junos OS
- Configuring SNMP on a Device Running Junos OS
- Configuration Statements at the [edit snmp] Hierarchy Level
- Additional Information
- Configuring SNMP Trap Groups
Configuring SNMP Trap Options
Using SNMP trap options, you can set the source address of every SNMP trap packet sent by the router to a single address regardless of the outgoing interface. In addition, you can set the agent address of the SNMPv1 traps. For more information about the contents of SNMPv1 traps, see RFC 1157.
![]() | Note: SNMP cannot be associated with any routing instances other than the master routing instance. |
To configure SNMP trap options, include the trap-options statement at the [edit snmp] hierarchy level:
You must also configure a trap group for the trap options to take effect. For information about trap groups, see Configuring SNMP Trap Groups.
This topic contains the following sections:
Configuring the Source Address for SNMP Traps
You can configure the source address of trap packets in many ways: lo0, a valid IPv4 address configured on one of the router interfaces, a logical-system address, or the address of a routing-instance. The value lo0 indicates that the source address of the SNMP trap packets is set to the lowest loopback address configured on the interface lo0.
You can configure the source address of trap packets in one of the following formats:
- a valid IPv4 address configured on one of the router interfaces
- lo0; that is the lowest loopback address configured on the interface lo0.
- a logical-system name
- a routing-instance name
A valid IPv4 Address As the Source Address
To specify a valid interface address as the source address for SNMP traps on one of the router interfaces, include the source-address statement at the [edit snmp trap-options] hierarchy level:
address is a valid IPv4 address configured on one of the router interfaces.
The Lowest Loopback Address As the Source Address
To specify the source address of the SNMP traps so that they use the lowest loopback address configured on the interface lo0 as the source address, include the source-address statement at the [edit snmp trap-options] hierarchy level:
To enable and configure the loopback address, include the address statement at the [edit interfaces lo0 unit 0 family inet] hierarchy level:
To configure the loopback address as the source address of trap packets:
In this example, the IP address 10.0.0.1 is the source address of every trap sent from this router.
Logical System Name as the Source Address
To specify a logical system name as the source address of SNMP traps, include the logical-system logical-system-name statement at the [edit snmp trap-options] hierarchy level.
For example, the following configuration sets logical system name ls1 as the source address of SNMP traps:
Routing Instance Name as the Source Address
To specify a routing instance name as the source address of SNMP traps, include the routing-instance routing-instance-name statement at the [edit snmp trap-options] hierarchy level.
For example, the following configuration sets the routing instance name ri1 as the source address for SNMP traps:
Configuring the Agent Address for SNMP Traps
The agent address is only available in SNMPv1 trap packets (see RFC 1157). By default, the router’s default local address is not specified in the agent address field of the SNMPv1 trap. To configure the agent address, include the agent-address statement at the [edit snmp trap-options] hierarchy level. Currently, the agent address can only be the address of the outgoing interface:
To configure the outgoing interface as the agent address:
In this example, each SNMPv1 trap packet sent has its agent address value set to the IP address of the outgoing interface.
Adding snmpTrapEnterprise Object Identifier to Standard SNMP Traps
The snmpTrapEnterprise object helps you identify the enterprise that has defined the trap. Typically, the snmpTrapEnterprise object appears as the last varbind in enterprise-specific SNMP version 2 traps. However, starting Release 10.0, Junos OS enables you to add the snmpTrapEnterprise object identifier to standard SNMP traps as well.
To add snmpTrapEnterprise to standard traps, include the enterprise-oid statement at the [edit snmp trap-options] hierarchy level. If the enterprise-oid statement is not included in the configuration, snmpTrapEnterprise is added only for enterprise-specific traps.
Related Documentation
- ACX, M, MX, PTX, T Series
- Configuring SNMP Trap Options and Groups on a Device Running Junos OS
- Configuring SNMP on a Device Running Junos OS
- Configuration Statements at the [edit snmp] Hierarchy Level
- Additional Information
- Configuring SNMP Trap Groups
Published: 2013-07-16
Supported Platforms
Related Documentation
- ACX, M, MX, PTX, T Series
- Configuring SNMP Trap Options and Groups on a Device Running Junos OS
- Configuring SNMP on a Device Running Junos OS
- Configuration Statements at the [edit snmp] Hierarchy Level
- Additional Information
- Configuring SNMP Trap Groups