The target address defines a management application’s address and parameters that are used in sending notifications. It can also identify management stations that are allowed to use specific community strings. When you receive a packet with a recognized community string and a tag is associated with it, the JUNOS software looks up all the target addresses with this tag and verifies that the source address of this packet matches one of the configured target addresses.
![]() |
Note: You must configure the address mask when you configure the SNMP community. |
To specify where you want the traps to be sent and define what SNMPv1 and SNMP2vc packets are allowed, include the target-address statement at the [edit snmp v3] hierarchy level:
- [edit snmp v3]
-
target-address target-address-name;
target-address-name is the string that identifies the target address.
To configure the target address properties, include the following statements at the [edit snmp v3 target-address target-address-name] hierarchy level:
- [edit snmp v3 target-address target-address-name]
-
address address;
-
address-mask address-mask;
-
port port-number;
-
routing-instance instance;
-
tag-list tag-list;
-
target-parameters target-parameters-name;
This section includes the following topics:
To configure the address, include the address statement at the [edit snmp v3 target-address target-address-name] hierarchy level:
- [edit snmp v3 target-address target-address-name]
-
address address;
address is the SNMP target address.
The address mask specifies a set of addresses that are allowed to use a community string and verifies the source addresses for a group of target addresses.
To configure the address mask, include the address-mask statement at the [edit snmp v3 target-address target-address-name] hierarchy level:
- [edit snmp v3 target-address target-address-name]
-
address-mask address-mask;
address-mask combined with the address defines a range of addresses. For information about how to configure the community string, see Configuring the SNMPv3 Community.
By default, the UDP port is set to 162. To configure a different port number, include the port statement at the [edit snmp v3 target-address target-address-name] hierarchy level:
- [edit snmp v3 target-address target-address-name]
-
port port-number;
port-number is the SNMP target port number.
Traps are sent over the default routing instance, To configure the routing instance for sending traps, include the routing-instance statement at the [edit snmp v3 target-address target-address-name] hierarchy level:
- [edit snmp v3 target-address target-address-name]
-
routing-instance instance;
instance is the name of the routing instance. To configure a routing instance within a logical system, specify the logical system name followed by the routing instance name. Use a slash ( / ) to separate the two names (for example, test-lr/test-ri). To configure the default routing instance on a logical system, specify the logical system name followed by default (for example, test-lr/default).
Each target-address statement can have one or more tags configured in its tag list. Each tag can appear in more than one tag list. When a significant event occurs on the network device, the tag list identifies the targets to which a notification is sent.
To configure the tag list, include the tag-list statement at the [edit snmp v3 target-address target-address-name] hierarchy level:
- [edit snmp v3 target-address target-address-name]
-
tag-list “tag-list”;
tag-list specifies one or more tags as a space-separated list enclosed within double quotes.
For information about how to specify a tag at the [edit snmp v3 notify notify-name] hierarchy level, see Configuring the SNMPv3 Trap Notification.
Example: Configuring the Tag List
In the following example, two tag entries (router1 and router2) are defined at the [edit snmp v3 notify notify-name] hierarchy level. When an event triggers a notification, the JUNOS software sends a trap to all target addresses that have router1 or router2 configured in their target-address tag list. This results in the first two targets getting one trap each, and the third target getting two traps.
- [edit snmp v3]
- notify n1 {
- tag router1; # Identifies a set of target addresses
- type trap; # Defines the type of notification
- }
- notify n2 {
- tag router2;
- type trap;
- }
- target-address ta1 {
- address 10.1.1.1;
- address-mask 255.255.255.0;
- port 162;
- tag-list router1;
- target-parameters tp1;
- }
- target-address ta2 {
- address 10.1.1.2;
- address-mask 255.255.255.0;
- port 162;
- tag-list router2;
- target-parameters tp2;
- }
- target-address ta3 {
- address 10.1.1.3;
- address-mask 255.255.255.0;
- port 162;
- tag-list “router1 router2”; #Define multiple
tags in the target address tag list
- target-parameters tp3;
- }
![]() |
Note: When you configure SNMP traps, make sure your configured access privileges allow the traps to be sent. Configure access privileges at the [edit snmp v3 vacm access] hierarchy level. |
The target-parameters statement at the [edit snmp v3] hierarchy level applies the target parameters configured at the [edit snmp v3 target-parameters target-parameters-name] hierarchy level.
To reference configured target parameters, include the target-parameters statement at the [edit snmp v3 target-address target-address-name] hierarchy level:
- [edit snmp v3 target-address target-address-name]
-
target-parameters target-parameters-name;
target-parameters-name is the name associated with the message processing and security parameters that are used in sending notifications to a particular management target.