Inter-VLAN routing is the process of forwarding traffic between VLANs using a Layer 3 device, because each VLAN is a separate broadcast domain and a separate IP subnet. The three methods are a router with one interface per VLAN, router on a stick with subinterfaces on a single trunk, and a Layer 3 switch using switched virtual interfaces (SVIs). Most modern networks use the Layer 3 switch method.
Key takeaways
- Hosts in different VLANs cannot communicate without a router or Layer 3 switch acting as their default gateway.
- Router on a stick suits small networks; a Layer 3 switch with SVIs is the scalable choice for larger networks.
- Routing between VLANs must be filtered with ACLs and hardened against VLAN hopping, or segmentation is only cosmetic.
VLANs are one of the most useful tools in network security: they split one physical network into separate logical networks so finance, guests and servers cannot see each other. But sooner or later something in one VLAN needs to talk to something in another — and that is where inter-VLAN routing comes in.
What is inter-VLAN routing?
Inter-VLAN routing is the process of forwarding network traffic from one VLAN to another VLAN using a router or a Layer 3 switch. Without it, hosts in different VLANs cannot communicate at all.
Each VLAN is a separate broadcast domain and a separate IP subnet. A switch forwards frames inside a VLAN, but it will not forward a frame from one VLAN to another, because at Layer 2 those networks are isolated by design. To cross the boundary, the packet must go up to Layer 3, where a device that understands IP addresses can route it.
That Layer 3 device holds one gateway address per VLAN. Every host points at the gateway address for its own VLAN, and the router or switch forwards packets between gateways. Cisco Press describes three options for doing this: legacy routing with one router interface per VLAN, router on a stick, and a Layer 3 switch using switched virtual interfaces (SVIs).
If you are still planning the segmentation itself, our guide to securing your Wi-Fi network covers the home and small-office side of separating trusted and untrusted devices.
Why can't VLANs talk to each other directly?
They cannot because a VLAN is a separate broadcast domain, and a switch never forwards broadcast or unicast traffic between broadcast domains. That isolation is the whole point of VLANs.
Think of it this way: a host decides whether a destination is local by comparing the destination IP address with its own address and subnet mask. If the destination is in another subnet, the host sends the packet to its default gateway instead of trying to reach it directly. If no gateway exists for that VLAN, the packet has nowhere to go.
This is why every VLAN that needs to communicate gets its own subnet and its own gateway address. A typical small office might use VLAN 10 for staff on 192.168.10.0/24 with gateway 192.168.10.1, and VLAN 20 for guests on 192.168.20.0/24 with gateway 192.168.20.1. The two gateways live on the same routing device, which forwards between them.
What happens to a packet travelling between VLANs?
A packet from a PC in VLAN 10 to a server in VLAN 20 follows the same five steps whatever method you use. Understanding them makes troubleshooting far easier.
- The PC sends to its gateway. The PC sees the destination is in another subnet and sends the packet to its default gateway, the VLAN 10 gateway address.
- The switch tags the frame. On the trunk link to the router, the frame carries an 802.1Q tag identifying VLAN 10.
- The gateway routes it. The router or Layer 3 switch strips the Layer 2 header, looks up the destination address in its routing table, and finds the directly connected route for the VLAN 20 subnet.
- The frame is re-tagged. The packet leaves on the VLAN 20 interface, tagged as VLAN 20.
- The switch delivers it. The switch strips the tag and forwards the frame out of the access port to the server.
The reply follows the same path in reverse. Note that with router on a stick, the packet crosses the single trunk link twice, once in each direction, which is why that design tops out at the trunk's bandwidth.
What are the three methods of inter-VLAN routing?
The three methods are legacy routing with one physical router interface per VLAN, router on a stick with subinterfaces on a single trunk, and a Layer 3 switch using SVIs. They solve the same problem at very different scales, as Cisco Press explains in its inter-VLAN routing chapter.
| Method | Physical links | Gateway interface | Throughput limit | Best fit |
|---|---|---|---|---|
| Legacy (one interface per VLAN) | One access link per VLAN | Physical router interface | Each router port | Two or three VLANs, old designs |
| Router on a stick | One trunk | Subinterface per VLAN, 802.1Q | The single trunk, shared both ways | Small sites; traffic that must pass a firewall |
| Layer 3 switch (SVI) | None extra | SVI per VLAN | Switch hardware, usually line rate | Campus and larger networks |
Legacy: one router interface per VLAN
In the legacy method, each VLAN connects to its own physical interface on the router. VLAN 10 plugs into one router port, VLAN 20 into another, and each interface holds the gateway address for its VLAN. It is simple and easy to understand, but it does not scale: a router quickly runs out of interfaces, and every new VLAN needs another cable and port. Cisco Press calls it a legacy solution that does not scale well, and you should not design a new network this way.
Router on a stick: one interface, many subinterfaces
Router on a stick needs only one physical Ethernet interface. That interface connects to a trunk port on the switch and is split into software subinterfaces, one per VLAN, each with its own IP address and 802.1Q encapsulation. It is an acceptable solution for small to medium networks, and it is the standard answer when inter-VLAN traffic must pass through a firewall, because the firewall sits on that single path.
Layer 3 switch: SVIs
The modern method uses a Layer 3 switch and switched virtual interfaces. An SVI is a virtual interface created for a VLAN on the switch itself, and it performs the same job as a router interface for that VLAN. Because routing happens in the switch hardware, it runs at line rate, and no extra cabling is needed. Enterprise campus networks use this method almost everywhere.
How does router on a stick work?
Router on a stick works by turning one physical router interface into several virtual ones. The link between router and switch is an 802.1Q trunk, so it carries tagged traffic for every VLAN.
On the router, you create a subinterface for each VLAN. Each subinterface is a software-based virtual interface tied to the single physical interface, with its own IP address on that VLAN's subnet. The physical interface itself gets no IP address; it is simply enabled with no shutdown.
A typical Cisco IOS configuration for VLANs 10 and 20 looks like this:
interface GigabitEthernet0/0no shutdowninterface GigabitEthernet0/0.10encapsulation dot1Q 10ip address 192.168.10.1 255.255.255.0interface GigabitEthernet0/0.20encapsulation dot1Q 20ip address 192.168.20.1 255.255.255.0
On the switch side, the port facing the router must be a trunk carrying both VLANs, and the host ports must be access ports in the right VLAN. Verify with ping between hosts, and troubleshoot with show ip route, show ip interface brief and show interfaces trunk.
The main weakness is bandwidth. A packet from VLAN 10 to VLAN 20 crosses the trunk twice, so a 1 Gbit/s trunk carries at most about 1 Gbit/s of routed traffic in both directions combined, shared with everything else on that link. Use a Gigabit or faster interface, and move to a Layer 3 switch when inter-VLAN traffic grows.
How does inter-VLAN routing work on a Layer 3 switch?
A Layer 3 switch routes between VLANs using switched virtual interfaces, one per VLAN, with no router involved. Each SVI is created with the interface vlan command and given the gateway IP address for its VLAN.
The essential steps are: create the VLANs, assign access ports, create an SVI for each routable VLAN, and enable IP routing with the ip routing command. A minimal example:
ip routinginterface Vlan10ip address 192.168.10.1 255.255.255.0no shutdowninterface Vlan20ip address 192.168.20.1 255.255.255.0no shutdown
Once the SVIs are up, the switch automatically routes between them, because each VLAN subnet appears as a directly connected route. An SVI only comes up when the VLAN exists and at least one active port belongs to it, so a VLAN with no live access port will show its SVI as down.
Layer 3 switches can also turn a normal switch port into a routed port with no switchport and an IP address, which is useful for uplinks to a router or firewall. For resilience, larger networks run two Layer 3 switches with a first-hop redundancy protocol such as HSRP, so hosts keep the same virtual gateway address even if one switch fails. You can map the whole layout first with a network topology mapper so you know which switch holds each SVI.
Router on a stick vs Layer 3 switch: which should you choose?
Choose router on a stick for a small network, and a Layer 3 switch for anything larger or busier. The deciding factors are traffic volume, the number of VLANs, and whether traffic between VLANs needs firewall inspection.
- Pick router on a stick when you have a handful of VLANs, light traffic between them, and a router or firewall already in place. It costs nothing extra and puts a natural inspection point on the path.
- Pick a Layer 3 switch when inter-VLAN traffic is heavy, you have many VLANs, or you need routing at line rate. Campus distribution and core layers and data centre leaf switches all work this way.
- Pick a firewall as the router when the segments have different trust levels, for example staff, guests and servers, and you want every packet between them inspected. Accept the lower throughput in exchange for control.
Many real networks combine them: a Layer 3 switch routes between trusted internal VLANs at line rate, while traffic to guest, IoT or DMZ VLANs is sent to the firewall. That gives you speed where it is safe and inspection where it matters.
How do you secure inter-VLAN routing?
Routing between VLANs is only as secure as the controls around it. By default, a Layer 3 switch routes freely between every VLAN, which quietly removes the isolation the VLANs were meant to provide.
Filter with ACLs. Apply an access control list to each SVI so only the traffic a VLAN pair genuinely needs is allowed. Guests should reach the internet and nothing internal; printers should accept jobs from staff but never initiate connections outward. Deny by default and permit specific flows.
Route untrusted segments through a firewall. If a VLAN holds guests, IoT devices or contractors, send its traffic to the firewall rather than routing it directly on the switch. The firewall can inspect, log and block at Layer 7.
Stop VLAN hopping. Two classic attacks abuse trunking. In switch spoofing, an attacker negotiates a trunk with a user-facing port using DTP and gains access to all VLANs. In double tagging, the attacker exploits the native VLAN to inject a frame into another VLAN. Cisco's VLAN hopping guidance recommends setting every access port explicitly to switchport mode access, setting trunks explicitly with switchport nonegotiate, and changing the native VLAN away from VLAN 1 to an unused VLAN.
Protect the control plane. Enable Dynamic ARP Inspection to stop ARP spoofing between VLANs, and keep management traffic on its own VLAN that users cannot reach. A full device checklist helps here — see our small business cybersecurity checklist for the surrounding controls.
How do you troubleshoot inter-VLAN routing?
Most inter-VLAN routing failures come from a short list of causes. Work through them in order, from the host up to the gateway.
- Check the host gateway. Confirm the host's default gateway matches the SVI or subinterface address for its VLAN, and that the subnet mask is right.
- Check the SVI is up. On a Layer 3 switch, run
show ip interface brief. An SVI stays down if the VLAN has no active access port, so plug a live device into the VLAN or check the port status. - Confirm IP routing is enabled. On a Layer 3 switch,
ip routingmust be on. Without it, the switch behaves like a Layer 2 switch and routes nothing. - Check the trunk. Run
show interfaces trunkand confirm the VLAN is allowed on the trunk and the native VLAN matches on both ends. A native VLAN mismatch produces CDP warnings and misrouted untagged traffic. - Check the routing table.
show ip routeshould list each VLAN subnet as directly connected. If a subnet is missing, its SVI or subinterface is down or misconfigured. - Check the ACL. If pings to the gateway work but traffic to the other VLAN fails, an ACL on the SVI is the likely cause. Temporarily log denied packets to see what is being dropped.
- Test step by step. Ping the host's own gateway, then the other VLAN's gateway, then a host in the other VLAN. The first step that fails tells you where the problem is.
The bottom line
Inter-VLAN routing is what turns VLANs from isolated islands into a usable segmented network. Router on a stick is the cheapest way to start, a Layer 3 switch with SVIs is the right answer at scale, and a firewall is the right answer when the traffic between segments needs inspection.
Whatever method you choose, decide deliberately which VLANs may talk and what they may say to each other. If you cannot see the current layout, start by mapping it — our guide to the best network topology mappers shows the tools that draw it for you.
Frequently asked questions
What is inter-VLAN routing in simple terms?
It is the way devices in different VLANs communicate. Because each VLAN is its own broadcast domain and IP subnet, a Layer 3 device such as a router or Layer 3 switch must forward packets from one VLAN to the other, acting as the default gateway for both.
Do I need a router for inter-VLAN routing?
You need a Layer 3 device, but not necessarily a separate router. A Layer 3 switch can route between VLANs itself using switched virtual interfaces, and many small networks use a router or firewall connected by a single trunk instead.
What is router on a stick?
Router on a stick is inter-VLAN routing through one physical router interface. The link to the switch is a trunk, and the router has one subinterface per VLAN, each with its own IP address and 802.1Q tag. It works well for small networks but the single link is a bottleneck.
What is an SVI?
A switched virtual interface is a virtual Layer 3 interface on a Layer 3 switch, created with the interface vlan command and given an IP address. Each routable VLAN gets one SVI, which acts as the default gateway for hosts in that VLAN.
Is inter-VLAN routing secure?
Only if you control it. By default a Layer 3 switch routes freely between all VLANs, which defeats the point of segmenting them. Use access control lists on the SVIs or route inter-VLAN traffic through a firewall, and harden trunks against VLAN hopping.
Why is my inter-VLAN routing not working?
The most common causes are a missing or down SVI, IP routing not enabled on the switch, hosts pointing at the wrong default gateway, a trunk that does not carry the VLAN, or an ACL blocking the traffic. Check show ip route, show interfaces trunk and show vlan brief.
Can a firewall do inter-VLAN routing?
Yes. Many small and mid-size networks route between VLANs on a firewall instead of a switch, because the firewall can inspect and filter the traffic between segments. It is slower than a Layer 3 switch for heavy internal traffic, but it gives the strongest control.
Does inter-VLAN routing need a trunk link?
Router on a stick does, because several VLANs share one physical link and 802.1Q tags tell them apart. A Layer 3 switch does not need a trunk for routing itself, since the VLANs already exist on the switch, though trunks are still used to carry VLANs between switches.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against Cisco Press inter-VLAN routing material and Cisco Learning Network best-practice and VLAN hopping guidance.
How we write and fact-check →