Junos Basics – Inter VLAN Routing

By | July 22, 2013

In my previous Junos Basics post I covered the configuration steps required to create VLAN’s on a Juniper switch and assign interfaces to them. In this post I’ll step through the config to enable routing between these VLAN’s and also show a couple of verification commands to check it’s working as expected.

Firstly we configure a routed VLAN interface (RVI) for each VLAN, which is the equivalent of an SVI in Ciscoland. Note that we are configuring the unit value (used for logical interface configuration) to be the same as the VLAN tag, although this is optional:

set interfaces vlan unit 100 family inet address 192.168.1.1/24
set interfaces vlan unit 200 family inet address 192.168.2.1/24

Secondly, we link the VLAN’s to the RVI’s. Note that we specify the unit numbers we set in the previous step for each layer 3 interface:

set vlans SALES l3-interface vlan.100
set vlans IT l3-interface vlan.200

For an RVI to be up and the routing table to have a valid route to it’s VLAN there has to be at least one interface in that VLAN connected and up. I’ve connected a couple of hosts to the interfaces we’ve configured so we can see this in action.

First up we can check the status of our L3 interfaces:

rich@EX2200C> show interfaces terse | match vlan
vlan                    up    up
vlan.100                up    up   inet     192.168.1.1/24
vlan.200                up    up   inet     192.168.2.1/24

All good so far, next let’s check the local routing table to see if the routes to our new VLAN’s are in there and are valid (if there are no UP interfaces in a VLAN, then the route will say “reject”):

rich@EX2200C> show route

inet.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

192.168.1.0/24     *[Direct/0] 00:08:17
                    > via vlan.100
192.168.1.1/32     *[Local/0] 00:36:50
                      Local via vlan.100
192.168.2.0/24     *[Direct/0] 00:00:41
                    > via vlan.200
192.168.2.1/32     *[Local/0] 00:36:50
                      Local via vlan.200

As a final verification, lets ping one of our RVI’s and make sure it’s up:

rich@EX2200C> ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=0.356 ms

I hope this has been a useful explanation.  In the next post in this Junos Basics series, I’ll cover trunking the VLAN’s out to an access layer switch.

Thanks for reading.

Rich

Follow Rich on Twitter

4 thoughts on “Junos Basics – Inter VLAN Routing

  1. Pingback: Junos Basics – Inter VLAN Routing – PingvinHund

  2. Dave

    5 years later you just solved 4 hours of banging my head against the wall:

    “For an RVI to be up and the routing table to have a valid route to it’s VLAN there has to be at least one interface in that VLAN connected and up. I’ve connected a couple of hosts to the interfaces we’ve configured so we can see this in action.”

    DOH!!! Thanks for the concise post.

    Reply
    1. Rich Bibby Post author

      LOL!! You’re welcome, and thanks for reading Dave!

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *