This article will be focused in explaining the basic principles of inter-vlan routing. This is a mechanism that provides communication between different VLANs. Because each VLAN has its own broadcast domain, devices from separate VLANs cannot communicate with each other. As the same suggest, inter-VLAN routing is made by connecting a router to a switched network. The router acts as a the point of contact between two or more VLANs. I will try to explain all the elements that make up inter-vlan routing and also I will show you how to configure it. What you have to remember so far is that inter-vlan routing is a mechanism used to forward traffic from on VLAN to another.
Older implementations of inter-vlan routing required that a router would have one physical interface for each VLAN. Newer implementations like “router-on-a-stick” can use one physical interface for all VLANs. “Router-on-a-stick” added a new features in which a router can have multiple subinterfaces for each physical interface. A router configured with subinterfaces can receive tagged traffic coming from a trunk link. The router must be connected to a switch port set in the trunk mode. Subinterfaces are configured in software and act like real interfaces(each one must have an IP and subnet mask configured). Basically, traffic is sent and received through one physical interface and the router makes its decisions based on the subinterface configuration and tagged traffic coming from the trunk link. The router acts somehow like a switch between subinterfaces. As I’ve told you previously, each subinterface must have an IP configured that is part of a specified VLAN subnet. The subinterface IP will act as the gateway for switches that make up a particular VLAN.
If you’ve read all my networking articles you now by now how to configure interfaces on a router. The limitation of the older implementation of inter-vlan routing was that with each new VLAN added, the router would have to provide a dedicated physical interface. Using the new inter-vlan routing design, a physical interface can be part of several VLANs while subinterfaces are assigned separately for each VLAN. A subinterface configuration looks similar to a physical interface configuration, you have to specify an IP address and subnet mask. The physical interface must be connected to a trunk port this is why when configuring subinterfaces, you will have to specify the encapsulation type for each VLAN. I will show you in a moment how to configure subinterfaces. The benefit of using subinterfaces is visible from the start, the cost is reduced because you use only one physical interface for many VLANs. Of course, subinterface configuration is more complex than physical interface configuration and the speed is reduced since all subinterfaces use the speed of one physical interface.
I will show you now how to configure inter-vlan routing without using subinterfaces, in order to see the difference between these two technologies. Assuming that you’ve already configured VLANs on the switches connected to the router, I will jump directly to the router configuration (if you didn’t configured VLANs, check out an earlier networking post). Let’s take the following topology: