Inter VLAN Routing Tutorial.


In another tutorial for VLAN, we grabbed its basic concepts. We have learned the basics of VLAN, its advantages and disadvantages, and an introduction to inter-VLAN routing. In this tutorial, we will learn in detail how routing works between VLANs.

Why inter VLAN routing is essential? The basic concept of a virtual LAN is to limit a group of computers to communicate with each other using a shared network switch.

For example, an HR department’s VLAN computer can communicate with other HR department computers only, even if they have a switch that connects to other departments also.

The restriction applies at the data link layer level of the switch, and each port is tagged with a VLAN Id. So the switch does not inspect the logical layer three address in a received packet.

If a frame is received on a port, it can only leave from the ports having the same VLAN Id as the receiver port. But in real life, at some point in time, there would be a need to communicate with outer machines, too, those are outside of the current VLAN.

This brings the need for Inter VLAN routing. For example, the HR department may require access to the technical department’s server for the job requirements at some point.

How to set up an Inter Vlan Routing?

Using a Router – A basic approach:

The simplest way for inter-VLAN routing is to place a router between VLANs. After adding the router with the switch, the router should have an IP address configured for each VLAN (Broadcast domain). The default gateway of each machine on a broadcast domain should be the IP address on the router for that VLAN when any host in a VLAN sends the traffic to any destination. The packet reaches the router with the VLAN id of the host network.

The destination IP address is examined on the router, and the network routing table is looked upon. Suppose an entry is found where the IP belongs to another VLAN. The router modifies the packet to the new VLAN id and forwards it to the switch.

After reaching to switch, it broadcasts the packet to the newer VLAN, and it reaches the final destination. With this approach, the problem is that the router should have as many network interface cards as the number of VLANs. So not a good option for scalability.

Router On a Stick option for Inter Vlan Routing:

To overcome the problem in the basic approach, we have an option called Router On Stick. In a router on a stick, the switch ports connect to the router over the trunk port. As we discussed earlier, what is a VLAN tutorial?

A truck port can forward any VLAN traffic to the far end of a router. On the router, there will be subinterfaces for each broadcast domain. For scalability, if a new VLAN is added, we only need to add a new sub-interface on the router.