To configure multiple routing instances of OSPF or OSPFv3, perform the following tasks:
![]() |
Note: Nonforwarding routing instances do not have forwarding tables that correspond to their routing tables. |
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:
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:
- [edit]
- routing-instances {
-
- voice-policy {
- interface so-2/2/2.0;
-
- protocols {
-
- (ospf | ospf3) {
- rib-group voice_to_inet; # Places routes into inet.0
#
-
- area 0.0.0.0 {
- interface so-2/2/2.0;
- }
- }
- }
- }
- }
- other-policy {
- interface so-4/2/2.0;
-
- protocols {
-
- (ospf | ospf3) {
- rib-group other_to_inet; # Places routes into inet.0 #
-
- area 0.0.0.0 {
- interface so-4/2/2.0;
- }
- }
- }
- }
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:
- [edit]
- routing-options {
-
- rib-groups {
-
- inet_to_voice_and_other {
- import-rib [ inet.0 voice-policy.inet.0 other-policy.inet.0
];
- }
- }
- }
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:
- [edit]
- routing-options {
-
- rib-groups {
-
- voice_to_inet {
- import-rib [ inet.0 voice-policy.inet.0 ];
- }
- }
- }
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:
- [edit]
- routing-options {
-
- rib-groups {
-
- other_to_inet {
- import-rib [ inet.0 other-policy.inet.0 ];
- }
- }
- }
Configure the default OSPF or OSPFv3 instance:
- [edit]
- protocols {
-
- (ospf | ospf3) {
-
- rib-group inet_to_voice_and_other;# Place
prefixes from inet.0 into
- area 0.0.0.0 {# voice-policy.inet.0 and
- interface so-2/2/2.0;# other-policy.inet.0
- interface so-4/2/2.0;
- }
- }
- }
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.