Related Documentation
- ACX Series
- Example: Redistributing OSPF Routes into IS-IS
- J Series
- Example: Redistributing OSPF Routes into IS-IS
- M Series
- Example: Redistributing OSPF Routes into IS-IS
- MX Series
- Example: Redistributing OSPF Routes into IS-IS
- QFX Series
- Example: Redistributing OSPF Routes into IS-IS
- SRX Series
- Example: Redistributing OSPF Routes into IS-IS
- T Series
- Example: Redistributing OSPF Routes into IS-IS
Example: Redistributing BGP Routes with a Specific Community Tag into IS-IS
Understanding BGP Communities and Extended Communities as Routing Policy Match Conditions
A BGP community is a group of destinations that share a common property. Community information is included as a path attribute in BGP update messages. This information identifies community members and enables you to perform actions on a group without having to elaborate upon each member. You can use community and extended communities attributes to trigger routing decisions, such as acceptance, rejection, preference, or redistribution.
You can assign community tags to non-BGP routes through configuration (for static, aggregate, or generated routes) or an import routing policy. These tags can then be matched when BGP exports the routes.
A community value is a 32-bit field that is divided into two main sections. The first 16 bits of the value encode the AS number of the network that originated the community, while the last 16 bits carry a unique number assigned by the AS. This system attempts to guarantee a globally unique set of community values for each AS in the Internet. Junos OS uses a notation of as-number:community-value, where each value is a decimal number. The AS values of 0 and 65,535 are reserved, as are all of the community values within those AS numbers. Each community, or set of communities, is given a name within the [edit policy-options] configuration hierarchy. The name of the community uniquely identifies it to the routing device and serves as the method by which routes are categorized. For example, a route with a community value of 64510:1111 might belong to the community named AS64510-routes. The community name is also used within a routing policy as a match criterion or as an action. The command syntax for creating a community is: policy-options community name members [community-ids]. The community-ids are either a single community value or multiple community values. When more than one value is assigned to a community name, the routing device interprets this as a logical AND of the community values. In other words, a route must have all of the configured values before being assigned the community name.
The regular community attribute is four octets. Networking enhancements, such as VPNs, have functionality requirements that can be satisfied by an attribute such as a community. However, the 4-octet community value does not provide enough expansion and flexibility to accommodate VPN requirements. This leads to the creation of extended communities. An extended community is an 8-octet value that is also divided into two main sections. The first 2 octets of the community encode a type field while the last 6 octets carry a unique set of data in a format defined by the type field. Extended communities provide a larger range for grouping or categorizing communities.
The BGP extended communities attribute format has three fields: type:administrator:assigned-number. The routing device expects you to use the words target or origin to represent the type field. The administrator field uses a decimal number for the AS or an IPv4 address, while the assigned number field expects a decimal number no larger than the size of the field (65,535 for 2 octets or 4,294,967,295 for 4 octets).
When specifying community IDs for standard and extended community attributes, you can use UNIX-style regular expressions. The only exception is for VPN import policies (vrf-import), which do not support regular expressions for the extended communities attribute.
Example: Redistributing BGP Routes with a Specific Community Tag into IS-IS
This example defines a policy that takes BGP routes from the Edu community and places them into IS-IS with a metric of 63.
Requirements
No special configuration beyond device initialization is required before configuring this example.
Overview
Figure 1 shows the topology used in this example.
Figure 1: Redistributing BGP Routes with a Specific Community Tag into IS-IS

In this example, Device A, Device B, Device C, and Device D are in autonomous system (AS) 1 and are running IS-IS. All of the AS 1 devices, except Device D, are running internal BGP (IBGP).
Device E is in AS 2 and has an external BGP (EBGP) peering session with Device C. Device E has two static routes, 10.2.0.0/16 and 10.3.0.0/16. These routes are tagged with the Edu 2:5 community attribute and are advertised by way of EBGP to Device C.
Device C accepts the BGP routes that are tagged with the Edu 2:5 community attribute, redistributes the routes into IS-IS, and applies an IS-IS metric of 63 to these routes.
CLI Quick Configuration shows the configuration for all of the devices in Figure 1. The section Step-by-Step Procedure describes the steps on Device C and Device E.
Configuration
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 [edit] hierarchy level.
Device A
Device B
Device C
Device D
Device E
Step-by-Step Procedure
The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.
To configure Device E:
- Configure the interfaces.[edit interfaces]user@E# set fe-1/2/0 unit 0 family inet address 10.0.0.26/30user@E# set lo0 unit 7 family inet address 192.168.0.5/32 primaryuser@E# set lo0 unit 7 family inet address 10.2.0.1/32user@E# set lo0 unit 7 family inet address 10.3.0.1/32
- Configure the statics policy, which adds the Edu community attribute to the static routes.[edit policy-options]user@E# set policy-statement statics from protocol staticuser@E# set policy-statement statics then community add Eduuser@E# set policy-statement statics then acceptuser@E# set community Edu members 2:5
- Configure EBGP and apply the statics policy.[edit protocols bgp group external-peers]user@E# set type externaluser@E# set export staticsuser@E# set peer-as 1user@E# set protocols bgp group external-peers neighbor 10.0.0.25
- Configure the static routes.[edit routing-options static]user@E# set route 10.2.0.0/16 rejectuser@E# set route 10.2.0.0/16 installuser@E# set route 10.3.0.0/16 rejectuser@E# set route 10.3.0.0/16 install
- Configure the router ID and the AS number.[edit routing-options]user@E# set router-id 192.168.0.5user@E# set autonomous-system 2
Step-by-Step Procedure
The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.
To configure Device C:
- Configure the interfaces.[edit interfaces]user@C# set fe-1/2/0 unit 0 family inet address 10.0.0.10/30user@C# set fe-1/2/0 unit 0 family isouser@C# set fe-1/2/1 unit 0 family inet address 10.0.0.13/30user@C# set fe-1/2/1 unit 0 family isouser@C# set fe-1/2/2 unit 0 family inet address 10.0.0.25/30user@C# set fe-1/2/2 unit 0 family isouser@C# set lo0 unit 0 family inet address 192.168.0.3/32user@C# set lo0 unit 0 family iso address 49.0002.0192.0168.0003.00
- Configure IBGP.[edit protocols bgp group int]user@C# set type internaluser@C# set local-address 192.168.0.3user@C# set neighbor 192.168.0.1user@C# set neighbor 192.168.0.2
- Configure the Edu-to-isis policy, which redistributes
the Edu-tagged BGP routes learned from Device E and applies a metric
of 63.[edit policy-options]user@C# set policy-statement Edu-to-isis term 1 from protocol bgpuser@C# set policy-statement Edu-to-isis term 1 from community Eduuser@C# set policy-statement Edu-to-isis term 1 then metric 63user@C# set policy-statement Edu-to-isis term 1 then acceptuser@C# set community Edu members 2:5
- Enable IS-IS on the interfaces, and apply the Edu-to-isis
policy.[edit protocols isis]user@C# set export Edu-to-isisuser@C# set interface fe-1/2/0.0 level 1 disableuser@C# set interface fe-1/2/1.0 level 1 disableuser@C# set interface fe-1/2/2.0 level 1 disableuser@C# set interface fe-1/2/2.0 level 2 passiveuser@C# set interface lo0.0
- Configure the send-isis-and-direct policy, which redistributes
routes to Device E, through EBGP.
Without this policy, Device E would not have connectivity to the networks in AS 1.
[edit policy-options policy-statement send-isis-and-direct term 1]user@C# set from protocol isisuser@C# set from protocol directuser@C# set from route-filter 10.0.0.0/16 orlongeruser@C# set from route-filter 192.168.0.0/16 orlongeruser@C# set then accept - Configure EBGP and apply the send-isis-and-direct policy.[edit protocols bgp group external-peers]user@C# set type externaluser@C# set export send-isis-and-directuser@C# set peer-as 2user@C# set neighbor 10.0.0.26
- Configure the router ID and the autonomous system (AS)
number.[edit routing-options]user@C# set router-id 192.168.0.3user@C# set autonomous-system 1
Results
From configuration mode, confirm your configuration by entering the show interfaces, show protocols, show policy-options, and show routing-options commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.
Device E
Device C
If you are done configuring the device, enter commit from configuration mode.
Verification
Confirm that the configuration is working properly.
Verifying the IS-IS Neighbor
Purpose
Verify that the BGP routes from Device E are communicated on the IS-IS network in AS 1.
Action
From operational mode, enter the show route protocol isis command.
user@D> show route protocol isisinet.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.0.0.4/30 *[IS-IS/18] 22:30:53, metric 30
> to 10.0.0.13 via fe-1/2/0.0
10.0.0.8/30 *[IS-IS/18] 22:30:53, metric 20
> to 10.0.0.13 via fe-1/2/0.0
10.0.0.24/30 *[IS-IS/18] 03:31:21, metric 20
> to 10.0.0.13 via fe-1/2/0.0
10.2.0.0/16 *[IS-IS/165] 02:36:31, metric 73
> to 10.0.0.13 via fe-1/2/0.0
10.3.0.0/16 *[IS-IS/165] 02:36:31, metric 73
> to 10.0.0.13 via fe-1/2/0.0
192.168.0.1/32 *[IS-IS/18] 03:40:28, metric 30
> to 10.0.0.13 via fe-1/2/0.0
192.168.0.2/32 *[IS-IS/18] 22:30:53, metric 20
> to 10.0.0.13 via fe-1/2/0.0
192.168.0.3/32 *[IS-IS/18] 22:30:53, metric 10
> to 10.0.0.13 via fe-1/2/0.0
iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)Meaning
As expected, the 10.2.0.0/16 and 10.3.0.0/16 routes are in Device D’s routing table as IS-IS external routes with a metric of 73. If Device C had not added 63 to the metric, Device D would have a metric of 10 for these routes.
Related Documentation
- ACX Series
- Example: Redistributing OSPF Routes into IS-IS
- J Series
- Example: Redistributing OSPF Routes into IS-IS
- M Series
- Example: Redistributing OSPF Routes into IS-IS
- MX Series
- Example: Redistributing OSPF Routes into IS-IS
- QFX Series
- Example: Redistributing OSPF Routes into IS-IS
- SRX Series
- Example: Redistributing OSPF Routes into IS-IS
- T Series
- Example: Redistributing OSPF Routes into IS-IS