In modern enterprise networks, physical topology is no longer the bottleneck for local network design. Logical segmentation using Virtual Local Area Networks (VLANs) has become the standard mechanism to enforce security boundaries, reduce broadcast storms, and optimize broadcast domain performance. This guide explores the engineering foundations of connecting LANs, logical network segmentation, and the technical configurations required to implement Inter-VLAN routing using Cisco IOS architectures.
Connecting modern Local Area Networks (LANs) requires a layered model of hardware systems. These systems are grouped according to the specific layers of the Open Systems Interconnection (OSI) reference model in which they operate.
+-----------------------+---------------------------------------+
| OSI Layer Model | Connecting Network Device |
+-----------------------+---------------------------------------+
| Layer 3 (Network) | Routers / Layer 3 Switches |
+-----------------------+---------------------------------------+
| Layer 2 (Data Link) | Bridges / Layer 2 Switches |
+-----------------------+---------------------------------------+
| Layer 1 (Physical) | Repeaters / Passive & Active Hubs |
+-----------------------+---------------------------------------+At the physical layer, electrical signals degrade over distance due to attenuation. To extend transmission ranges, Layer 1 devices are introduced:
Devices at Layer 2 manage frame delivery based on physical Media Access Control (MAC) addresses.
When redundant links are installed between bridges or switches to prevent network failures, Layer 2 loops can develop. Because Layer 2 frames do not have a Time-to-Live (TTL) field like Layer 3 packets do, broadcast loops can circulate indefinitely, consuming all available bandwidth in a "broadcast storm."
To prevent this, the IEEE 802.1D Spanning Tree Protocol (STP) dynamically calculates a loop-free logical path. STP treats the bridged network as a graph where is the set of switches and is the set of active link paths. The algorithm designates a "Root Bridge" and calculates the shortest path from each switch to the root based on link costs:
Where:
[Root Bridge (Switch A)]
/ \
Cost=19 Cost=19
/ \
[Switch B]-----------[Switch C]
Cost=19
(Port Blocked by STP)By placing redundant ports into a blocking state, loops are broken while maintaining physical redundancy.
A backbone network connects multiple independent LANs without requiring any terminal station to attach directly to the backbone itself. Instead, the stations remain members of their respective local subnets, and the backbone facilitates inter-network traffic.
In a bus backbone topology, the connecting infrastructure is arranged linearly. Often using coaxial cabling or central trunk routing, it links switches/bridges using a shared bus architecture.
In a star backbone configuration, the central hub of the network is a high-speed switch. The local switches or routers of each individual subnet connect directly back to this central core switch:
+------------------------+
| Central L2/L3 Switch | (Star Core)
+-----------+------------+
/ | \
/ | \
+---------+----+ +-----+----+ +-----+----+
| Local Switch | | Local Switch| | Local Switch|
+-------+------+ +-----+----+ +-----+----+
| | |
[ LAN 1 ] [ LAN 2 ] [ LAN 3 ]A Virtual Local Area Network (VLAN) is a logical local area network configured via administrative software rather than physical rewiring.
Physical Topology Logical VLAN Structure
================= ======================
+---------------+ +--------------------+
| L2 Switch | | VLAN 10 (SALES) |
+-+---+---+---+--+ | - Host A |
| | | | | - Host B |
[A] [B] [C] [D] +--------------------+
+--------------------+
(All hosts connected | VLAN 20 (IT) |
to the same switch) | - Host C |
| - Host D |
+--------------------+FF:FF:FF:FF:FF:FF) are forwarded only to ports belonging to the same VLAN.
Switch interfaces are classified by how they handle VLAN tagging:
To distinguish which VLAN a frame belongs to when crossing a trunk link, switches insert an 802.1Q tag directly into the standard Ethernet frame header:
Original Ethernet Frame:
+-----------+-----------+-----------+---------+-----+
| Dest MAC | Src MAC | Type/Len | Payload | FCS |
+-----------+-----------+-----------+---------+-----+
802.1Q Tagged Frame:
+-----------+-----------+-----------+-------------+-----------+---------+-----+
| Dest MAC | Src MAC | 802.1Q Tag| Tag Control | Type/Len | Payload | FCS |
| (6B) | (6B) | TPID (2B) | Info (TCI) | (2B) | | |
+-----------+-----------+-----------+-------------+-----------+---------+-----+
\
VLAN ID (12 bits) => 4096 possible VLANsThe VLAN Identifier (VID) field is 12 bits long, allowing for:
(VLAN 0 and VLAN 4095 are reserved).
Configuring segmentation on a Cisco catalyst switch requires creating the logical VLAN entity and assigning physical interfaces to it.
Enter global configuration mode and define the logical VLAN numbers and names:
Switch>enable
Switch#configure terminal
Switch(config)#vlan 10
Switch(config-vlan)#name SALES
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#name IT
Switch(config-vlan)#exitAssign interfaces FastEthernet 0/1 and 0/2 to VLAN 10, and interfaces FastEthernet 0/3 and 0/4 to VLAN 20:
Switch(config)#interface FastEthernet 0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#interface FastEthernet 0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#interface FastEthernet 0/3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#interface FastEthernet 0/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exitOptimization Tip: You can streamline this using the interface range macro to configure multiple ports simultaneously:
Switch(config)#interface range fa0/1 - 2
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 10
Switch(config-if-range)#exitTo carry traffic for both VLAN 10 and VLAN 20 to an upstream router or switch, configure interface FastEthernet 0/5 as a trunk:
Switch(config)#interface FastEthernet 0/5
Switch(config-if)#switchport mode trunk
Switch(config-if)#exitBecause hosts on different VLANs reside in separate broadcast domains and IP subnets, they cannot communicate directly at Layer 2. To pass packets between VLANs, a Layer 3 routing engine must bridge the subnets.
In a Router-on-a-Stick topology, a single physical interface on a router connects to an 802.1Q trunk port on a Layer 2 switch. The router physical interface is divided into logical subinterfaces, each assigned to a corresponding VLAN gateway.
+-----------------------+
| Router |
| (Default Gateways) |
+-----------+-----------+
| Subinterfaces:
| fa0/0.10 (IP: 192.168.1.1)
| fa0/0.20 (IP: 192.168.2.1)
|
(Physical Trunk Link)
|
| (fa0/5)
+-----------+-----------+
| Layer 2 Switch |
+-----+-----------+-----+
| |
Access | | Access
(VLAN 10) | | (VLAN 20)
| |
+-----+---+ +---+-----+
| PC1 | | PC3 |
| (SALES) | | (IT) |
+---------+ +---------+To implement this topology, we assign IP addresses and default gateways to the end devices:
+------+---------+------------------+-----------------+-------------------+
| Host | VLAN | IP Address | Subnet Mask | Default Gateway |
+------+---------+------------------+-----------------+-------------------+
| PC1 | VLAN 10 | 192.168.1.10 | 255.255.255.0 | 192.168.1.1 |
| PC2 | VLAN 10 | 192.168.1.20 | 255.255.255.0 | 192.168.1.1 |
| PC3 | VLAN 20 | 192.168.2.10 | 255.255.255.0 | 192.168.2.1 |
| PC4 | VLAN 20 | 192.168.2.20 | 255.255.255.0 | 192.168.2.1 |
+------+---------+------------------+-----------------+-------------------+We must first enable the base physical interface without assigning it an IP address. Then, we create and configure the subinterfaces:
Router>enable
Router#configure terminal
! Bring up the physical link
Router(config)#interface FastEthernet 0/0
Router(config-if)#no shutdown
Router(config-if)#exit
! Configure subinterface for VLAN 10 (SALES)
Router(config)#interface FastEthernet 0/0.10
Router(config-subif)#description Gateway for SALES VLAN 10
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip address 192.168.1.1 255.255.255.0
Router(config-subif)#exit
! Configure subinterface for VLAN 20 (IT)
Router(config)#interface FastEthernet 0/0.20
Router(config-subif)#description Gateway for IT VLAN 20
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip address 192.168.2.1 255.255.255.0
Router(config-subif)#exit192.168.1.10) wants to send a packet to PC3 (VLAN 20, IP 192.168.2.10).192.168.1.1) and sends an ARP request to resolve its MAC address.fa0/0.10 answers the ARP request with its virtual MAC address.fa0/0.10 interface MAC192.168.1.10192.168.2.10fa0/1. Recognizing that the port is assigned to VLAN 10, the switch tags the frame with 802.1Q tag: 10 and forwards it out the trunk link on port fa0/5 to the router. interface and routes it to the matching logical subinterface: .Logically partitioning a physical local area network into multiple distinct broadcast domains to improve security, traffic management, and performance.
Access ports carry traffic for a single assigned VLAN, whereas trunk ports multiplex traffic from multiple VLANs across a single physical link using IEEE 802.1Q tagging.
A configuration where a single physical router interface is partitioned into multiple logical subinterfaces, each serving as the default gateway for a specific VLAN.
An algorithmic network protocol designed to prevent loops in redundant Layer 2 bridged networks by dynamic blocking of select switch ports.
High-performance hardware-based routing implemented within switch ASICs, allowing inter-VLAN routing at line-rate speed without requiring external physical routers.
Test your understanding with 5 questions
Which of the following physical-layer or link-layer devices modifies the source or destination MAC address of a transit frame?
When configuring a subinterface on a router for Router-on-a-Stick, what command must be entered before assigning an IP address?
What is the primary operational consequence of configuring multiple VLANs on a single Layer 2 switch?
Which IEEE standard defines the frame tagging mechanism used to identify VLAN membership across trunk links?
Assume you have two hosts on VLAN 10 (192.168.1.0/24) and one host on VLAN 20 (192.168.2.0/24). Without a Layer 3 routing mechanism, what will occur if VLAN 10 hosts attempt to ping VLAN 20?
fa0/0.10192.168.2.10), and identifies that this subnet is reachable via subinterface fa0/0.20.fa0/0.20 interface MAC802.1Q tag: 20 header and transmits the frame back out the physical fa0/0 trunk to the switch.fa0/5. Reading the VLAN ID tag as 20, the switch strips the tag and forwards the clean Ethernet frame to access port fa0/3 where PC3 is connected.6 Modules
6 Modules