Inter VLAN Routing Tutorial.
In an earlier tutorial for VLAN, we grabbed the basic concepts about it. We have learned the basics of VLAN, its advantages, and disadvantages along with an introduction to inter-VLAN routing. In this tutorial, we will learn in detail about how routing works between 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’s VLAN computer can communicate with other HLR department computers only.
The restriction applies at the data link layer level of the switch, each port is tagged with a 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 would be a need to communicate with outer machines too, those are outside of VLAN. This brings the need for Inter Vlan routing. For example, the HR department may require to access the server of the technical department for the job requirements.
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. 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 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 that a truck port can forward any VLAN traffic to the far end of a router. On the router, there will be sub interfaces for each broadcast domain. For scalability, if a new VLAN is added, only need to add a new sub-interface on the router.