Creating Routing Table Groups

You can group together one or more routing tables to form a routing table group. Within a group, a routing protocol can import routes into all the routing tables in the group and can export routes from a single routing table.

To create a routing table group, include the rib-groups statement:

rib-groups group-name {import-policy [ policy-names ];import-rib [ routing-table-names ];export-rib routing-table-name;}

For a list of hierarchy levels at which you can include this statement, see the statement summary section for this statement.

The routing table group can have any name you choose (specified in group-name). If the group name you specify is not created explicitly, you can create it by naming it in the rib-groups statement.

Each routing table group must contain one or more routing tables that the Junos OS uses when importing routes (specified in the import-rib statement). The first routing table you specify is the primary routing table, and any additional routing tables are the secondary routing tables.

The primary routing table determines the address family of the routing table group. To configure an IP version 4 (IPv4) routing table group, specify inet.0 as the primary routing table. To configure an IP version 6 (IPv6) routing table group, specify inet6.0 as the primary routing table. If you configure an IPv6 routing table group, the primary and all secondary routing tables must be IPv6 routing tables (inet6.x).

In Junos OS Release 9.5 and later, you can include both IPv4 and IPv6 routing tables in an IPv4 import routing table group using the import-rib statement. In releases prior to Junos OS Release 9.5, you can only include either IPv4 or IPv6 routing tables in the same import-rib statement. The ability to configure an import routing table group with both IPv4 and IPv6 routing tables enables you, for example, to populate the inet6.3 routing table with IPv6 addresses that are compatible with IPv4. Specify inet.0 as the primary routing table, and specify inet6.3 as a secondary routing table.

Each routing table group optionally can contain one routing table group that the Junos OS uses when exporting routes to the routing protocols (specified in the export-rib statement).

Note: If you configure an import routing table group that includes both IPv4 and IPv6 routing tables, any corresponding export routing table group must include only IPv4 routing tables.

If you have configured a routing table, configure the OSPF primary instance at the [edit protocols ospf] hierarchy level 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. For more information, see Configuring Multiple Instances of OSPF.

After specifying the routing table from which to import routes, you can apply one or more policies to control which routes are installed in the routing table group. To apply a policy to routes being imported into the routing table group, include the import-policy statement:

rib-groups group-name {import-policy [ policy-names ];}

For a list of hierarchy levels at which you can include this statement, see the statement summary section for this statement.

Examples: Creating Routing Table Groups

Create an IPv4 routing table group so that interface routes are installed into two routing tables, inet.0 and inet.2:

[edit]routing-options {interface-routes {rib-group if-rg;}rib-groups if-rg {import-rib [ inet.0 inet.2 ];}}

Create an IPv6 routing table group so that interface routes are installed into two routing tables, inet6.0 and inet6.2:

[edit]routing-options {interface-routes {rib-group inet6 if-rg;}rib-groups if-rg {import-rib [ inet6.0 inet6.2 ];}}