Create 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.0for Internet Protocol Version 4 (IPv4) unicast routes,inet6.0for Internet Protocol Version 6 (IPv6) unicast routes,inet.1for the IPv4 multicast forwarding cache, andinet.3for IPv4 Multiprotocol Label Switching (MPLS). If Multiprotocol Border Gateway Protocol (MBGP) is enabled,inet.2is used for subaddress family indicator (SAFI) 2 routes. If you configure a routing instance, the JUNOS software creates the default unicast routing tableinstance-name.inet.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 toinet.0. You can add these routes just by including thestatic,aggregate,generate, andmartiansstatements at the[edit routing-options]hierarchy level (for routing instances, include the statements at the[edit routing-instancesrouting-instance-namerouting-options]hierarchy level).To explicitly create a routing table, include the
ribstatement at the[edit routing-options]hierarchy level (for routing instances, include the statement at the[edit routing-instancesrouting-instance-namerouting-options]hierarchy level):[edit]routing-options {ribrouting-table-name{static {defaults {static-options;}rib-groupgroup-name;routedestination-prefix{lsp-next-hoplsp-name{metricmetric;preferencepreference;}next-hop;qualified-next-hopaddress{metricmetric;preferencepreference;}static-options;}}aggregate {defaults {aggregate-options;}routedestination-prefix{policypolicy-name;aggregate-options;}}generate {defaults {generate-options;}routedestination-prefix{policypolicy-name;generate-options;}}martians {destination-prefixmatch-type<allow>;}}}The routing table name,
routing-table-name, includes the protocol family, optionally followed by a period and a number. The protocol family can beinetfor the IPv4 family,inet6for the IPv6 family, orisofor the ISO protocol family. The number represents the routing instance. The first instance is 0.Example: Create Routing Tables
Create the IPv4 routing table
inet.4and 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.0and add a static route to it:[edit routing-options]rib inet6.0 {static {route 8:1::1/128 next-hop 8:3::1;}}