Technical Documentation

Example: Using Virtual Routing Instances to Route Among VLANs on EX Series Switches

Virtual routing instances allow each EX Series switch to have multiple routing tables on a device. With virtual routing instances, you can segment your network to isolate traffic without setting up additional devices.

This example describes how to create virtual routing instances:

Requirements

This example uses the following hardware and software components:

  • One EX Series switch
  • JUNOS Release 9.2 or later for EX Series switches

Before you create the virtual routing instances, make sure you have:

Overview and Topology

In a large office, you may need multiple VLANs to properly manage your traffic. This configuration example shows a simple topology to illustrate how to connect a single EX Series switch with a virtual routing instance for each of two VLANs, enabling traffic to pass between those VLANs.

In the example topology, the LAN is segmented into two VLANs, each associated with an interface and a routing instance on the EX Series switch.

Configuration

CLI Quick Configuration

To quickly create and configure virtual routing instances, copy the following commands and paste them into the switch terminal window:


[edit]


set interfaces ge-0/0/3 vlan-tagging


set interfaces ge-0/0/3 unit 0 vlan-id 1030 family inet address 103.1.1.1/24


set interfaces ge-0/0/3 unit 1 vlan-id 1031 family inet address 103.1.1.1/24


set routing-instances r1 instance-type virtual-router


set routing-instances r1 interface ge-0/0/1.0


set routing-instances r1 interface ge-0/0/3.0


set routing-instances r2 instance-type virtual-router


set routing-instances r2 interface ge-0/0/2.0


set routing-instances r2 interface ge-0/0/3.1

Step-by-Step Procedure

To configure virtual routing instances:

  1. Create a VLAN-tagged interface:

    [edit]
    user@switch# set interfaces ge-0/0/3 vlan-tagging
  2. Create two subinterfaces, on the interface, one for each routing instance:

    [edit]
    user@switch# set interfaces ge-0/0/3 unit 0 vlan-id 1030 family inet address 103.1.1.1/24


    user@switch# set interfaces ge-0/0/3 unit 1 vlan-id 1031 family inet address 103.1.1.1/24

  3. Create two virtual routers:

    [edit]
    user@switch# set routing-instances r1 instance-type virtual-router
    user@switch# set routing-instances r2 instance-type virtual-router

  4. Set the interfaces for the virtual routers:

    [edit]
    user@switch# set routing-instances r1 interface ge-0/0/1.0


    user@switch# set routing-instances r1 interface ge-0/0/3.0


    user@switch# set routing-instances r2 interface ge-0/0/2.0


    user@switch# set routing-instances r2 interface ge-0/0/3.1

Results

Check the results of the configuration:

user@switch> show configuration
interfaces {
ge-0/0/1 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/2 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/3 {
vlan-tagging;
unit 0 {
vlan-id 1030;
family inet {
address 103.1.1.1/24;
}
}
unit 1 {
vlan-id 1031;
family inet {
address 103.1.1.1/24;
}
}
}
routing-instances {
r1 {
instance-type virtual-router;
interface ge-0/0/1.0;
interface ge-0/0/3.0;
}
r2 {
instance-type virtual-router;
interface ge-0/0/2.0;
interface ge-0/0/3.1;
}
}

Verification

To confirm that the configuration is working properly, perform these tasks:

Verifying That the Routing Instances Were Created

Purpose

Verify that the virtual routing instances were properly created on the switch.

Action

Use the show route instance command:


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

r1                   virtual-router
         r1.inet.0                                       1/0/0

r2                   virtual-router
         r2.inet.0                                       1/0/0

Meaning

Each routing instance created is displayed, along with its type, information about whether it is active or not, and its primary routing table.


Published: 2009-07-22