[Contents] [Prev] [Next] [Index] [Report an Error]

Creating Routing Tables

The JUNOS software can maintain one or more routing tables, thus allowing the software to store route information learned from different protocols separately. For example, it is common for the routing software to maintain unicast routes and multicast routes in different routing tables. You also might have policy considerations that would lead you to create separate routing tables to manage the propagation of routing information.

Creating routing tables is optional. If you do not create any, the JUNOS software uses its default routing tables, which are inet.0 for Internet Protocol version 4 (IPv4) unicast routes, inet6.0 for Internet Protocol version 6 (IPv6) unicast routes, inet.1 for the IPv4 multicast forwarding cache, and inet.3 for IPv4 Multiprotocol Label Switching (MPLS). If the Multiprotocol Border Gateway Protocol (MBGP) is enabled, inet.2 is used for Subsequent Address Family Indicator (SAFI) 2 routes. If you configure a routing instance, the JUNOS software creates the default unicast routing table instance-name.inet.0. If you configure a flow route, the JUNOS software creates the flow routing table instance-name.inetflow.0.

If you want to add static, aggregate, generated, or martian routes only to the default IPv4 unicast routing table (inet.0), you do not have to create any routing tables because, by default, these routes are added to inet.0. You can add these routes just by including the static, aggregate, generate, and martians statements. For a list of hierarchy levels at which you can configure this statement, see the statement summary section for this statement.

To explicitly create a routing table, include the rib statement:

rib routing-table-name {
static {
defaults {
static-options;
}
rib-group group-name;
route destination-prefix {
lsp-next-hop lsp-name {
metric metric;
preference preference;
}
next-hop;
p2mp-lsp-next-hop {
metric metric;
preference preference;
}
qualified-next-hop address {
metric metric;
preference preference;
}
static-options;
}
}
aggregate {
defaults {
... aggregate-options ...
}
route destination-prefix {
policy policy-name;
... aggregate-options ...
}
}
generate {
defaults {
generate-options;
}
route destination-prefix {
policy policy-name;
generate-options;
}
}
martians {
destination-prefix match-type <allow>;
}
}

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

The routing table name, routing-table-name, includes the protocol family, optionally followed by a period and a number. The protocol family can be inet for the IPv4 family, inet6 for the IPv6 family, or iso for the International Standards Organization (ISO) protocol family. The number represents the routing instance. The first instance is 0.

Example: Creating Routing Tables

Create the IPv4 routing table inet.4 and add a static route to it:

[edit]
routing-options {
rib inet.4 {
static {
route 140.122.0.0/16 next-hop 192.168.0.10;
}
}
}

Configure the primary IPv6 routing table inet6.0 and add a static route to it:

[edit routing-options]
rib inet6.0 {
static {
route 8:1::1/128 next-hop 8:3::1;
}
}

[Contents] [Prev] [Next] [Index] [Report an Error]