Trunking and Inter-VLAN Routing Explained
1. Trunking
Trunking is a method used to carry multiple VLANs (Virtual Local Area Networks) over a single physical link. This is essential for connecting switches in a network, allowing them to communicate across different VLANs without the need for multiple physical connections.
Example: Imagine you have a network with three VLANs: HR (VLAN 10), IT (VLAN 20), and Sales (VLAN 30). Instead of using three separate cables to connect two switches, you can use a single trunk link. This trunk link carries traffic for all three VLANs, enabling seamless communication between devices in different VLANs.
2. Inter-VLAN Routing
Inter-VLAN Routing is the process of enabling communication between devices in different VLANs. This is typically achieved by configuring a router or a Layer 3 switch to route traffic between VLANs. Inter-VLAN routing is crucial for creating a unified network where devices in different segments can communicate.
Example: Suppose you have a router with multiple interfaces, each connected to a different VLAN. You can configure each interface with the appropriate VLAN IP address. When a device in the HR VLAN (192.168.10.10) needs to communicate with a device in the IT VLAN (192.168.20.20), the router will route the traffic between these VLANs, ensuring that the communication is successful.
3. Practical Implementation
To implement Trunking and Inter-VLAN Routing, you need to configure both the switches and the router or Layer 3 switch. On the switches, you enable trunking on the links connecting them, and on the router or Layer 3 switch, you configure subinterfaces for each VLAN.
Example: On a MikroTik switch, you would configure a port as a trunk port using the command /interface ethernet set [interface] vlan-mode=trunk
. On the router, you would create subinterfaces for each VLAN using commands like /interface vlan add name=vlan10 interface=[interface] vlan-id=10
and assign IP addresses to these subinterfaces.