Configuring Multiple Instances of OSPF
To configure multiple routing instances of OSPF or OSPFv3, perform the following tasks:
- Configure the OSPF or OSPFv3 default instance at the [edit protocols (ospf | ospf3)] and [edit logical-systems logical-system-name protocols (ospf | ospf3)] hierarchy levels with the statements needed for your network so that routes are installed in inet.0 and in the forwarding table. Make sure to include the routing table group.
- Configure an OSPF or OSPFv3 routing instance for
each additional OSPF or OSPFv3 routing entity, configuring the following:
- Interfaces
- Routing options
- OSPF protocol statements belonging to that entity
- Routing table group
- Configure a routing table group to install routes from the default route table, inet.0, into a routing instance’s route table.
- Configure a routing table group to install routes
from a routing instance into the default route table, inet.0.

Note: Nonforwarding routing instances do not have forwarding tables that correspond to their routing tables.
- Create an export policy to export routes with a specific tag and to use that tag to export routes back into the instances. For more information, see the Junos Policy Framework Configuration Guide.
Example: Configuring Multiple Routing Instances of OSPF
Figure 5 shows how you can use multiple routing instances of OSPF or OSPFv3 to segregate prefixes within a large network. The network consists of three administrative entities: voice-policy, other-policy, and the default routing instance. Each entity is composed of several geographically separate sites that are connected by the backbone and managed by the backbone entity.
Figure 5: Configuration for Multiple Routing Instances

Sites A and D belong to the voice-policy routing instance. Sites B and C belong to the other-policy instance. Router 1 and Router 3 at the edge of the backbone connect the routing instances. Each runs a separate OSPF or OSPFv3 instance (one per entity).
Router 1 runs three OSPF or OSPFv3 instances: one each for Site A (voice-policy), Site C (other-policy), and the backbone, otherwise known as the default instance. Router 3 also runs three OSPF or OSPFv3 instances: one each for Site B (other-policy), Site D (voice-policy), and the backbone (default instance).
When Router 1 runs the OSPF or OSPFv3 instances, the following occur:
- Routes from the default instance routing table are placed in the voice_policy and other_policy instance routing tables.
- Routes from the voice-policy routing instance are placed in the default instance routing table.
- Routes from the other-policy routing instance are placed in the default instance routing table.
- Routes from the voice-policy routing instance do not enter the other-policy instance routing table.
- Routes from the other-policy routing instance do not enter the voice-policy instance routing table.
Configuring Router 1
The following sections describe how to configure Router 1 in the backbone entity with multiple routing instances.
Configure the routing instances for voice-policy and other-policy:
Configure the routing table group inet-to-voice-and-others to take routes from inet.0 (default routing table) and place them in the voice-policy.inet.0 and other-policy.inet.0 routing tables:
Configure the routing table group voice-to-inet to take routes from voice-policy.inet.0 and place them in the inet.0 default routing table:
Configure the routing table group other-to-inet to take routes from other-policy.inet.0 and place them in the inet.0 default routing table:
Configure the default OSPF or OSPFv3 instance:
Configuring Router 3
The configuration for Router 3 is the same as for Router 1 except that the interface names might differ. In this topology, the interface so-5/2/2.0 belongs to other-policy, and so-3/2/2.0 belongs to voice-policy.
Hide Navigation Pane
Show Navigation Pane
Download
SHA1