Inter VLAN Routing Tutorial
In an earlier tutorial for VLAN, we grabbed the basic concepts of VLAN. We have learned about what is VLAN, its advantages, and disadvantages along with an introduction about inter VLAN routing. In this tutorial, we will learn in detail about the routing across VLANs.
Why inter VLAN routing is important? As the basic concept of a virtual LAN is to limit the group of computers to communicate with each other. For example, an HR department VLAN computers can communicate with other HLR department computers only. The control is at the data link layer of the switch, each port is tagged with the VLAN Id. So the switch does not monitor the logical layer 3 address.
If a frame is received on a port, it can leave from the ports that have the same incoming VLAN Id. But in real life at some point in time, there will be a need to communicate with outer machines too. That brings the need for Inter Vlan routing. Maybe the HR department wants to access the server of the technical department for the job requirements.
How to set up an Inter Vlan Routing?
Using a Router – basic approach:
The simplest way for inter VLAN routing is to place a router. The router should have an IP address configured for each VLAN (Broadcast domain). After adding the router with the switch. 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.
On the router, the destination IP address is examined and the network routing table is looked upon. If 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, 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 VLAN. 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 that a truck port can forward any VLAN traffic to the far end on a router. On the router, there will be sub interfaces for each broadcast domain. For scalability, if a new VLAN added, only need to add a new sub-interface on the router.