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 configure 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, as described in Configuring Other Protocol-Independent Routing Properties, 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 software 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 Internet Protocol version 4 (IPv4) routing table group, specify inet.0 as the primary routing table. To configure an Internet Protocol 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). You cannot have inet and inet6 routing tables in the same import-rib statement.
Each routing table group optionally can contain one routing table group that the JUNOS software uses when exporting routes to the routing protocols (specified in the export-rib statement).
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 will be 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 configure this statement, see the statement summary section for this statement.
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 ];
- }
- }