Juniper Routing Instances

Juniper Routing Instances

On a Juniper switch or router, we can create additional virtual routing tables, called routing-instances. These are similar to a VRF on a Cisco Router.

Each routing instance groups routing tables (remember different tables are used for different families), interfaces, and protocol configuration into a single place. This can be used to separate traffic.

For example, the default IPv4 unicast routing table is inet.0. When creating a new instance, an additional routing table, perhaps example.inet.0 is created.

Unlike Cisco, there are several clearly defined types of routing tables, depending on how they’re used.

 

 


Common Types

There are quite a few instance types, many of which are only available on larger platforms.

Here, we’ll focus on the five common types that we might find on an EX-Series switch.

 

No Forwarding

no-forwarding is the default instance type, and is very similar to VRF-Lite. However, there’s a small twist to be aware of, which can be a bit confusing, especially if (like me) you’re from a Cisco background.

This routing instance creates a separate routing table, but it does not create a separate forwarding table. Remember that JunOS has a very clear definition between routing (control plane) and forwarding (forwarding plane).

The result is that routes may be learned from various sources, and installed in the instance’s routing table. The best routes are then pushed into the default forwarding table.

Why would you want to do this? It’s very handy if you want to have more than one instance of a routing protocol (only one instance of a routing protocol is allowed per routing table), but don’t want to fully separate your traffic.

 

Virtual Router

The virtual-router instance type is also very close to Cisco’s VRF-Lite, and is very similar to the no-forwarding instance type.

Unlike the no-forwarding type, virtual-router will create a separate routing table and a separate forwarding table.

Neither of these two instance types uses features like targets, exports, imports, or distinguishers.

 

VRF

The VRF instance type is used when creating an L3VPN. This is a VRF (VPN Routing and Forwarding) in the traditional sense of the term.

So, in short, this is used with MPLS features.

 

L2VPN

Like VRF, L2VPN is used with MPLS features, to create a Layer-2 VPN. Pretty self-explanatory really.

 

Forwarding

This instance type is used for Filter Based Forwarding (FBF). If you’re not familiar with FBF, it is the same thing as Policy Based Routing (PBR) on a Cisco device.

In this case, a new routing table is created, however interfaces still belong to the default instance.

Using firewall filters (ACLs), we can direct traffic to the new routing table. By manipulating the contents of the routing table, we can influence how the packet is routed.

 

 


Basic Configuration

Start by creating the routing-instance. This will default to ‘no-forwarding’ unless another type is specified.

set routing-instances <name> instance-type [type]

 

Add interfaces to the routing instance:

set routing-instances <name> interface <interface>

 

Add routing information, such as a static routes, or other routing protocols:

set routing-instances <name> routing-options static route <route> next-hop <ip>

 

The active config would look like this:

routing-instances {
    Example_instance {
        instance-type virtual-router;
        interface ge-0/0/10;
        routing-options {
            static {
                route 0.0.0.0/0 next-hop 192.168.1.254;
            }
        }
    }
}

 

You can verify your configuration with show route instance.

admin@SW01> show route instance
Instance             Type
         Primary RIB                                     Active/holddown/hidden
master               forwarding
         inet.0                                          3/0/0

Example_instance     virtual-router

__juniper_private1__ forwarding
         __juniper_private1__.inet.0                     4/0/0

__juniper_private2__ forwarding
         __juniper_private2__.inet.0                     0/0/1

__master.anon__ forwarding

 

 

 


References

Juniper – instance-type

Juniper – Configuring Virtual Router Routing Instances

Weekly Geekly – Juniper Routing Instances

 

 

Leave a Reply