Supported Platforms
Example: Redistributing OSPF Routes into IS-IS
Understanding Routing Policies
For some routing platform vendors, the flow of routes occurs between various protocols. If, for example, you want to configure redistribution from RIP to OSPF, the RIP process tells the OSPF process that it has routes that might be included for redistribution. In Junos OS, there is not much direct interaction between the routing protocols. Instead, there are central gathering points where all protocols install their routing information. These are the main unicast routing tables inet.0 and inet6.0.
From these tables, the routing protocols calculate the best route to each destination and place these routes in a forwarding table. These routes are then used to forward routing protocol traffic toward a destination, and they can be advertised to neighbors.
As shown in Figure 1, you use import routing policies to control which routes are placed in the routing table, and export routing policies to control which routes are advertised from the routing table to neighbors.
Figure 1: Importing and Exporting Routing Policies

In general, the routing protocols place all their routes in the routing table and advertise a limited set of routes from the routing table. The general rules for handling the routing information between the routing protocols and the routing table are known as the routing policy framework.
The routing policy framework is composed of default rules for each routing protocol that determine which routes the protocol places in the routing table and advertises from the routing table. The default rules for each routing protocol are known as default routing policies.
You can create routing policies to preempt the default policies, which are always present. A routing policy is a mechanism in Junos OS that allows you to modify the routing policy framework to suit your needs. You can create and implement your own routing policies to do the following:
- Control which routes a routing protocol places in the routing table.
- Control which active routes a routing protocol advertises from the routing table. An active route is a route that is chosen from all routes in the routing table to reach a destination.
- Manipulate the route characteristics as a routing protocol places the route in the routing table or advertises the route from the routing table.
You can manipulate the route characteristics to control which route is selected as the active route to reach a destination. The active route is placed in the forwarding table and is used to forward traffic toward the route’s destination. In general, the active route is also advertised to a router’s neighbors.
To create a routing policy, you must define the policy and apply it. You define the policy by specifying the criteria that a route must match and the actions to perform if a match occurs. You then apply the policy to a routing protocol or to the forwarding table.
In Junos OS Release 9.5 and later, you can configure routing policies and certain routing policy objects in a dynamic database that is not subject to the same verification required by the standard configuration database. As a result, you can quickly commit these routing policies and policy objects, which can be referenced and applied in the standard configuration as needed. BGP is the only protocol to which you can apply routing policies that reference policies configured in the dynamic database. After a routing policy based on the dynamic database is configured and committed in the standard configuration, you can quickly make changes to existing routing policies by modifying policy objects in the dynamic database. Because Junos OS does not validate configuration changes to the dynamic database, when you use this feature, you should test and verify all configuration changes before committing them.
Example: Redistributing OSPF Routes into IS-IS
This example shows how to redistribute OSPF routes into an IS-IS network.
Requirements
No special configuration beyond device initialization is required before configuring this example.
Overview
Export policy can be applied to IS-IS to facilitate route redistribution.
Junos OS does not support the application of import policy for link-state routing protocols like IS-IS because such policies can lead to inconsistent link-state database (LSDB) entries, which in turn can result in routing inconstancies.
In this example, OSPF routes 192.168.0/24 through 192.168.3/24 are redistributed into IS-IS area 49.0002 from Device R2.
In addition, policies are configured to ensure that Device R1 can reach destinations on the 10.0.0.44/30 network, and that Device R3 can reach destinations on the 10.0.0.36/30 network. This enables end-to-end reachability.
Figure 2 shows the topology used in this example.
Figure 2: IS-IS Route Redistribution Topology

CLI Quick Configuration shows the configuration for all of the devices in Figure 2. The section Step-by-Step Procedure describes the steps on Device R2. Step-by-Step Procedure describes the steps on Device R3.
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 R1
Device R2
Device R3
Step-by-Step Procedure
To configure Device R2:
- Configure the network interfaces.[edit interfaces]user@R2# set fe-1/2/1 unit 0 description to-R5user@R2# set fe-1/2/1 unit 0 family inet address 10.0.0.37/30user@R2# set fe-1/2/1 unit 0 family isouser@R2# set fe-1/2/0 unit 0 description to-OSPF-networkuser@R2# set fe-1/2/0 unit 0 family inet address 10.0.0.45/30user@R2# set lo0 unit 0 family inet address 172.16.9.7/32user@R2# set lo0 unit 0 family iso address 49.0002.0172.0016.0907.00
- Configure IS-IS on the interface facing Device R1 and
the loopback interface.[edit protocols isis]user@R2# set interface fe-1/2/1.0user@R2# set interface lo0.0
- Configure the policy that enables Device R1 to reach the
10.0.0.44/30 network.[edit policy-options policy-statement send-direct-to-isis-neighbors]user@R2# set from protocol directuser@R2# set from route-filter 10.0.0.44/30 exactuser@R2# set then accept
- Apply the policy that enables Device R1 to reach the 10.0.0.44/30
network.[edit protocols isis]user@R2# set export send-direct-to-isis-neighbors
- Configure OSPF on the interfaces.[edit protocols ospf]user@R2# set area 0.0.0.1 interface fe-1/2/0.0user@R2# set area 0.0.0.1 interface lo0.0 passive
- Configure the OSPF route redistribution policy.[edit policy-options policy-statement ospf-isis term 1]user@R2# set from protocol ospfuser@R2# set from route-filter 192.168.0.0/22 longeruser@R2# set then accept
- Apply the OSPF route redistribution policy to the IS-IS
instance.[edit protocols isis]user@R2# set export ospf-isis
- Configure the policy that enables Device R3 to reach the
10.0.0.36/30 network.[edit policy-options policy-statement send-direct-to-ospf-neighbors]user@R2# set from protocol directuser@R2# set from route-filter 10.0.0.36/30 exactuser@R2# set then accept
- Apply the policy that enables Device R3 to reach the 10.0.0.36/30
network.[edit protocols ospf]user@R2# set export send-direct-to-ospf-neighbors
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 multi-level IS-IS:
- Configure the network interfaces.
Multiple addresses are configured on the loopback interface to simulate multiple route destinations.
[edit interfaces]user@R3# set fe-1/2/0 unit 0 family inet address 10.0.0.46/30user@R3# set lo0 unit 0 family inet address 192.168.1.1/32user@R3# set lo0 unit 0 family inet address 192.168.2.1/32user@R3# set lo0 unit 0 family inet address 192.168.3.1/32user@R3# set lo0 unit 0 family inet address 192.168.0.1/32 - Configure static routes to the loopback interface addresses.
These are the routes that are redistributed into IS-IS.
[edit routing-options static]user@R3# set route 192.168.0.0/24 discarduser@R3# set route 192.168.1.0/24 discarduser@R3# set route 192.168.3.0/24 discarduser@R3# set route 192.168.2.0/24 discard - Configure OSPF on the interfaces.[edit protocols ospf area 0.0.0.1]user@R3# set interface fe-1/2/0.0user@R3# set interface lo0.0 passive
- Configure the OSPF policy to export the static routes. [edit policy-options policy-statement ospf term 1]user@R3# set from protocol staticuser@R3# set then accept
- Apply the OSPF export policy. [edit protocols ospf]user@R3# set export ospf
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 R2
Device R3
If you are done configuring the device, enter commit from configuration mode.
Verification
Confirm that the configuration is working properly.
Verifying OSPF Route Advertisement
Purpose
Make sure that the expected routes are advertised by OSPF.
Action
From operational mode on Device R2, enter the show route protocol ospf command.
user@R2> show route protocol ospf
inet.0: 15 destinations, 15 routes (15 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 192.168.0.0/24 *[OSPF/150] 03:54:21, metric 0, tag 0 > to 10.0.0.46 via fe-1/2/0.0 192.168.0.1/32 *[OSPF/10] 03:54:21, metric 1 > to 10.0.0.46 via fe-1/2/0.0 192.168.1.0/24 *[OSPF/150] 03:54:21, metric 0, tag 0 > to 10.0.0.46 via fe-1/2/0.0 192.168.1.1/32 *[OSPF/10] 03:54:21, metric 1 > to 10.0.0.46 via fe-1/2/0.0 192.168.2.0/24 *[OSPF/150] 03:54:21, metric 0, tag 0 > to 10.0.0.46 via fe-1/2/0.0 192.168.2.1/32 *[OSPF/10] 03:54:21, metric 1 > to 10.0.0.46 via fe-1/2/0.0 192.168.3.0/24 *[OSPF/150] 03:54:21, metric 0, tag 0 > to 10.0.0.46 via fe-1/2/0.0 192.168.3.1/32 *[OSPF/10] 03:54:21, metric 1 > to 10.0.0.46 via fe-1/2/0.0 224.0.0.5/32 *[OSPF/10] 03:56:03, metric 1 MultiRecv iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
Meaning
The 192.168/16 routes are advertised by OSPF.
Verifying Route Redistribution
Purpose
Make sure that the expected routes are redistributed from OSPF into IS-IS.
Action
From operational mode on Device R1, enter the show route protocol isis command.
user@R1> show route protocol isis
inet.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.0.44/30 *[IS-IS/160] 03:45:24, metric 20 > to 10.0.0.37 via fe-1/2/0.0 172.16.9.7/32 *[IS-IS/15] 03:49:46, metric 10 > to 10.0.0.37 via fe-1/2/0.0 192.168.0.0/24 *[IS-IS/160] 03:49:46, metric 10 > to 10.0.0.37 via fe-1/2/0.0 192.168.0.1/32 *[IS-IS/160] 03:49:46, metric 11, tag2 1 > to 10.0.0.37 via fe-1/2/0.0 192.168.1.0/24 *[IS-IS/160] 03:49:46, metric 10 > to 10.0.0.37 via fe-1/2/0.0 192.168.1.1/32 *[IS-IS/160] 03:49:46, metric 11, tag2 1 > to 10.0.0.37 via fe-1/2/0.0 192.168.2.0/24 *[IS-IS/160] 03:49:46, metric 10 > to 10.0.0.37 via fe-1/2/0.0 192.168.2.1/32 *[IS-IS/160] 03:49:46, metric 11, tag2 1 > to 10.0.0.37 via fe-1/2/0.0 192.168.3.0/24 *[IS-IS/160] 03:49:46, metric 10 > to 10.0.0.37 via fe-1/2/0.0 192.168.3.1/32 *[IS-IS/160] 03:49:46, metric 11, tag2 1 > to 10.0.0.37 via fe-1/2/0.0 iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
Meaning
The 192.168/16 routes are redistributed into IS-IS.
Verifying Connectivity
Purpose
Check that Device R1 can reach the destinations on Device R3.
Action
From operational mode, enter the ping command.
user@R1> ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes 64 bytes from 192.168.1.1: icmp_seq=0 ttl=63 time=2.089 ms 64 bytes from 192.168.1.1: icmp_seq=1 ttl=63 time=1.270 ms 64 bytes from 192.168.1.1: icmp_seq=2 ttl=63 time=2.135 ms
Meaning
These results confirm that Device R1 can reach the destinations in the OSPF network.